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
|
|---|---|---|---|---|---|
880b099f9448d3bf11a2e2b25322d500d093624e
|
diff --git a/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/services/task/commands/GetTaskContentCommand.java b/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/services/task/commands/GetTaskContentCommand.java
index <HASH>..<HASH> 100644
--- a/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/services/task/commands/GetTaskContentCommand.java
+++ b/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/services/task/commands/GetTaskContentCommand.java
@@ -30,7 +30,10 @@ public class GetTaskContentCommand extends TaskCommand<Map<String, Object>> {
@SuppressWarnings("unchecked")
public Map<String, Object> execute(Context cntxt) {
TaskContext context = (TaskContext) cntxt;
- Task taskById =context.getTaskQueryService().getTaskInstanceById(taskId);
+ Task taskById = context.getTaskQueryService().getTaskInstanceById(taskId);
+ if (taskById == null) {
+ throw new IllegalStateException("Unable to find task with id " + taskId);
+ }
TaskContentService contentService = context.getTaskContentService();
|
BZ-<I> - NPE in GetTaskContentCommand.java:<I> when trying to get task content for second human task in own web app
|
kiegroup_jbpm
|
train
|
java
|
9d4f08e30f7e9f9450844cf9dda49dac5eed86c8
|
diff --git a/tests/test_flow.py b/tests/test_flow.py
index <HASH>..<HASH> 100644
--- a/tests/test_flow.py
+++ b/tests/test_flow.py
@@ -13,6 +13,7 @@
# limitations under the License.
import concurrent.futures
+from functools import partial
import json
import os
@@ -165,11 +166,12 @@ class TestInstalledAppFlow(object):
def test_run_local_server(
self, webbrowser_mock, instance, mock_fetch_token):
auth_redirect_url = urllib.parse.urljoin(
- 'http://localhost:8080',
+ 'http://localhost:60452',
self.REDIRECT_REQUEST_PATH)
with concurrent.futures.ThreadPoolExecutor(max_workers=1) as pool:
- future = pool.submit(instance.run_local_server)
+ future = pool.submit(partial(
+ instance.run_local_server, port=60452))
while not future.done():
try:
|
Uses a test port that is less likely to be taken (#<I>)
After running this in a different CI environment, I had issues with the test being unable to open port <I> as it was already in use. This doesn't fix the problem perfectly but is less likely to encounter a collision.
|
googleapis_google-auth-library-python-oauthlib
|
train
|
py
|
459046f52acd6982fcc2434bc99e688e1fd98b41
|
diff --git a/internal/pixels/pixels.go b/internal/pixels/pixels.go
index <HASH>..<HASH> 100644
--- a/internal/pixels/pixels.go
+++ b/internal/pixels/pixels.go
@@ -15,6 +15,7 @@
package pixels
import (
+ "errors"
"image"
"image/color"
@@ -148,6 +149,9 @@ func (p *Pixels) HasDependency() bool {
//
// Restore is the only function that the pixel data is not present on GPU when this is called.
func (p *Pixels) Restore(context *opengl.Context, width, height int, filter opengl.Filter) (*graphics.Image, error) {
+ if p.stale {
+ return nil, errors.New("pixels: pixels must not be stale when restoring")
+ }
img := image.NewRGBA(image.Rect(0, 0, width, height))
if p.basePixels != nil {
for j := 0; j < height; j++ {
|
pixels: Ensure pixels is not stale when restoring
|
hajimehoshi_ebiten
|
train
|
go
|
ae0267198330f74accb7247739d8d848e1086310
|
diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js
index <HASH>..<HASH> 100644
--- a/lib/OpenLayers/Map.js
+++ b/lib/OpenLayers/Map.js
@@ -1008,7 +1008,10 @@ OpenLayers.Map.prototype = {
var dY = -parseInt(this.layerContainerDiv.style.top);
layerPx = viewPortPx.add(dX, dY);
}
- return layerPx;
+ if (!isNaN(layerPx.x) && !isNaN(layerPx.y)) {
+ return layerPx;
+ }
+ return null;
},
//
|
Don't ever return NaN from getLayerContainerPxFromViewPortPx, since that
can cause problems in multiple different layers -- instead, just return
null, which is handled more gracefully.
git-svn-id: <URL>
|
openlayers_openlayers
|
train
|
js
|
37220f5f5d2621eaa521a243e4f8f110e408504a
|
diff --git a/modules/social_features/social_topic/src/Controller/SocialTopicController.php b/modules/social_features/social_topic/src/Controller/SocialTopicController.php
index <HASH>..<HASH> 100644
--- a/modules/social_features/social_topic/src/Controller/SocialTopicController.php
+++ b/modules/social_features/social_topic/src/Controller/SocialTopicController.php
@@ -76,7 +76,7 @@ class SocialTopicController extends ControllerBase {
if ($topic_type_id !== NULL) {
// Topic type can be "All" will crash overview on /newest-topics.
if (is_numeric($topic_type_id)) {
- $term = $this->entityTypeManager->getStorage('topic')->load($topic_type_id);
+ $term = $this->entityTypeManager->getStorage('taxonomy_term')->load($topic_type_id);
if ($term->access('view') && $term->getVocabularyId() === 'topic_types') {
$term_title = $term->getName();
|
Issue #<I> by frankgraave: fixed the filter for the topic types
|
goalgorilla_open_social
|
train
|
php
|
1458c23b31c183ebc7142f46ba5ed291cd828703
|
diff --git a/lib/runner/run.js b/lib/runner/run.js
index <HASH>..<HASH> 100644
--- a/lib/runner/run.js
+++ b/lib/runner/run.js
@@ -67,10 +67,13 @@ _.extend(Run.prototype, {
return callback(new Error('run: already running'));
}
- _.isFinite(_.get(this.options, 'timeout.global')) &&
- backpack.timeback(callback, this.options.timeout.global, this, function () {
+ var timeback = callback;
+
+ if (_.isFinite(_.get(this.options, 'timeout.global'))) {
+ timeback = backpack.timeback(callback, this.options.timeout.global, this, function () {
this.pool.clear();
});
+ }
// invoke all the initialiser functions one after another and if it has any error then abort with callback.
async.series(_.map(Run.initialisers, function (initializer) {
@@ -81,7 +84,7 @@ _.extend(Run.prototype, {
// save the normalised callbacks as triggers
this.triggers = callback;
this.triggers.start(null, this.state.cursor.current()); // @todo may throw error if cursor absent
- this._process(callback);
+ this._process(timeback);
}.bind(this));
},
|
ensure that the timeout is respected and used
|
postmanlabs_postman-runtime
|
train
|
js
|
09e28040b451858978f4558434dd930b0961d172
|
diff --git a/lib/active_fulfillment/version.rb b/lib/active_fulfillment/version.rb
index <HASH>..<HASH> 100644
--- a/lib/active_fulfillment/version.rb
+++ b/lib/active_fulfillment/version.rb
@@ -1,4 +1,4 @@
# encoding: utf-8
module ActiveFulfillment
- VERSION = "3.0.0.pre5"
+ VERSION = "3.0.0.pre6"
end
|
Bump to <I>.pre6
|
Shopify_active_fulfillment
|
train
|
rb
|
57d49621daf656961d04097c6488b711f108c2e0
|
diff --git a/test/collection.js b/test/collection.js
index <HASH>..<HASH> 100644
--- a/test/collection.js
+++ b/test/collection.js
@@ -178,7 +178,7 @@ test('find > should project only specified fields using fields options', t => {
{ a: 1, b: 2 },
{ a: 1, b: 1 }
]).then(() => {
- return users.find({ sort: true }, { fields: { a: 1 } })
+ return users.find({}, { sort: true, fields: { a: 1 } })
}).then((docs) => {
t.is(docs[0].a, 1)
t.is(docs[0].b, undefined)
|
Fixed find test.
According to the prototype, first argument must be a query: (query, opts, fn)
|
Automattic_monk
|
train
|
js
|
c3de1091b6f23a23c3f1b8d2e70748d371f98620
|
diff --git a/lib/twofishes/client.rb b/lib/twofishes/client.rb
index <HASH>..<HASH> 100644
--- a/lib/twofishes/client.rb
+++ b/lib/twofishes/client.rb
@@ -11,9 +11,10 @@ module Twofishes
# @example
# Twofishes::Client.geocode('Zurich, Switzerland')
#
- def self.geocode(location, response_includes = [])
+ def self.geocode(location, includes = [])
handle_response do
- thrift_client.geocode(GeocodeRequest.new(query: location, responseIncludes: response_includes))
+ request = GeocodeRequest.new(query: location, responseIncludes: includes)
+ thrift_client.geocode()
end
end
@@ -24,10 +25,11 @@ module Twofishes
# @example
# Twofishes::Client.reverse_geocode([47.3787733, 8.5273363])
#
- def self.reverse_geocode(coords)
+ def self.reverse_geocode(coordinates, includes = [])
handle_response do
- point = GeocodePoint.new(lat: coords[0], lng: coords[1])
- thrift_client.reverseGeocode(GeocodeRequest.new(ll: point))
+ point = GeocodePoint.new(lat: coordinates[0], lng: coordinates[1])
+ request = GeocodeRequest.new(ll: point, responseIncludes: includes)
+ thrift_client.reverseGeocode(request)
end
end
|
reverse_geocode should accept responseIncludes too
|
masone_twofishes-ruby
|
train
|
rb
|
b69b378dd11bea856822bb110bd40815e9c96807
|
diff --git a/test/conftest.py b/test/conftest.py
index <HASH>..<HASH> 100644
--- a/test/conftest.py
+++ b/test/conftest.py
@@ -25,5 +25,6 @@ def app():
SCRIPTDIR, "testdata/dem_to_hillshade.mapchete")
args = Namespace(
port=5000, mapchete_file=example_process, zoom=None, bounds=None,
- input_file=None, memory=None, readonly=False, overwrite=True)
+ input_file=None, memory=None, readonly=False, overwrite=True,
+ debug=False)
return create_app(args)
|
fixed serve tests with new debug flag
|
ungarj_mapchete
|
train
|
py
|
ee34360440d27d2d715f9e3be9e5ec0897a79f39
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -21,6 +21,7 @@ module.exports = function (_cb) {
handshake: {
read: reader.read,
abort: function (err) {
+ writer.end(err)
reader.abort(err, function (err) {
})
_cb(err)
|
abort source and sink on an error
|
pull-stream_pull-handshake
|
train
|
js
|
e93aa77fb86d9efe0214bfadc36e280d2dd7de7c
|
diff --git a/src/colorMapper.js b/src/colorMapper.js
index <HASH>..<HASH> 100644
--- a/src/colorMapper.js
+++ b/src/colorMapper.js
@@ -109,19 +109,17 @@ export function differentialColorMapper (d, originalColor) {
if (delta === value) {
// likely a new frame, color orange
- r = 190 + Math.round(65 * vector)
- g = 90 + Math.round(65 * vector)
+ r = Math.round(235 * (1 - vector))
+ g = Math.round(135 * (1 - vector))
b = 0
} else if (delta > 0) {
// an increase, color red
- r = 200 + Math.round(55 * vector)
- g = 50 + Math.round(80 * vector)
- b = g
+ b = Math.round(235 * (1 - vector))
+ g = b
} else if (delta < 0) {
// a decrease, color blue
- r = 50 + Math.round(80 * vector)
+ r = Math.round(235 * (1 - vector))
g = r
- b = 200 + Math.round(55 * vector)
}
return 'rgb(' + r + ',' + g + ',' + b + ')'
|
refactor: differential color mapper improvement
|
spiermar_d3-flame-graph
|
train
|
js
|
31d374fba400723a52395b75d9e6e6e2cba70abb
|
diff --git a/src/foremast/utils/find_elb.py b/src/foremast/utils/find_elb.py
index <HASH>..<HASH> 100644
--- a/src/foremast/utils/find_elb.py
+++ b/src/foremast/utils/find_elb.py
@@ -32,4 +32,5 @@ def find_elb(name='', env='', region=''):
raise SpinnakerElbNotFound(
'Elb for "{0}" in region {1} not found'.format(name, region))
+ LOG.info('Found: %s', elb_dns)
return elb_dns
|
fix: INFO for found ELB
See also: PSOBAT-<I>
|
foremast_foremast
|
train
|
py
|
33199de419b0bea9d8b4942fc4c36e393ac4ae0f
|
diff --git a/src/Pdox.php b/src/Pdox.php
index <HASH>..<HASH> 100644
--- a/src/Pdox.php
+++ b/src/Pdox.php
@@ -13,6 +13,7 @@
namespace Buki;
use Buki\Cache;
+use Exception;
use PDO;
use PDOException;
use Closure;
@@ -496,13 +497,11 @@ class Pdox
$msg = '<h1>Database Error</h1>';
$msg .= '<h4>Query: <em style="font-weight:normal;">"'.$this->query.'"</em></h4>';
$msg .= '<h4>Error: <em style="font-weight:normal;">'.$this->error.'</em></h4>';
+
if($this->debug === true)
- {
die($msg);
- }
- else {
- throw new \Exception($msg);
- }
+ else
+ throw new Exception($this->error . ". (" . $this->query . ")");
}
public function get($type = false)
|
Updated error() methods and fixed error messages in Pdox.
|
izniburak_pdox
|
train
|
php
|
4209ae52f078b4edcc9ca6c5722ce4fbd936c294
|
diff --git a/lib/ecstatic/opts.js b/lib/ecstatic/opts.js
index <HASH>..<HASH> 100644
--- a/lib/ecstatic/opts.js
+++ b/lib/ecstatic/opts.js
@@ -4,7 +4,7 @@ module.exports = function (opts) {
var autoIndex = true,
showDir = false,
- humanReadable = false,
+ humanReadable = true,
si = false,
cache = 'max-age=3600',
gzip = false,
@@ -34,7 +34,8 @@ module.exports = function (opts) {
[
'humanReadable',
- 'humanreadable'
+ 'humanreadable',
+ 'human-readable'
].some(function (k) {
if (typeof opts[k] !== 'undefined' && opts[k] !== null) {
humanReadable = opts[k];
@@ -43,7 +44,8 @@ module.exports = function (opts) {
});
[
- 'si'
+ 'si',
+ 'index'
].some(function (k) {
if (typeof opts[k] !== 'undefined' && opts[k] !== null) {
si = opts[k];
|
Opts for human-readable and si
|
jfhbrook_node-ecstatic
|
train
|
js
|
ea66f6a76e741580462bfffef06f7fd913917960
|
diff --git a/generators/newapp/new.go b/generators/newapp/new.go
index <HASH>..<HASH> 100644
--- a/generators/newapp/new.go
+++ b/generators/newapp/new.go
@@ -19,7 +19,6 @@ import (
// Run returns a generator to create a new application
func (a Generator) Run(root string, data makr.Data) error {
g := makr.New()
- defer g.Fmt(a.Root)
if a.Force {
os.RemoveAll(a.Root)
@@ -104,6 +103,13 @@ func (a Generator) Run(root string, data makr.Data) error {
}
g.Add(makr.NewCommand(a.goGet()))
+ g.Add(makr.Func{
+ Runner: func(root string, data makr.Data) error {
+ g.Fmt(root)
+ return nil
+ },
+ })
+
if _, err := exec.LookPath("git"); err == nil {
g.Add(makr.NewCommand(exec.Command("git", "init")))
g.Add(makr.NewCommand(exec.Command("git", "add", ".")))
|
make sure fmt/imports is run before git init
|
gobuffalo_buffalo
|
train
|
go
|
bd77f25262a652227b2dd3f4ee33c3f0bd5b9d77
|
diff --git a/lib/solargraph/language_server/host.rb b/lib/solargraph/language_server/host.rb
index <HASH>..<HASH> 100644
--- a/lib/solargraph/language_server/host.rb
+++ b/lib/solargraph/language_server/host.rb
@@ -136,7 +136,7 @@ module Solargraph
def open? uri
result = nil
@change_semaphore.synchronize do
- result = library.open?(uri_to_file(uri))
+ result = unsafe_open?(uri)
end
result
end
@@ -503,6 +503,10 @@ module Solargraph
@change_queue.any?{|change| change['textDocument']['uri'] == file_uri}
end
+ def unsafe_open? uri
+ library.open?(uri_to_file(uri))
+ end
+
def requests
@requests ||= {}
end
@@ -546,9 +550,13 @@ module Solargraph
@diagnostics_queue.push change['textDocument']['uri']
next true
else
- # @todo Change is out of order. Save it for later
- STDERR.puts "Skipping out of order change to #{change['textDocument']['uri']}"
- next false
+ if unsafe_open?(change['textDocument']['uri'])
+ STDERR.puts "Skipping out of order change to #{change['textDocument']['uri']}"
+ next false
+ else
+ STDERR.puts "Deleting out of order change to closed file #{change['textDocument']['uri']}"
+ next true
+ end
end
end
refreshable = changed and @change_queue.empty?
|
Host deletes out of order changes to closed files.
|
castwide_solargraph
|
train
|
rb
|
068ccfa4d9a77b76e1cb0d5fe779c347356ca230
|
diff --git a/Controller/Tool/RolesController.php b/Controller/Tool/RolesController.php
index <HASH>..<HASH> 100644
--- a/Controller/Tool/RolesController.php
+++ b/Controller/Tool/RolesController.php
@@ -406,8 +406,7 @@ class RolesController extends Controller
{
$this->checkAccess($workspace);
$this->roleManager->associateRolesToSubjects($users, $roles, true);
- $listCptNodes = $this->cptManager->getCompetenceByWorkspace($workspace);
- $this->cptManager->subscribeUserToCompetences($users,$listCptNodes);
+
return new Response('success');
}
|
[CoreBundle] Fixes competence bug when registering user to workspace
|
claroline_Distribution
|
train
|
php
|
2b572040645766dc83eaba876ffd0b0fcc055f12
|
diff --git a/library/src/pivotal-ui-react/tabs/tabs.js b/library/src/pivotal-ui-react/tabs/tabs.js
index <HASH>..<HASH> 100644
--- a/library/src/pivotal-ui-react/tabs/tabs.js
+++ b/library/src/pivotal-ui-react/tabs/tabs.js
@@ -178,7 +178,6 @@ class Tabs extends mixin(React.Component).with(Animation) {
actions,
children,
className,
- defaultActiveKey,
id = this.state.id,
largeScreenClassName,
onSelect,
@@ -186,7 +185,6 @@ class Tabs extends mixin(React.Component).with(Animation) {
position,
tabType,
tabWidth,
- responsiveBreakpoint,
...props} = this.props;
const largeScreenClasses = classnames([`tab-${tabType}`, largeScreenClassName, className]);
|
chore(Tabs): Remove crufty props
[#<I>]
|
pivotal-cf_pivotal-ui
|
train
|
js
|
697994882b08f9f19c54101c328c532c81ace059
|
diff --git a/TYPO3.Flow/Classes/Persistence/DataMapper.php b/TYPO3.Flow/Classes/Persistence/DataMapper.php
index <HASH>..<HASH> 100644
--- a/TYPO3.Flow/Classes/Persistence/DataMapper.php
+++ b/TYPO3.Flow/Classes/Persistence/DataMapper.php
@@ -199,9 +199,9 @@ class DataMapper {
* @author Karsten Dambekalns <karsten@typo3.org>
*/
protected function mapDateTime($timestamp) {
- if (is_integer($timestamp)) {
+ if ($timestamp !== NULL) {
$datetime = new \DateTime();
- $datetime->setTimestamp($timestamp);
+ $datetime->setTimestamp((integer) $timestamp);
return $datetime;
} else {
return NULL;
|
[~TASK] FLOW3 (Persistence): Followup to r<I> regarding timestamp detection in mapDateTime().
Original-Commit-Hash: db<I>c<I>e<I>b4fa<I>af<I>da7f<I>dbd8e
|
neos_flow-development-collection
|
train
|
php
|
603a67111b4ae8457b721d9a1bfc3b0d25927265
|
diff --git a/src/Twig/Handler/RecordHandler.php b/src/Twig/Handler/RecordHandler.php
index <HASH>..<HASH> 100644
--- a/src/Twig/Handler/RecordHandler.php
+++ b/src/Twig/Handler/RecordHandler.php
@@ -188,7 +188,7 @@ class RecordHandler
->notPath('node_modules')
->notPath('bower_components')
->notPath('.sass-cache')
- ->depth('<2')
+ ->depth('<4')
->path($name)
->sortByName()
;
@@ -200,7 +200,7 @@ class RecordHandler
// Get the active themeconfig
$themeConfig = $this->app['config']->get('theme/templateselect/templates', false);
-
+
// Check: Have we defined names for any of the matched templates?
if ($themeConfig) {
foreach ($themeConfig as $templateFile) {
|
Look for template files in deeper folders.
Fixes #<I>
|
bolt_bolt
|
train
|
php
|
12a23196a0381f35072375edb25e8cd8fa5ebbd0
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -51,6 +51,7 @@ export default class Drawer extends Component {
onCloseStart: PropTypes.func,
onOpen: PropTypes.func,
onOpenStart: PropTypes.func,
+ onDragStart: PropTypes.func,
openDrawerOffset: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
panThreshold: PropTypes.number,
panCloseMask: PropTypes.number,
@@ -244,7 +245,7 @@ export default class Drawer extends Component {
this._panning = false
this.shouldOpenDrawer(gestureState.dx) ? this.open() : this.close()
};
-
+
onStartShouldSetPanResponderCapture = (e, gestureState) => {
if (this.shouldCaptureGestures()) return this.processShouldSet(e, gestureState)
return false
@@ -278,6 +279,9 @@ export default class Drawer extends Component {
this._left = left
this.updatePosition()
+ if (!this._panning) {
+ this.props.onDragStart && this.props.onDragStart();
+ }
this._panning = true
};
@@ -398,7 +402,7 @@ export default class Drawer extends Component {
if(typeof type === 'function') {
type() // this is actually a callback
} else cb && cb()
-
+
}
})
};
|
Add support for onDragStart
|
root-two_react-native-drawer
|
train
|
js
|
8592c7ad0addf0df1d8afea6ba88a4d6cdd34c2a
|
diff --git a/src/main/java/com/google/cloud/genomics/dataflow/utils/GenomicsDatasetOptions.java b/src/main/java/com/google/cloud/genomics/dataflow/utils/GenomicsDatasetOptions.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/google/cloud/genomics/dataflow/utils/GenomicsDatasetOptions.java
+++ b/src/main/java/com/google/cloud/genomics/dataflow/utils/GenomicsDatasetOptions.java
@@ -104,7 +104,7 @@ public interface GenomicsDatasetOptions extends GenomicsOptions {
@Description("The IDs of the Google Genomics transcript sets this pipeline is working with, "
+ "comma delimited. Defaults to UCSC refGene (hg19).")
- @Default.String("CIjfoPXj9LqPlAEQ6Mm91Ya458eqAQ")
+ @Default.String("CIjfoPXj9LqPlAEQ5vnql4KewYuSAQ")
String getTranscriptSetIds();
void setTranscriptSetIds(String transcriptSetIds);
|
Update UCSC transcript set to reimported version
This version of the transcriptset has gene IDs populated.
|
googlegenomics_dataflow-java
|
train
|
java
|
a33875f9c5479b8bb78835b630ce60507c70f2a8
|
diff --git a/git.go b/git.go
index <HASH>..<HASH> 100644
--- a/git.go
+++ b/git.go
@@ -11,7 +11,6 @@ import (
"errors"
"unsafe"
"strings"
- "fmt"
)
const (
diff --git a/packbuilder.go b/packbuilder.go
index <HASH>..<HASH> 100644
--- a/packbuilder.go
+++ b/packbuilder.go
@@ -121,7 +121,7 @@ func (pb *Packbuilder) forEachWrap(data *packbuilderCbData) {
// you want to stop the pack-building process (e.g. there's an error
// writing to the output), close or write a value into the "stop"
// channel.
-func (pb *Packbuilder) ForEach() (data <-chan []byte, stop chan<- bool) {
+func (pb *Packbuilder) ForEach() (<-chan []byte, chan<- bool) {
ch := make(chan []byte)
stop := make(chan bool)
data := packbuilderCbData{ch, stop}
|
Packbuilder: compilation fixes
Don't name the return values, as they conflict with the names we want
inside and the types don't match what we want to have inside. We need
them to be two-way channels in the function, and then pass
unidirectional references to the different functions.
|
libgit2_git2go
|
train
|
go,go
|
db6468ac6be898b5ee11a2f45ca453bf7bc41161
|
diff --git a/src/Testing/RuleTestCase.php b/src/Testing/RuleTestCase.php
index <HASH>..<HASH> 100644
--- a/src/Testing/RuleTestCase.php
+++ b/src/Testing/RuleTestCase.php
@@ -28,9 +28,11 @@ abstract class RuleTestCase extends \PHPUnit_Framework_TestCase
$count = count($violations);
$expectedCount = count($expectedViolations);
+ // @codeCoverageIgnoreStart
if ($count === 0 && $expectedCount > 0) {
$this->fail("{$expectedCount} violations were expected in {$file}, none found");
}
+ // @codeCoverageIgnoreEnd
$stdViolations = array_map(function ($violation) {
return $violation->toStdClass();
@@ -44,6 +46,9 @@ abstract class RuleTestCase extends \PHPUnit_Framework_TestCase
);
}
+ /**
+ * @codeCoverageIgnore (data providers are executed before tests start)
+ */
public function sampleProvider()
{
$ruleName = $this->getRule()->name();
|
Ignore coverage of code unreachable during tests
|
stefk_md
|
train
|
php
|
7d02eedd6985d236d0714dfea9f724c60cadea22
|
diff --git a/bin/add_machine.rb b/bin/add_machine.rb
index <HASH>..<HASH> 100755
--- a/bin/add_machine.rb
+++ b/bin/add_machine.rb
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
-require_relative '../lib/boxcutter'
+require File.dirname(__FILE__) + '/../lib/boxcutter'
require 'trollop'
opts = Trollop::options do
diff --git a/bin/remove_machine.rb b/bin/remove_machine.rb
index <HASH>..<HASH> 100755
--- a/bin/remove_machine.rb
+++ b/bin/remove_machine.rb
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
-require_relative '../lib/boxcutter'
+require File.dirname(__FILE__) + '/../lib/boxcutter'
require 'trollop'
opts = Trollop::options do
|
Remove <I> dependency from scripts
|
dplummer_boxcutter
|
train
|
rb,rb
|
ece8b7458c413fdf2be8bd89b93ccc69d903d5dd
|
diff --git a/model/src/main/java/org/jboss/pnc/model/Base32LongID.java b/model/src/main/java/org/jboss/pnc/model/Base32LongID.java
index <HASH>..<HASH> 100644
--- a/model/src/main/java/org/jboss/pnc/model/Base32LongID.java
+++ b/model/src/main/java/org/jboss/pnc/model/Base32LongID.java
@@ -83,6 +83,7 @@ public class Base32LongID implements Serializable {
* @throws IOException
*/
private void writeObject(java.io.ObjectOutputStream stream) throws IOException {
+ stream.defaultWriteObject();
stream.writeLong(id);
}
@@ -94,7 +95,7 @@ public class Base32LongID implements Serializable {
* @throws ClassNotFoundException
*/
private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException {
+ stream.defaultReadObject();
this.id = stream.readLong();
}
-
}
|
[NCLSUP-<I>] add readDefaultObject and writeDefaultObject
This is a suggestion from Paul Ferraro to ensure that the requisite
class descriptors (as well as any non-transient fields) are written to
the stream (which are required by JBoss Marshalling for
deserialization).
|
project-ncl_pnc
|
train
|
java
|
ab2744826d031fff635f820deeaa8406ac0fd551
|
diff --git a/src/nodes.js b/src/nodes.js
index <HASH>..<HASH> 100644
--- a/src/nodes.js
+++ b/src/nodes.js
@@ -20,7 +20,7 @@ export default function virtualizeNodes(element, options = {}) {
function convertNode(element, createdVNodes, context) {
// If our node is a text node, then we only want to set the `text` part of
// the VNode.
- if (element.nodeType === Node.TEXT_NODE) {
+ if (element.nodeType === context.defaultView.Node.TEXT_NODE) {
const newNode = createTextVNode(element.textContent, context);
createdVNodes.push(newNode);
return newNode
|
Use the context to access Node constants, instead of relying on global.
|
appcues_snabbdom-virtualize
|
train
|
js
|
865ec3ec96b6b2985cc332bdfa9b6a6d0ba90950
|
diff --git a/src/Client.php b/src/Client.php
index <HASH>..<HASH> 100755
--- a/src/Client.php
+++ b/src/Client.php
@@ -39,7 +39,7 @@ class Client
if (isset($options['auth_timeout_seconds'])) {
$this->authTimeoutSeconds = $options['auth_timeout_seconds'];
} else {
- $this->authTimeoutSeconds = 12 * 60 * 60; // 12 hour default
+ $this->authTimeoutSeconds = 12 * 60 * 60; // 12 hour default
}
// set reauthorize time to force an authentication to take place
|
Spacing problem fixed. #scrutinizer-ci
|
gliterd_backblaze-b2
|
train
|
php
|
07744108030c60853f7c4e8bd6c8c00d5286309d
|
diff --git a/src/Admin/AdminAccount.php b/src/Admin/AdminAccount.php
index <HASH>..<HASH> 100644
--- a/src/Admin/AdminAccount.php
+++ b/src/Admin/AdminAccount.php
@@ -38,7 +38,8 @@ class AdminAccount {
}
/**
- * @return mixed
+ * [RO] Preia o lista cu informatii generale ale contului de afiliat (https://github.com/celdotro/marketplace/wiki/Listeaza-informatiile-contului)
+ * [EN] Retrieves a list of general account information (https://github.com/celdotro/marketplace/wiki/List-account-information)
*/
public function getAccountInformation(){
// Set method and action
|
Added comments for account information retrieval
|
celdotro_marketplace
|
train
|
php
|
6889c6152dea729638e40297c8d709b41419ad6b
|
diff --git a/test/models/person.rb b/test/models/person.rb
index <HASH>..<HASH> 100644
--- a/test/models/person.rb
+++ b/test/models/person.rb
@@ -14,6 +14,6 @@ class Person
end
def ==(other_person)
- other_person.is_a?(Person) && id = other_person.id
+ other_person.is_a?(Person) && id == other_person.id
end
-end
\ No newline at end of file
+end
|
Fix `Person#==` method in test.
|
rails_rails
|
train
|
rb
|
4fc26934ecbb3fed4debd76d0b4f1baf4f98844d
|
diff --git a/main/main.go b/main/main.go
index <HASH>..<HASH> 100644
--- a/main/main.go
+++ b/main/main.go
@@ -165,9 +165,13 @@ and this stack trace:
%s
`
-
+ stackByteCount := 0
+ STACK_SIZE_LIMIT := 1024 * 1024
var bytes []byte
- runtime.Stack(bytes, true)
+ for stackSize := 1024; (stackByteCount == 0 || stackByteCount == stackSize) && stackSize < STACK_SIZE_LIMIT; stackSize = 2 * stackSize {
+ bytes = make([]byte, stackSize)
+ stackByteCount = runtime.Stack(bytes, true)
+ }
stackTrace := "\t" + strings.Replace(string(bytes), "\n", "\n\t", -1)
println(fmt.Sprintf(formattedString, cf.Name(), strings.Join(os.Args, " "), errorMessage, stackTrace))
}
|
added code to allocate bytes for runtime.Stack() call
|
cloudfoundry_cli
|
train
|
go
|
7844a3c5870868faed56fd45572a101ef19487ab
|
diff --git a/lib/gcli/test/automators/requisition.js b/lib/gcli/test/automators/requisition.js
index <HASH>..<HASH> 100644
--- a/lib/gcli/test/automators/requisition.js
+++ b/lib/gcli/test/automators/requisition.js
@@ -31,8 +31,6 @@ exports.createRequisitionAutomator = function(requisition) {
updateCursor();
};
- requisition.onTextChange.add(textChanged);
-
var updateCursor = function() {
cursor.start = typed.length;
cursor.end = typed.length;
@@ -54,7 +52,6 @@ exports.createRequisitionAutomator = function(requisition) {
},
getInputState: function() {
- var typed = requisition.toString();
return {
typed: typed,
cursor: { start: cursor.start, end: cursor.end }
@@ -91,11 +88,11 @@ exports.createRequisitionAutomator = function(requisition) {
if (keyCode === KeyEvent.DOM_VK_RETURN) {
throw new Error('Fake DOM_VK_RETURN not supported');
}
+ typed = requisition.toString();
updateCursor();
},
destroy: function() {
- requisition.onTextChange.remove(textChanged);
}
};
|
jsterm-<I>: Remove onTextChange from Requisition Automator
For command line testing we don’t need this event either.
|
joewalker_gcli
|
train
|
js
|
02fb33e3e8c03444c01260aeb9e82896a7d14b69
|
diff --git a/lib/heroku/command/pg_backups.rb b/lib/heroku/command/pg_backups.rb
index <HASH>..<HASH> 100644
--- a/lib/heroku/command/pg_backups.rb
+++ b/lib/heroku/command/pg_backups.rb
@@ -112,13 +112,13 @@ class Heroku::Command::Pg < Heroku::Command::Base
end
def size_pretty(bytes)
- suffixes = {
- 'B' => 1,
- 'kB' => 1_000,
- 'MB' => 1_000_000,
- 'GB' => 1_000_000_000,
- 'TB' => 1_000_000_000_000 # (ohdear)
- }
+ suffixes = [
+ ['B', 1],
+ ['kB', 1_000],
+ ['MB', 1_000_000],
+ ['GB', 1_000_000_000],
+ ['TB', 1_000_000_000_000] # (ohdear)
+ ]
suffix, multiplier = suffixes.find do |k,v|
normalized = bytes / v.to_f
normalized >= 0 && normalized < 1_000
|
Fix size_pretty on <I> since it doesn't guarantee hash key order
|
heroku_legacy-cli
|
train
|
rb
|
8d77b2baa8d3c2cc2a42343a1f57288e74a58044
|
diff --git a/tests/Environment.php b/tests/Environment.php
index <HASH>..<HASH> 100644
--- a/tests/Environment.php
+++ b/tests/Environment.php
@@ -27,15 +27,11 @@ trait Environment
'--all' => true,
]);
- $this->artisan('orchid:link');
-
- //$this->loadLaravelMigrations('orchid');
-
$this->artisan('migrate:fresh', [
'--database' => 'orchid',
]);
- $this->artisan('storage:link');
+ //$this->artisan('storage:link');
$this->artisan('orchid:link');
$this->withFactories(realpath(DASHBOARD_PATH.'/database/factories'));
|
ErrorException: symlink(): No such file or directory
|
orchidsoftware_platform
|
train
|
php
|
e52e5a34e1968ee5424aa0f5216c09e327fd7996
|
diff --git a/spec/request/base/request_attach_spec.rb b/spec/request/base/request_attach_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/request/base/request_attach_spec.rb
+++ b/spec/request/base/request_attach_spec.rb
@@ -11,7 +11,7 @@ describe 'RubyRabbitmqJanus::RRJ -- message type attach' do
describe '#start_transaction', type: :request,
level: :base,
name: :attach do
- context 'when queue is exclusive' do
+ context 'when queue is exclusive', broken: true do
include_examples 'transaction should match json schema'
end
diff --git a/spec/request/peer/request_offer_spec.rb b/spec/request/peer/request_offer_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/request/peer/request_offer_spec.rb
+++ b/spec/request/peer/request_offer_spec.rb
@@ -2,7 +2,8 @@
require 'spec_helper'
-describe 'RubyRabbitmqJanus::RRJ -- message type offer' do
+# @todo Create a message reading by janus
+describe 'RubyRabbitmqJanus::RRJ -- message type offer', broken: true do
before(:example) do
clear
attach_base
|
Change spec in broken mode :(
|
dazzl-tv_ruby-rabbitmq-janus
|
train
|
rb,rb
|
97f96cbea674faedfc1a3e7041ecbeda1ee5fd63
|
diff --git a/lib/GameWindow.js b/lib/GameWindow.js
index <HASH>..<HASH> 100644
--- a/lib/GameWindow.js
+++ b/lib/GameWindow.js
@@ -898,7 +898,7 @@
oldPos = this.headerPosition;
- // Store the new position in a reference variable
+ // Store the new position in a reference variable
// **before** adaptFrame2HeaderPosition is called
this.headerPosition = pos;
@@ -1344,6 +1344,8 @@
*
* Warning: Security policies may block this method if the content is
* coming from another domain.
+ * Notice: If called multiple times within the same stage/step, it will
+ * the `VisualTimer` widget to reload the timer.
*
* @param {string} uri The uri to load
* @param {function} func Optional. The function to call once the DOM is
@@ -1770,7 +1772,7 @@
W.removeClass(W.frameElement, 'ng_mainframe-header-[a-z-]*');
switch(position) {
- case 'right':
+ case 'right':
W.addClass(W.frameElement, 'ng_mainframe-header-vertical-r');
break;
case 'left':
|
Added notice to GameWindow.loadFrame about resetting of VisualTimer
|
nodeGame_nodegame-window
|
train
|
js
|
46ced17771978b0c3a39f6815150b00efba4d1e8
|
diff --git a/salt/pillar/ec2_pillar.py b/salt/pillar/ec2_pillar.py
index <HASH>..<HASH> 100644
--- a/salt/pillar/ec2_pillar.py
+++ b/salt/pillar/ec2_pillar.py
@@ -242,6 +242,10 @@ def ext_pillar(
# Get the Master's instance info, primarily the region
(_, region) = _get_instance_info()
+ # If the Minion's region is available, use it instead
+ if use_grain:
+ region = __grains__.get('ec2', {}).get('region', region)
+
try:
conn = boto.ec2.connect_to_region(region)
except boto.exception.AWSConnectionError as exc:
|
Use the minion's region if use_grain is enabled
This makes it possible for the master to be in a different region
than the minion and still fetch ec2 pillars. This requires the
use_grain configuration to be set to True and will fall back to the
master's region if there is no region grain.
Credit to John Nielsen for the code.
|
saltstack_salt
|
train
|
py
|
23b9ad5fb103b0a50fbeede84279881d9dbc1687
|
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index <HASH>..<HASH> 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -442,7 +442,7 @@ module Rails
# the file with the master key.
# The master key is either stored in `config/master.key` or `ENV["RAILS_MASTER_KEY"]`.
#
- # Rails.application.encrypted("config/mystery_man.key").read
+ # Rails.application.encrypted("config/mystery_man.txt.enc").read
# # => "We've met before, haven't we?"
#
# It's also possible to interpret encrypted YAML files with `config`.
|
Fixed example of `Rails.application.encrypted` method usage
[ci skip]
|
rails_rails
|
train
|
rb
|
cd54542f2ba6386d4a436c20574c12714a074f58
|
diff --git a/law/config.py b/law/config.py
index <HASH>..<HASH> 100644
--- a/law/config.py
+++ b/law/config.py
@@ -55,7 +55,7 @@ class Config(ConfigParser):
"singularity_volumes": {},
}
- _config_files = ["$LAW_CONFIG_FILE", "$HOME/.law/config", "etc/law/config"]
+ _config_files = ["$LAW_CONFIG_FILE", "law.cfg", "$HOME/.law/config", "etc/law/config"]
@classmethod
def instance(cls, config_file=""):
@@ -109,13 +109,13 @@ class Config(ConfigParser):
overwrite_sections = overwrite
overwrite_options = overwrite
- for section, _data in data.items():
+ for section, _data in six.iteritems(data):
if not self.has_section(section):
self.add_section(section)
elif not overwrite_sections:
continue
- for option, value in _data.items():
+ for option, value in six.iteritems(_data):
if overwrite_options or not self.has_option(section, option):
self.set(section, option, str(value))
|
Add additional fallback config in current dir.
|
riga_law
|
train
|
py
|
6b26fb07a2f283b45ad5259aeab691ec644eb9ff
|
diff --git a/src/Devture/Bundle/LocalizationBundle/Routing/LocaleAwareUrlGenerator.php b/src/Devture/Bundle/LocalizationBundle/Routing/LocaleAwareUrlGenerator.php
index <HASH>..<HASH> 100644
--- a/src/Devture/Bundle/LocalizationBundle/Routing/LocaleAwareUrlGenerator.php
+++ b/src/Devture/Bundle/LocalizationBundle/Routing/LocaleAwareUrlGenerator.php
@@ -20,7 +20,11 @@ class LocaleAwareUrlGenerator extends UrlGenerator {
$route = $this->routes->get($name);
if ($route instanceof Route) {
if (strpos($route->getPath(), '{locale}') !== false) {
- $parameters['locale'] = $this->getRequest()->getLocale();
+ try {
+ $parameters['locale'] = $this->getRequest()->getLocale();
+ } catch (\RuntimeException $e) {
+ //Not running in a request context.
+ }
}
}
return parent::generate($name, $parameters, $absolute);
|
Don't break when not running in a request context
|
devture_silex-localization-bundle
|
train
|
php
|
24130b56f4d50d06e77bbea81a45b225f0ababfd
|
diff --git a/thinc/neural/util.py b/thinc/neural/util.py
index <HASH>..<HASH> 100644
--- a/thinc/neural/util.py
+++ b/thinc/neural/util.py
@@ -52,12 +52,14 @@ def copy_array(dst, src, casting='same_kind', where=None):
else:
numpy.copyto(dst, src)
-
def ensure_path(path):
- if isinstance(path, basestring) or isinstance(path, str):
- return Path(path)
- else:
- return path
+ try:
+ if isinstance(path, basestring) or isinstance(path, str):
+ return Path(path)
+ except NameError:
+ if isinstance(path, str):
+ return Path(path)
+ return path
def to_categorical(y, nb_classes=None):
|
Try/Except around use of basestring that doesn't exist in python3
|
explosion_thinc
|
train
|
py
|
0cd831e01a54cc8408b7e960891e06d5c0b1c0e0
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -43,7 +43,6 @@ setup(
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
- "Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
|
We no longer support Python <I>
|
urschrei_pyzotero
|
train
|
py
|
fbbaeb871bccb95367ff9967dd97df85e8babe27
|
diff --git a/views/mdc/assets/js/components/events/posts.js b/views/mdc/assets/js/components/events/posts.js
index <HASH>..<HASH> 100644
--- a/views/mdc/assets/js/components/events/posts.js
+++ b/views/mdc/assets/js/components/events/posts.js
@@ -1,5 +1,6 @@
import {VSnackbar} from '../snackbar';
import {VBase} from './base';
+import Config from '../../utils/config';
// Replaces a given element with the contents of the call to the url.
// parameters are appended.
@@ -79,7 +80,13 @@ export class VPosts extends VBase {
};
// Set up our request
httpRequest.open(method, url);
- console.log(method + ':' + url);
+
+ const headers = Config.get('request.headers.POST');
+
+ for (const [key, value] of Object.entries(headers)) {
+ httpRequest.setRequestHeader(key, value);
+ }
+
// Send our FormData object; HTTP headers are set automatically
httpRequest.send(FD);
});
@@ -96,4 +103,4 @@ export class VPosts extends VBase {
}
return null;
}
-}
\ No newline at end of file
+}
|
(#<I>) Set POST request headers from configuration
|
rx_presenters
|
train
|
js
|
3dbc84088abf09ead694e5940afa4afc7c0d7b32
|
diff --git a/src/Provider/Google.php b/src/Provider/Google.php
index <HASH>..<HASH> 100644
--- a/src/Provider/Google.php
+++ b/src/Provider/Google.php
@@ -43,7 +43,7 @@ class Google extends AbstractProvider
{
return
'https://www.googleapis.com/plus/v1/people/me?'.
- 'fields=name(familyName%2CgivenName)%2CdisplayName%2C'.
+ 'fields=id%2Cname(familyName%2CgivenName)%2CdisplayName%2C'.
'emails%2Fvalue%2Cimage%2Furl&alt=json&access_token='.$token;
}
|
id was not being returned by Google
|
osufpp_oauth2-ifsta
|
train
|
php
|
daa014d14faeb8baa395d9a7c4539b477874f05e
|
diff --git a/pychromecast/__init__.py b/pychromecast/__init__.py
index <HASH>..<HASH> 100644
--- a/pychromecast/__init__.py
+++ b/pychromecast/__init__.py
@@ -363,10 +363,8 @@ class Chromecast:
def ignore_cec(self):
""" Returns whether the CEC data should be ignored. """
return self.device is not None and any(
- [
- fnmatch.fnmatchcase(self.device.friendly_name, pattern)
- for pattern in IGNORE_CEC
- ]
+ fnmatch.fnmatchcase(self.device.friendly_name, pattern)
+ for pattern in IGNORE_CEC
)
@property
diff --git a/pychromecast/socket_client.py b/pychromecast/socket_client.py
index <HASH>..<HASH> 100644
--- a/pychromecast/socket_client.py
+++ b/pychromecast/socket_client.py
@@ -340,7 +340,8 @@ class SocketClient(threading.Thread):
self.port,
)
self.socket.connect((self.host, self.port))
- self.socket = ssl.wrap_socket(self.socket)
+ context = ssl.SSLContext()
+ self.socket = context.wrap_socket(self.socket)
self.connecting = False
self._force_recon = False
self._report_connection_status(
|
Adapt to pylint <I> (#<I>)
|
balloob_pychromecast
|
train
|
py,py
|
2901a30ec980744414d7baaeec8156c8c29d3da9
|
diff --git a/avakas/avakas.py b/avakas/avakas.py
index <HASH>..<HASH> 100644
--- a/avakas/avakas.py
+++ b/avakas/avakas.py
@@ -49,6 +49,7 @@ class Avakas():
@property
def version(self):
"""Get version"""
+
tag_prefix = self.options.get('tag_prefix', '')
return "%s%s" % (tag_prefix, self._version)
diff --git a/avakas/flavors/base.py b/avakas/flavors/base.py
index <HASH>..<HASH> 100644
--- a/avakas/flavors/base.py
+++ b/avakas/flavors/base.py
@@ -124,6 +124,7 @@ class AvakasLegacy(Avakas):
def write_versionfile(self):
"""Write the version file"""
+
path = os.path.join(self.directory, self.version_filename)
version_file = open(path, 'w')
version_file.write("%s\n" % self.version)
|
Whitespace: added a break after docstring
|
otakup0pe_avakas
|
train
|
py,py
|
5dba8f1a8ba28a972b3ff45fb201b96762f363a0
|
diff --git a/src/grid/GridView.php b/src/grid/GridView.php
index <HASH>..<HASH> 100644
--- a/src/grid/GridView.php
+++ b/src/grid/GridView.php
@@ -78,6 +78,9 @@ class GridView extends \hiqdev\higrid\GridView
'class' => ClientColumn::class,
'attribute' => 'client_id',
],
+ 'client_like' => [
+ 'class' => ClientColumn::class,
+ ],
];
}
|
Added search by client_like to default GridView
|
hiqdev_hipanel-core
|
train
|
php
|
e60782d119170444560d48ffc84759e98e409c94
|
diff --git a/src/notebook/reducers/document.js b/src/notebook/reducers/document.js
index <HASH>..<HASH> 100644
--- a/src/notebook/reducers/document.js
+++ b/src/notebook/reducers/document.js
@@ -21,9 +21,25 @@ export default {
const { notebook } = state;
const cellOrder = notebook.get('cellOrder');
const curIndex = cellOrder.findIndex(id => id === action.id);
+
+ const nextIndex = curIndex + 1;
+
+ // When at the end, create a new cell
+ if (nextIndex >= cellOrder.size) {
+ const cellID = uuid.v4();
+ // TODO: condition on state.defaultCellType (markdown vs. code)
+ const cell = commutable.emptyCodeCell;
+ return {
+ ...state,
+ focusedCell: cellID,
+ notebook: commutable.insertCellAt(notebook, cell, cellID, nextIndex),
+ };
+ }
+
+ // When in the middle of the notebook document, move to the next cell
return {
...state,
- focusedCell: cellOrder.get(curIndex + 1),
+ focusedCell: cellOrder.get(nextIndex),
};
},
[constants.UPDATE_CELL_EXECUTION_COUNT]: function updateExecutionCount(state, action) {
|
When at end of doc, create new cell after run cell
|
nteract_nteract
|
train
|
js
|
48fca06e1e482023c19f6b9e763530cf8981e224
|
diff --git a/sirtrevor/views.py b/sirtrevor/views.py
index <HASH>..<HASH> 100644
--- a/sirtrevor/views.py
+++ b/sirtrevor/views.py
@@ -47,6 +47,7 @@ def attachment(request):
data['path'] = default_storage.save(name, file_)
data['url'] = default_storage.url(data['path'])
+ data['name'] = os.path.split(data['path'])[1]
data['size'] = file_.size
return HttpResponse(json.dumps({'file': data}))
|
Also return the file name for each attachment.
|
philippbosch_django-sirtrevor
|
train
|
py
|
b4ca40746f6ef86d5d3e0d882372385ee062054c
|
diff --git a/bulbs/indexable/indexable.py b/bulbs/indexable/indexable.py
index <HASH>..<HASH> 100644
--- a/bulbs/indexable/indexable.py
+++ b/bulbs/indexable/indexable.py
@@ -170,9 +170,11 @@ class PolymorphicIndexable(object):
return "%s_%s" % (cls._meta.app_label, cls._meta.module_name)
@classmethod
- def get_mapping_type_names(cls):
+ def get_mapping_type_names(cls, include_self=True):
"""Returns the mapping type name of this class and all of its descendants."""
- names = [cls.get_mapping_type_name()]
+ names = []
+ if include_self:
+ names.append(cls.get_mapping_type_name())
for subclass in cls.__subclasses__():
names.extend(subclass.get_mapping_type_names())
return names
|
Added option to exclude base type from get_mapping_type_names
|
theonion_django-bulbs
|
train
|
py
|
9967d6023e2e5c4b5cf727e5ec3b5459c9d1ec15
|
diff --git a/packages/@vue/cli/lib/Migrator.js b/packages/@vue/cli/lib/Migrator.js
index <HASH>..<HASH> 100644
--- a/packages/@vue/cli/lib/Migrator.js
+++ b/packages/@vue/cli/lib/Migrator.js
@@ -1,8 +1,6 @@
const Generator = require('./Generator')
const MigratorAPI = require('./MigratorAPI')
-const inferRootOptions = require('./util/inferRootOptions')
-
module.exports = class Migrator extends Generator {
constructor (context, {
plugin,
@@ -19,11 +17,25 @@ module.exports = class Migrator extends Generator {
files,
invoking
})
- this.plugins = [plugin]
- const rootOptions = inferRootOptions(pkg)
+ this.migratorPlugin = plugin
+ this.invoking = invoking
+ }
+
+ async generate () {
+ const plugin = this.migratorPlugin
+
// apply migrators from plugins
- const api = new MigratorAPI(plugin.id, plugin.installed, this, plugin.options, rootOptions)
- plugin.apply(api, plugin.options, rootOptions, invoking)
+ const api = new MigratorAPI(
+ plugin.id,
+ plugin.installed,
+ this,
+ plugin.options,
+ this.rootOptions
+ )
+
+ await plugin.apply(api, plugin.options, this.rootOptions, this.invoking)
+
+ await super.generate()
}
}
|
fix: fix Migrator implementation due to Generator internal change
|
vuejs_vue-cli
|
train
|
js
|
73041c50068ff561882ad15223041b8c5c577b25
|
diff --git a/lib/rest-graph.rb b/lib/rest-graph.rb
index <HASH>..<HASH> 100644
--- a/lib/rest-graph.rb
+++ b/lib/rest-graph.rb
@@ -427,7 +427,8 @@ class RestGraph < RestGraphStruct
r
}
EM::MultiRequest.new(rs){ |m|
- clients = m.responses.values.flatten
+ # TODO: how to deal with the failed?
+ clients = m.responses[:succeeded]
results = clients.map{ |client|
post_request(client.response, client.uri)
}
|
TODO: how to deal with the failed?
|
godfat_rest-core
|
train
|
rb
|
754b69e46ea28ea41a92f947442ac5da824698ca
|
diff --git a/pronto/utils/io.py b/pronto/utils/io.py
index <HASH>..<HASH> 100644
--- a/pronto/utils/io.py
+++ b/pronto/utils/io.py
@@ -124,11 +124,21 @@ def decompress(
# Attempt to detect the encoding and decode the stream
det: Dict[str, Union[str, float]] = chardet.detect(decompressed.peek())
- if encoding is not None:
- det = dict(encoding=encoding, confidence=1.0)
- elif det["encoding"] == "ascii":
- det["encoding"] = "UTF-8"
- if det["confidence"] == 1.0:
+ confidence: float = 1.0 if encoding is not None else det["confidence"]
+ encoding = encoding if encoding is not None else det["encoding"]
+
+ if encoding == "ascii":
+ encoding = "UTF-8"
+ if confidence < 1.0:
+ warnings.warn(
+ f"unsound encoding, assuming {encoding} ({confidence:.0%} confidence)",
+ UnicodeWarning,
+ stacklevel=3,
+ )
+
+ if encoding == "UTF-8":
+ return typing.cast(BinaryIO, decompressed)
+ else:
return typing.cast(
BinaryIO,
BufferedReader(
@@ -142,8 +152,3 @@ def decompress(
)
),
)
- else:
- warnings.warn(
- "could not find encoding, assuming UTF-8", UnicodeWarning, stacklevel=3
- )
- return typing.cast(BinaryIO, decompressed)
|
Change behaviour of `io.decompress` to use chardet encoding
|
althonos_pronto
|
train
|
py
|
3ab4ddc162ed64e4c5256b91a190d39124ed2f48
|
diff --git a/common.go b/common.go
index <HASH>..<HASH> 100644
--- a/common.go
+++ b/common.go
@@ -5,6 +5,7 @@ import (
"archive/zip"
"errors"
"fmt"
+ "github.com/dmotylev/goproperties"
"io"
"io/ioutil"
"log"
@@ -39,8 +40,6 @@ const (
curl = "curl"
appData = "APPDATA"
gaugePropertiesFile = "gauge.properties"
- GaugeRepositoryUrl = "gauge_repository_url"
- ApiRefreshInterval = "gauge_api_refresh_interval"
)
const (
|
Removing config details from common
|
getgauge_common
|
train
|
go
|
74ea479b0ca6b4fa850ac4ebf0ed36cd481c8d6e
|
diff --git a/stdlib/sql.go b/stdlib/sql.go
index <HASH>..<HASH> 100644
--- a/stdlib/sql.go
+++ b/stdlib/sql.go
@@ -126,6 +126,12 @@ var (
fakeTxConns map[*pgx.Conn]*sql.Tx
)
+// GetDefaultDriver return the driver initialize in the init function
+// and used when register pgx driver
+func GetDefaultDriver() *Driver {
+ return pgxDriver
+}
+
type Driver struct {
configMutex sync.Mutex
configCount int64
|
Close issue #<I> : Give access to the registered driver instance
Some library use a driver to wrap its behavior and give additional
functionality, as the datadog tracing library
("gopkg.in/DataDog/dd-trace-go.v1/contrib/database/sql")
This commit aims to give access to this instance which can't be
correctly initialized to due private fields without default values (the
configuration map inside the driver)
|
jackc_pgx
|
train
|
go
|
e584a2adfd5971af17ea62573dee3198cd733fa7
|
diff --git a/classes/fields/link.php b/classes/fields/link.php
index <HASH>..<HASH> 100644
--- a/classes/fields/link.php
+++ b/classes/fields/link.php
@@ -204,18 +204,7 @@ class PodsField_Link extends PodsField_Website {
// Ensure proper format
$value = $this->pre_save( $value, $id, $name, $options, null, $pod );
- if ( ! empty( $options['disable_dfv'] ) ) {
- return pods_view( PODS_DIR . 'ui/fields/' . $field_type . '.php', compact( array_keys( get_defined_vars() ) ) );
- }
-
- wp_enqueue_script( 'pods-dfv' );
-
- $type = pods_v( 'type', $options, static::$type );
-
- $args = compact( array_keys( get_defined_vars() ) );
- $args = (object) $args;
-
- $this->render_input_script( $args );
+ pods_view( PODS_DIR . 'ui/fields/' . $field_type . '.php', compact( array_keys( get_defined_vars() ) ) );
}
/**
|
Update link field type to not use DFV
|
pods-framework_pods
|
train
|
php
|
c3aca0c35a7dc9afd57eb1f770efee6126a8fdaf
|
diff --git a/lib/Subscription.php b/lib/Subscription.php
index <HASH>..<HASH> 100644
--- a/lib/Subscription.php
+++ b/lib/Subscription.php
@@ -10,6 +10,17 @@ namespace Stripe;
class Subscription extends ApiResource
{
/**
+ * These constants are possible representations of the status field.
+ *
+ * @link https://stripe.com/docs/api#subscription_object-status
+ */
+ const STATUS_ACTIVE = 'active';
+ const STATUS_CANCELED = 'canceled';
+ const STATUS_PAST_DUE = 'past_due';
+ const STATUS_TRIALING = 'trialing';
+ const STATUS_UNPAID = 'unpaid';
+
+ /**
* @param string $id The ID of the subscription to retrieve.
* @param array|string|null $opts
*
|
Add few class' constants corresponding to subscription statuses (#<I>)
|
stripe_stripe-php
|
train
|
php
|
baa69114794be7f174e220a672bcc3aa52b3c519
|
diff --git a/lib/pdk/validate/yaml/syntax.rb b/lib/pdk/validate/yaml/syntax.rb
index <HASH>..<HASH> 100644
--- a/lib/pdk/validate/yaml/syntax.rb
+++ b/lib/pdk/validate/yaml/syntax.rb
@@ -62,6 +62,8 @@ module PDK
return_val = 0
create_spinner(targets, options)
+ PDK.logger.debug(_('Validating yaml content of %{parsed_targets}') % { parsed_targets: targets.to_s })
+
targets.each do |target|
next unless File.file?(target)
|
(MAINT) Add debug logging of yaml files being validated
|
puppetlabs_pdk
|
train
|
rb
|
94720a28e92072c4d228b1ba5c3f12c93da80676
|
diff --git a/lib/jirahelper/misc.rb b/lib/jirahelper/misc.rb
index <HASH>..<HASH> 100644
--- a/lib/jirahelper/misc.rb
+++ b/lib/jirahelper/misc.rb
@@ -8,7 +8,8 @@ module JiraHelper
password: config.password,
site: config.site,
context_path: config.context,
- auth_type: :basic
+ auth_type: :basic,
+ use_ssl: config.use_ssl,
)
end
end
diff --git a/lib/lita/handlers/jira.rb b/lib/lita/handlers/jira.rb
index <HASH>..<HASH> 100644
--- a/lib/lita/handlers/jira.rb
+++ b/lib/lita/handlers/jira.rb
@@ -15,6 +15,7 @@ module Lita
config :ambient, required: false, types: [TrueClass, FalseClass], default: false
config :ignore, required: false, type: Array, default: []
config :rooms, required: false, type: Array
+ config :use_ssl, required: false, types: [TrueClass, FalseClass], default: true
include ::JiraHelper::Issue
include ::JiraHelper::Misc
|
Adding options to disable SSL
Using correct method
|
esigler_lita-jira
|
train
|
rb,rb
|
f633f1d154904e5bce7d75ee3309d2eeec7e5473
|
diff --git a/lib/countly.js b/lib/countly.js
index <HASH>..<HASH> 100644
--- a/lib/countly.js
+++ b/lib/countly.js
@@ -418,7 +418,7 @@
log(logLevelEnums.DEBUG, "initialize, enableOrientationTracking:[" + this.enableOrientationTracking + "]");
}
if (!useSessionCookie) {
- log(logLevelEnums.WARNING, "initialize, use_session_cookie is disabled:[" + useSessionCookie + "]");
+ log(logLevelEnums.WARNING, "initialize, use_session_cookie is enabled:[" + useSessionCookie + "]");
}
if (offlineMode) {
log(logLevelEnums.DEBUG, "initialize, offline_mode:[" + offlineMode + "], user info won't be send to the servers");
|
log text was wrong, changed disabled to enabled (#<I>)
|
Countly_countly-sdk-web
|
train
|
js
|
9d02a4200cd630f4ceede546d5b8991c618d2afe
|
diff --git a/test/com/google/javascript/jscomp/IntegrationTest.java b/test/com/google/javascript/jscomp/IntegrationTest.java
index <HASH>..<HASH> 100644
--- a/test/com/google/javascript/jscomp/IntegrationTest.java
+++ b/test/com/google/javascript/jscomp/IntegrationTest.java
@@ -1406,8 +1406,6 @@ public final class IntegrationTest extends IntegrationTestCase {
options.setClosurePass(true);
options.setNewTypeInference(true);
options.setRunOTIafterNTI(false);
- // TODO(dimvar): remove once cl/172116239 is submitted
- options.setCheckTypes(true);
options.setDisambiguateProperties(true);
this.externs = ImmutableList.of(SourceFile.fromCode(
"externs",
|
Fix TODO in IntegrationTest.
-------------
Created by MOE: <URL>
|
google_closure-compiler
|
train
|
java
|
a09ad23e394140677891a997b1f2b1d57994b4ff
|
diff --git a/docs/source/conf.py b/docs/source/conf.py
index <HASH>..<HASH> 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -27,7 +27,7 @@ author = "The Font Bakery Authors"
# The short X.Y version
version = "0.7"
# The full version, including alpha/beta/rc tags
-release = "0.7.22"
+release = "0.7.23"
# -- General configuration ---------------------------------------------------
@@ -190,7 +190,7 @@ def linkcode_resolve(domain, info):
# AND We can link to a tag i.e. a release tag. This is awesome:
# tag is: "v0.7.2"
# https://github.com/googlefonts/fontbakery/tree/v0.7.2/Lib/fontbakery/profiles
- tree = 'v0.7.22'
+ tree = 'v0.7.23'
# It's not planned for us to get the line number :-(
# I had to hammer this data into the info.
if 'lineno' in info:
|
update version on docs/source/conf.py
|
googlefonts_fontbakery
|
train
|
py
|
d506f5142f70fe36591799d453ed887600253da6
|
diff --git a/pyghmi/ipmi/oem/lenovo/config.py b/pyghmi/ipmi/oem/lenovo/config.py
index <HASH>..<HASH> 100644
--- a/pyghmi/ipmi/oem/lenovo/config.py
+++ b/pyghmi/ipmi/oem/lenovo/config.py
@@ -265,6 +265,9 @@ class LenovoFirmwareConfig(object):
sortid = 0
for config in xml.iter("config"):
lenovo_id = config.get("ID")
+ if lenovo_id == 'iSCSI':
+ # Do not support iSCSI at this time
+ continue
for group in config.iter("group"):
lenovo_group = group.get("ID")
for setting in group.iter("setting"):
|
iSCSI settings aren't viable, mask for now
The iSCSI attempts require special consideration that is
not currently implemented. Mask it out for now.
Change-Id: I<I>de1ddce<I>cd<I>d1d9e7ecf0bcbf<I>f
|
openstack_pyghmi
|
train
|
py
|
78f3e037e71978ecf198e9949e828acecd1be96b
|
diff --git a/lib/rackstash/encoder/message.rb b/lib/rackstash/encoder/message.rb
index <HASH>..<HASH> 100644
--- a/lib/rackstash/encoder/message.rb
+++ b/lib/rackstash/encoder/message.rb
@@ -37,7 +37,7 @@ module Rackstash
include Rackstash::Encoder::Helper::Timestamp
# @param tagged [Array<#to_s>] An array of field names whose values are
- # added in front of each message line on encode
+ # added in front of each message line on {#encode}
def initialize(tagged: [])
@tagged_fields = Array(tagged).map(&:to_s)
end
|
Add method reference to docs for Message#initialize
|
meineerde_rackstash
|
train
|
rb
|
761764f3b583a93f83d8030a7e992666036c2424
|
diff --git a/lib/bumbleworks/configuration.rb b/lib/bumbleworks/configuration.rb
index <HASH>..<HASH> 100644
--- a/lib/bumbleworks/configuration.rb
+++ b/lib/bumbleworks/configuration.rb
@@ -299,10 +299,10 @@ module Bumbleworks
def framework_root
case
- when defined?(Rails) then Rails.root
- when defined?(Rory) then Rory.root
- when defined?(Padrino) then Padrino.root
- when defined?(Sinatra::Application) then Sinatra::Application.root
+ when defined?(::Rails) then ::Rails.root
+ when defined?(::Rory) then ::Rory.root
+ when defined?(::Padrino) then ::Padrino.root
+ when defined?(::Sinatra::Application) then ::Sinatra::Application.root
end
end
|
Check root-level constants for framework root
Don't confuse constants defined within our namespace (such as for the
Bumbleworks::Rails engine) with the constant defined on Object.
|
bumbleworks_bumbleworks
|
train
|
rb
|
a16e9ab56a15e2ec8604eeac7cb77d947c26f083
|
diff --git a/bokeh/models/annotations.py b/bokeh/models/annotations.py
index <HASH>..<HASH> 100644
--- a/bokeh/models/annotations.py
+++ b/bokeh/models/annotations.py
@@ -236,6 +236,11 @@ class Label(Annotation):
The %s values for the text.
""")
+ render_mode = Enum(RenderMode, default="canvas", help="""
+ Specifies whether the text is rendered as a canvas element or as an
+ css element overlaid on the canvas. The default mode is "canvas"."""
+
+
class PolyAnnotation(Annotation):
""" Render a shaded polygonal region as an annotation.
|
Add render_mode var to Label
|
bokeh_bokeh
|
train
|
py
|
465d6ddff1f271b2b6de3a0de2d21c1d3501faf9
|
diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -25,7 +25,7 @@ function quoteIdent(value) {
} else if (value === true) {
return '"t"';
} else if (value instanceof Date) {
- value = formatDate(value.toISOString());
+ return '"' + formatDate(value.toISOString()) + '"';
} else if (Array.isArray(value) === true) {
throw new Error('SQL identifier cannot be an array');
} else if (value === Object(value)) {
@@ -65,7 +65,7 @@ function quoteLiteral(value) {
} else if (value === true) {
return "'t'";
} else if (value instanceof Date) {
- value = formatDate(value.toISOString());
+ return "'" + formatDate(value.toISOString()) + "'";
} else if (Array.isArray(value) === true) {
var temp = [];
for (var i = 0; i < value.length; i++) {
@@ -121,7 +121,7 @@ function quoteString(value) {
}
return temp.toString();
} else if (value === Object(value)) {
- value = JSON.stringify(value);
+ return JSON.stringify(value);
}
return value.toString();
|
For dates, surround ISO string with quotes rather than treat it as an ordinary string.
|
datalanche_node-pg-format
|
train
|
js
|
9a4c759a7e02d940b0283213e3a299ad61164946
|
diff --git a/tests/CalendR/Test/CalendarTest.php b/tests/CalendR/Test/CalendarTest.php
index <HASH>..<HASH> 100644
--- a/tests/CalendR/Test/CalendarTest.php
+++ b/tests/CalendR/Test/CalendarTest.php
@@ -145,4 +145,13 @@ class CalendarTest extends \PHPUnit_Framework_TestCase
array(2013, 8, Day::SUNDAY, '2013-02-17'),
);
}
+
+ public function testStrictDates()
+ {
+ // When we start, the option "strict_dates" should be set to false.
+ $calendar = new Calendar;
+ $this->assertSame(false, $calendar->getStrictDates());
+ $calendar->setStrictDates(true);
+ $this->assertSame(true, $calendar->getStrictDates());
+ }
}
|
Add Unit Test
Add the unit test 'strictDates' to the core calendar test case. Ensure that the 'strict_dates' option can be set and retrieved.
|
yohang_CalendR
|
train
|
php
|
36a4069047e0a1aef80916ef1c93f53dff840a9a
|
diff --git a/src/nu/validator/servlet/VerifierServletTransaction.java b/src/nu/validator/servlet/VerifierServletTransaction.java
index <HASH>..<HASH> 100644
--- a/src/nu/validator/servlet/VerifierServletTransaction.java
+++ b/src/nu/validator/servlet/VerifierServletTransaction.java
@@ -995,7 +995,6 @@ class VerifierServletTransaction implements DocumentModeHandler, SchemaResolver
}
} catch (CannotRecoverException e) {
} catch (TooManyErrorsException e) {
- log4j.debug("TooManyErrorsException", e);
errorHandler.fatalError(e);
} catch (SAXException e) {
log4j.debug("SAXException", e);
|
Stop dumping TooManyErrorsException to log
There are many real-world documents on the Web with a number of errors
exceeding the limit (currently <I>) at which TooManyErrorsException is
thrown. So the error messages for this case (along with the accompanying
stack trace) just generate a lot of unwelcome noise in the logs.
|
validator_validator
|
train
|
java
|
7dea6cfd473a52a55e19e6203013aff37e151af2
|
diff --git a/pwkit/cli/imtool.py b/pwkit/cli/imtool.py
index <HASH>..<HASH> 100644
--- a/pwkit/cli/imtool.py
+++ b/pwkit/cli/imtool.py
@@ -268,12 +268,16 @@ class SetrectCommand (multitool.Command):
class ShowCommand (multitool.Command):
name = 'show'
- argspec = '<image> [images...]'
+ argspec = '[--no-coords] <image> [images...]'
summary = 'Show images interactively.'
+ more_help = """--no-coords - Do not show coordinates even if available
+
+WCS support isn't fantastic and sometimes causes crashes."""
def invoke (self, args, **kwargs):
anyfailures = False
ndshow = load_ndshow ()
+ no_coords = pop_option ('no-coords', args)
for path in args:
try:
@@ -294,6 +298,9 @@ class ShowCommand (multitool.Command):
data = img.read (flip=True)
toworld = img.toworld
+ if no_coords:
+ toworld = None
+
ndshow.view (data, title=path + ' — Array Viewer',
toworld=toworld, yflip=True)
|
pwkit/cli/imtool.py: hacky workaround for my lame WCS code
|
pkgw_pwkit
|
train
|
py
|
719181900fbb933b7935757932867594869aa85c
|
diff --git a/library/pulse/script/cache.rb b/library/pulse/script/cache.rb
index <HASH>..<HASH> 100644
--- a/library/pulse/script/cache.rb
+++ b/library/pulse/script/cache.rb
@@ -1,14 +1,16 @@
# encoding: utf-8
module Pulse
- class Cache
- def initialize script
- @script = script
- end
+ class Script
+ class Cache
+ def initialize script
+ @script = script
+ end
- private
- def path
- File.expand_path $0
+ private
+ def path
+ "#{File.expand_path $0}/cache/#{@script.name}_#{@index}"
+ end
end
end
end
|
Fixed namespacing of script cache and corrected Cache#path
|
mkroman_blur
|
train
|
rb
|
0eabf048324d66434a3b1ad1ec42daad65bac045
|
diff --git a/bulbs/__init__.py b/bulbs/__init__.py
index <HASH>..<HASH> 100644
--- a/bulbs/__init__.py
+++ b/bulbs/__init__.py
@@ -1 +1 @@
-__version__ = "0.3.18"
+__version__ = "0.3.19"
|
Bumping version [ci skip]
|
theonion_django-bulbs
|
train
|
py
|
a2383063914f478ffb8848b99972b398960f3276
|
diff --git a/embed_video/fields.py b/embed_video/fields.py
index <HASH>..<HASH> 100644
--- a/embed_video/fields.py
+++ b/embed_video/fields.py
@@ -47,6 +47,6 @@ class EmbedVideoFormField(forms.URLField):
except UnknownBackendException:
raise forms.ValidationError(_(u'URL could not be recognized.'))
except UnknownIdException:
- raise forms.ValidationError(_(u'ID of this video could not be \
- recognized.'))
+ raise forms.ValidationError(_(u'ID of this video could not be '
+ u'recognized.'))
return url
|
Fix string formating
There is a lot of spaces in this error message.
By the way: this is never raised in normal condition. The `detect_backend` doesn't try to `get_code()` at all.
|
jazzband_django-embed-video
|
train
|
py
|
7abcf7f8bd87b8b2dac437de6179c80f8522b713
|
diff --git a/Eloquent/Model.php b/Eloquent/Model.php
index <HASH>..<HASH> 100644
--- a/Eloquent/Model.php
+++ b/Eloquent/Model.php
@@ -786,15 +786,15 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab
$relation = $caller['function'];
}
+ $instance = new $related;
+
// If no foreign key was supplied, we can use a backtrace to guess the proper
// foreign key name by using the name of the relationship function, which
// when combined with an "_id" should conventionally match the columns.
if (is_null($foreignKey)) {
- $foreignKey = Str::snake($relation).'_id';
+ $foreignKey = Str::snake($relation).'_' . $instance->getKeyName();
}
- $instance = new $related;
-
if (! $instance->getConnectionName()) {
$instance->setConnection($this->connection);
}
|
default foreign key for belongsTo relationship is now dynamic
|
illuminate_database
|
train
|
php
|
2e09c23f20269ab0b9ebd7ddf707fd6db0371c72
|
diff --git a/maildir_deduplicate/tests/test_cli.py b/maildir_deduplicate/tests/test_cli.py
index <HASH>..<HASH> 100644
--- a/maildir_deduplicate/tests/test_cli.py
+++ b/maildir_deduplicate/tests/test_cli.py
@@ -81,7 +81,7 @@ class TestHashCLI(CLITestCase):
""").encode('utf-8')
with self.runner.isolated_filesystem():
- with open('mail.txt', 'w') as f:
+ with open('mail.txt', 'wb') as f:
f.write(message)
result = self.runner.invoke(cli, ['hash', 'mail.txt'])
|
Fix python 3 binary write.
|
kdeldycke_maildir-deduplicate
|
train
|
py
|
dd00b8d214d4d2fc8998f5a8b289f95d2f9c7258
|
diff --git a/src/org/opencms/workplace/commons/CmsPublishScheduled.java b/src/org/opencms/workplace/commons/CmsPublishScheduled.java
index <HASH>..<HASH> 100644
--- a/src/org/opencms/workplace/commons/CmsPublishScheduled.java
+++ b/src/org/opencms/workplace/commons/CmsPublishScheduled.java
@@ -263,8 +263,11 @@ public class CmsPublishScheduled extends CmsDialog {
String userName = getCms().getRequestContext().getCurrentUser().getName();
// get the java date format
- DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, getLocale());
- Date date = dateFormat.parse(publishScheduledDate);
+ // DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, getLocale());
+ // dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+ // Date date = dateFormat.parse(publishScheduledDate);
+ long lDate = org.opencms.widgets.CmsCalendarWidget.getCalendarDate(getMessages(), publishScheduledDate, true);
+ Date date = new Date(lDate);
// check if the selected date is in the future
if (date.getTime() < new Date().getTime()) {
|
Improved date handling in CmsPublishScheduled (orginally commited by
sschneider in branch 9_0_0_solr, commit
<I>de5a3bdaf<I>cd<I>bb7b<I>cfc<I>c<I>)
|
alkacon_opencms-core
|
train
|
java
|
1ce86dbc23b6b31588c8f19206f5483d0380a480
|
diff --git a/examples/simulations/gyroscope2.py b/examples/simulations/gyroscope2.py
index <HASH>..<HASH> 100644
--- a/examples/simulations/gyroscope2.py
+++ b/examples/simulations/gyroscope2.py
@@ -62,7 +62,7 @@ for i, t in enumerate(pb.range()):
gaxis = (Lshaft + 0.03) * vector(st * sp, ct, st * cp)
# set orientation along gaxis and rotate it around its axis by psidot*t degrees
- gyro.orientation(gaxis, rotation=psidot * t * 57.3)
+ gyro.orientation(gaxis, rotation=psidot * t, rad=True)
if not i % 200: # add trace and render all, every 200 iterations
vp.add(Point(gaxis, r=3, c="r"))
vp.show()
|
Updated deg<-> rad conversion in examples/simulations/gyroscope2.py
|
marcomusy_vtkplotter
|
train
|
py
|
ae6adb7b4cb66fa7f0d1c5be7ad0ac00204f1fad
|
diff --git a/src/XeroPHP/Remote/Object.php b/src/XeroPHP/Remote/Object.php
index <HASH>..<HASH> 100644
--- a/src/XeroPHP/Remote/Object.php
+++ b/src/XeroPHP/Remote/Object.php
@@ -406,12 +406,12 @@ abstract class Object implements ObjectInterface, \JsonSerializable {
}
/**
- * JSON Encode overload to putt out hidden properties
+ * JSON Encode overload to pull out hidden properties
*
* @return string
*/
public function jsonSerialize(){
- return json_encode($this->toStringArray());
+ return $this->toStringArray();
}
}
\ No newline at end of file
|
Again for #<I>, corrected so JSON is at the root, and fixed doc
|
calcinai_xero-php
|
train
|
php
|
3af63b0411c0d5ee3a2432f89372e50d5729c917
|
diff --git a/src/SelectionControls/SearchControl/SearchControlViewBridge.js b/src/SelectionControls/SearchControl/SearchControlViewBridge.js
index <HASH>..<HASH> 100644
--- a/src/SelectionControls/SearchControl/SearchControlViewBridge.js
+++ b/src/SelectionControls/SearchControl/SearchControlViewBridge.js
@@ -406,9 +406,13 @@ searchControl.prototype.createResultItemDom = function (item) {
for (var i = 0; i < this.model.resultColumns.length; i++) {
var column = this.model.resultColumns[i];
- if (typeof item.data[column] != 'undefined') {
+ // Slightly unorthodox but using eval allows for the column to contain 'dots' to
+ // descend into nested data structures in the item data.
+ var itemValue = eval('item.data.' + column);
+
+ if (typeof itemValue != 'undefined') {
var td = document.createElement('td');
- td.appendChild(document.createTextNode(item.data[column]));
+ td.appendChild(document.createTextNode(itemValue));
itemDom.appendChild(td);
}
else {
|
Now supports result columns the descend into nested data structures
|
RhubarbPHP_Module.Leaf.CommonControls
|
train
|
js
|
60f38560ab033ef47abed46619b113ebf5835624
|
diff --git a/lib/Gregwar/Image.php b/lib/Gregwar/Image.php
index <HASH>..<HASH> 100644
--- a/lib/Gregwar/Image.php
+++ b/lib/Gregwar/Image.php
@@ -551,6 +551,14 @@ class Image
}
/**
+ * Tostring defaults to jpeg
+ */
+ public function __toString()
+ {
+ return $this->jpeg();
+ }
+
+ /**
* Create an instance, usefull for one-line chaining
*/
public static function open($file = '')
|
Added __toString() method
|
Gregwar_Image
|
train
|
php
|
d5dc77476e7a4dcac01f83eba60a7ac13270b5b8
|
diff --git a/tests/Unit/Suites/ContentDelivery/Catalog/AbstractProductListingRequestHandlerTest.php b/tests/Unit/Suites/ContentDelivery/Catalog/AbstractProductListingRequestHandlerTest.php
index <HASH>..<HASH> 100644
--- a/tests/Unit/Suites/ContentDelivery/Catalog/AbstractProductListingRequestHandlerTest.php
+++ b/tests/Unit/Suites/ContentDelivery/Catalog/AbstractProductListingRequestHandlerTest.php
@@ -404,7 +404,7 @@ abstract class AbstractProductListingRequestHandlerTest extends \PHPUnit_Framewo
* @runInSeparateProcess
* @requires extension xdebug
*/
- public function testProductsPrePageCookieIsSetIfCorrespondingQueryParameterIsPresent()
+ public function testProductsPerPageCookieIsSetIfCorrespondingQueryParameterIsPresent()
{
$selectedNumberOfProductsPerPage = 2;
|
Issue #<I>: Fix typo in test method name
|
lizards-and-pumpkins_catalog
|
train
|
php
|
9db86a2ab83ef249cd748ad37f1ab600189cd9b3
|
diff --git a/zuul-core/src/main/java/com/netflix/netty/common/proxyprotocol/OptionalHAProxyMessageDecoder.java b/zuul-core/src/main/java/com/netflix/netty/common/proxyprotocol/OptionalHAProxyMessageDecoder.java
index <HASH>..<HASH> 100644
--- a/zuul-core/src/main/java/com/netflix/netty/common/proxyprotocol/OptionalHAProxyMessageDecoder.java
+++ b/zuul-core/src/main/java/com/netflix/netty/common/proxyprotocol/OptionalHAProxyMessageDecoder.java
@@ -42,7 +42,7 @@ public class OptionalHAProxyMessageDecoder extends ChannelInboundHandlerAdapter
{
public static final String NAME = "OptionalHAProxyMessageDecoder";
private static final Logger logger = LoggerFactory.getLogger("OptionalHAProxyMessageDecoder");
- CachedDynamicBooleanProperty dumpHAProxyByteBuf = new CachedDynamicBooleanProperty("zuul.haproxy.dump.bytebuf", false);
+ private static final CachedDynamicBooleanProperty dumpHAProxyByteBuf = new CachedDynamicBooleanProperty("zuul.haproxy.dump.bytebuf", false);
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
|
Make the FP a static copy.
|
Netflix_zuul
|
train
|
java
|
a8f9677f86a66f5df81b6a6449f9b2c0f35b709c
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -420,6 +420,8 @@ class Hyperdrive extends Nanoresource {
} catch (err) {
return cb(err)
}
+ } else if (chunk.left) {
+ entry.value = chunk.left.info
}
return cb(null, entry)
})
|
Diff stream should return mount info on mount events
|
mafintosh_hyperdrive
|
train
|
js
|
bda1ab2e89cdb7febee826de3e316b3b9c85a549
|
diff --git a/src/main/java/hex/Layer.java b/src/main/java/hex/Layer.java
index <HASH>..<HASH> 100644
--- a/src/main/java/hex/Layer.java
+++ b/src/main/java/hex/Layer.java
@@ -22,7 +22,7 @@ public abstract class Layer extends Iced {
@ParamsSearch.Ignore
public int units;
- protected NeuralNet params;
+ public NeuralNet params;
// Layer state: activity, error
protected transient float[] _a, _e;
@@ -916,9 +916,9 @@ public abstract class Layer extends Iced {
public static void shareWeights(Layer src, Layer dst) {
dst._w = src._w;
- dst._b = src._b;
+ if (dst._b == null || dst._b.length == src._b.length) dst._b = src._b;
dst._wm = src._wm;
- dst._bm = src._bm;
+ if (dst._bm == null || dst._bm.length == src._bm.length) dst._bm = src._bm;
}
public static void shareWeights(Layer[] src, Layer[] dst) {
|
Make params public and add size guards during sharing of layer weights and biases.
|
h2oai_h2o-2
|
train
|
java
|
d875695ca6ab2f55a1fbe59d7f7443c2ead7978e
|
diff --git a/lib/commoner.js b/lib/commoner.js
index <HASH>..<HASH> 100644
--- a/lib/commoner.js
+++ b/lib/commoner.js
@@ -241,14 +241,6 @@ Cp.cliBuildP = function(version) {
// Ignore dependencies because we wouldn't know how to find them.
this.ignoreDependencies = true;
- } else if (stats.isFile(first)) {
- sourceDir = workingDir;
- outputDir = absolutePath(workingDir, args.pop());
- roots = args.map(fileToId);
-
- // Ignore dependencies because we wouldn't know how to find them.
- this.ignoreDependencies = true;
-
} else if (stats.isDirectory(first)) {
sourceDir = first;
outputDir = absolutePath(workingDir, args[1]);
|
Abandon the no-source-directory, multiple-file usage pattern.
In practice this is never what one wants. Instead of doing
bin/commonize file1.js file2.js file3.js output/
one should simply use the directory-first pattern:
bin/commonize . output/ file1 file2 file3
|
facebookarchive_commoner
|
train
|
js
|
a24fee0a7dff96253c030e0e7748547beb845c3d
|
diff --git a/plank/cli.py b/plank/cli.py
index <HASH>..<HASH> 100644
--- a/plank/cli.py
+++ b/plank/cli.py
@@ -8,12 +8,14 @@ from .runner import Runner
def list_available_tasks(ctx, param, value):
+ sys.path.insert(0, os.getcwd())
if not value or ctx.resilient_parsing:
return
tasks = Inspector().get_tasks()
print 'Available tasks:'
for task in tasks.values():
print '\t{0}'.format(task.name)
+ sys.path.pop(0)
ctx.exit()
|
Add the cwd into the python path when running --list
|
atbentley_plank
|
train
|
py
|
b6006512ad0160e4b4255179f2942983c3d4c12a
|
diff --git a/contrib/externs/angular-material.js b/contrib/externs/angular-material.js
index <HASH>..<HASH> 100644
--- a/contrib/externs/angular-material.js
+++ b/contrib/externs/angular-material.js
@@ -93,7 +93,7 @@ md.$dialog = function() {};
* locals: (Object|undefined),
* resolve: (Object|undefined),
* controllerAs: (string|undefined),
- * parent: (Element|undefined)
+ * parent: (angular.JQLite|Element|undefined)
* }}
*/
md.$dialog.options;
|
Update $mdDialog.show parent option to have type angular.JQLite
-------------
Created by MOE: <URL>
|
google_closure-compiler
|
train
|
js
|
8a7cd18be132540251b4450ffc7ad0b455d27017
|
diff --git a/core/src/main/java/jenkins/security/CallableDirectionChecker.java b/core/src/main/java/jenkins/security/CallableDirectionChecker.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/jenkins/security/CallableDirectionChecker.java
+++ b/core/src/main/java/jenkins/security/CallableDirectionChecker.java
@@ -39,8 +39,7 @@ public class CallableDirectionChecker extends CallableDecorator {
// no annotation provided, so we don't know.
// to err on the correctness we'd let it pass with reporting, which
// provides auditing trail.
- if (LOGGER.isLoggable(Level.FINE))
- LOGGER.fine("Unchecked callable from "+computer.getName()+": "+c);
+ LOGGER.log(Level.WARNING, "Unchecked callable from {0}: {1}", new Object[] {computer.getName(), c});
return stem;
}
|
For now, at least print warnings about unmarked callables.
|
jenkinsci_jenkins
|
train
|
java
|
97e29e7b6102dc69ddb643d7577171068811cf7a
|
diff --git a/core/src/main/java/org/kohsuke/stapler/Stapler.java b/core/src/main/java/org/kohsuke/stapler/Stapler.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/kohsuke/stapler/Stapler.java
+++ b/core/src/main/java/org/kohsuke/stapler/Stapler.java
@@ -1023,7 +1023,7 @@ public class Stapler extends HttpServlet {
* Extensions that look like text files.
*/
private static final Set<String> TEXT_FILES = new HashSet<String>(Arrays.asList(
- "css","js","html","txt","java","htm","c","cpp","h","rb","pl","py","xml"
+ "css","js","html","txt","java","htm","c","cpp","h","rb","pl","py","xml","json"
));
/**
|
allow JSON responses to be compressed when serving with serveStaticResource
|
stapler_stapler
|
train
|
java
|
e5db1748870ea0d031bc09734abee6d16e58065b
|
diff --git a/common/session/class.BasicSession.php b/common/session/class.BasicSession.php
index <HASH>..<HASH> 100644
--- a/common/session/class.BasicSession.php
+++ b/common/session/class.BasicSession.php
@@ -29,9 +29,12 @@
*/
use oat\oatbox\user\User;
use oat\oatbox\Refreshable;
+use Zend\ServiceManager\ServiceLocatorAwareInterface;
+use Zend\ServiceManager\ServiceLocatorAwareTrait;
-class common_session_BasicSession implements common_session_Session
+class common_session_BasicSession implements common_session_Session, ServiceLocatorAwareInterface
{
+ use ServiceLocatorAwareTrait;
/**
* @var common_user_User
*/
|
basic session is now service locator aware
|
oat-sa_generis
|
train
|
php
|
41d970070005843e7e4111be766a1924b49371b1
|
diff --git a/tests/test_halo.py b/tests/test_halo.py
index <HASH>..<HASH> 100644
--- a/tests/test_halo.py
+++ b/tests/test_halo.py
@@ -453,6 +453,23 @@ class TestHalo(unittest.TestCase):
except ValueError as e:
self.fail('Attempted to write to a closed stream: {}'.format(e))
+ def test_closing_stream_before_persistent(self):
+ """Test no I/O is performed on streams closed before stop_and_persist is called
+ """
+ stream = io.StringIO()
+ spinner = Halo(text='foo', stream=stream)
+ spinner.start()
+ time.sleep(0.5)
+
+ # no exception raised after closing the stream means test was successful
+ try:
+ stream.close()
+
+ time.sleep(0.5)
+ spinner.stop_and_persist('done')
+ except ValueError as e:
+ self.fail('Attempted to write to a closed stream: {}'.format(e))
+
def test_setting_enabled_property(self):
"""Test if spinner stops writing when enabled property set to False
"""
|
Added a test that passes after the fix
|
manrajgrover_halo
|
train
|
py
|
6f84aebabc7f2dc311be1f21ebc24789d0f64576
|
diff --git a/lib/winrm/shells/base.rb b/lib/winrm/shells/base.rb
index <HASH>..<HASH> 100644
--- a/lib/winrm/shells/base.rb
+++ b/lib/winrm/shells/base.rb
@@ -86,7 +86,11 @@ module WinRM
# Closes the shell if one is open
def close
return unless shell_id
- self.class.close_shell(connection_opts, transport, shell_id)
+ begin
+ self.class.close_shell(connection_opts, transport, shell_id)
+ rescue WinRMWSManFault => e
+ raise unless [ERROR_OPERATION_ABORTED, SHELL_NOT_FOUND].include?(e.fault_code)
+ end
remove_finalizer
@shell_id = nil
end
diff --git a/tests/spec/shells/base_spec.rb b/tests/spec/shells/base_spec.rb
index <HASH>..<HASH> 100644
--- a/tests/spec/shells/base_spec.rb
+++ b/tests/spec/shells/base_spec.rb
@@ -212,5 +212,14 @@ describe DummyShell do
subject.close
expect(subject.shell_id).to be(nil)
end
+
+ context 'when shell was not found' do
+ it 'does not raise' do
+ subject.run(command, arguments)
+ expect(DummyShell).to receive(:close_shell)
+ .and_raise(WinRM::WinRMWSManFault.new('oops', '2150858843'))
+ expect { subject.close }.not_to raise_error
+ end
+ end
end
end
|
Ignore error <I> during shell closing
It is possible to get wsman error code <I> when closing shell.
This patch protects against raising and ignore the error (after all the
shell is closed)
Change-Id: I7af5cb<I>a<I>dc4ad4d<I>fe<I>b<I>b3de<I>
|
WinRb_WinRM
|
train
|
rb,rb
|
348f824f12c43224222fede59b54559a24ad0212
|
diff --git a/tests/test_PGPKeyring.py b/tests/test_PGPKeyring.py
index <HASH>..<HASH> 100644
--- a/tests/test_PGPKeyring.py
+++ b/tests/test_PGPKeyring.py
@@ -110,6 +110,9 @@ class TestPGPKeyring:
# verify the signature ourselves first
assert k.verify("tests/testdata/unsigned_message", str(sig).encode())
+ # verify that the secret key material was destroyed and that seckey_material is now empty
+ assert k.seckeys["C4BC77CEAD66AAD5"].keypkt.seckey_material.empty
+
# now write out to a file and test with gpg
with open('tests/testdata/unsigned_message.asc', 'w') as sigf:
sigf.write(str(sig))
|
add another bit to this test. closes #<I>
|
SecurityInnovation_PGPy
|
train
|
py
|
ca4a67e306ff491a07998a8c3b8425e1e553a7f2
|
diff --git a/lib/dalli/server.rb b/lib/dalli/server.rb
index <HASH>..<HASH> 100644
--- a/lib/dalli/server.rb
+++ b/lib/dalli/server.rb
@@ -363,7 +363,7 @@ module Dalli
def write(bytes)
begin
@sock.write(bytes)
- rescue SystemCallError
+ rescue SystemCallError, Timeout::Error
failure!
retry
end
|
Catch and handle write timeouts, fixes GH-<I>
|
petergoldstein_dalli
|
train
|
rb
|
4ccfe020a29a5b71e222a07a5609ee1704121e58
|
diff --git a/test/integration/054_adapter_methods_test/test_adapter_methods.py b/test/integration/054_adapter_methods_test/test_adapter_methods.py
index <HASH>..<HASH> 100644
--- a/test/integration/054_adapter_methods_test/test_adapter_methods.py
+++ b/test/integration/054_adapter_methods_test/test_adapter_methods.py
@@ -1,6 +1,4 @@
from test.integration.base import DBTIntegrationTest, use_profile
-from dbt.adapters.bigquery import GrantTarget
-from google.cloud.bigquery import AccessEntry
import yaml
@@ -92,6 +90,9 @@ class TestGrantAccess(DBTIntegrationTest):
@use_profile('bigquery')
def test_bigquery_adapter_methods(self):
+ from dbt.adapters.bigquery import GrantTarget
+ from google.cloud.bigquery import AccessEntry
+
self.run_dbt(['compile']) # trigger any compile-time issues
self.run_sql_file("seed_bq.sql")
self.run_dbt(['seed'])
|
Moved bigquery imports into bigquery test
|
fishtown-analytics_dbt
|
train
|
py
|
e9d3b7cf3b1062a2eb85f7931e3a2f3283d543aa
|
diff --git a/ehforwarderbot/channel.py b/ehforwarderbot/channel.py
index <HASH>..<HASH> 100644
--- a/ehforwarderbot/channel.py
+++ b/ehforwarderbot/channel.py
@@ -238,7 +238,7 @@ class EFBChannel(ABC):
"""
raise NotImplementedError()
- def get_message_by_id(self, msg_id: str) -> Optional['EFBMsg']:
+ def get_message_by_id(self, chat_uid: str, msg_id: str) -> Optional['EFBMsg']:
"""
Get message entity by its ID.
Applicable to both master channels and slave channels.
@@ -247,5 +247,9 @@ class EFBChannel(ABC):
Override this method and raise
:exc:`~.exceptions.EFBOperationNotSupported`
if it is not feasible to perform this for your platform.
+
+ Args:
+ chat_uid: Unique ID of chat in slave channel / middleware.
+ msg_id: ID of message from the chat in slave channel / middleware.
"""
raise NotImplementedError()
|
Fix EFBChannel.get_message_by_id() definition.
|
blueset_ehForwarderBot
|
train
|
py
|
6215de4cf631b3b0bab6d2549d6999143f6f5398
|
diff --git a/test/package.js b/test/package.js
index <HASH>..<HASH> 100644
--- a/test/package.js
+++ b/test/package.js
@@ -5,7 +5,7 @@ import pify from 'pify';
import index from '../';
test('Every rule is defined in index file', async t => {
- const files = await pify(fs.readdir)('../rules');
+ const files = await pify(fs.readdir)('rules');
const ruleFiles = files.filter(file => path.extname(file) === '.js');
for (const file of ruleFiles) {
|
fix package test (#<I>)
|
sindresorhus_eslint-plugin-unicorn
|
train
|
js
|
717a8c140d2da25561497051c0378f1edea7c9c3
|
diff --git a/lib/repository/base/version.rb b/lib/repository/base/version.rb
index <HASH>..<HASH> 100644
--- a/lib/repository/base/version.rb
+++ b/lib/repository/base/version.rb
@@ -4,6 +4,6 @@ module Repository
class Base
# Gem version, following [RubyGems.org](https://rubygems.org) and
# [SemVer](http://semver.org/) conventions.
- VERSION = '0.1.1'
+ VERSION = '0.1.2'
end
end
|
Bumped version number to <I>.
No code/spec changes.
RSpec: <I> examples, 0 failures; <I>/<I> LOC (<I>%) covered
RuboCop: <I> files inspected, no offenses detected
|
jdickey_repository-base
|
train
|
rb
|
8129d888d3926f8b09af3c1ef89e8820d95e9f85
|
diff --git a/sb.js b/sb.js
index <HASH>..<HASH> 100644
--- a/sb.js
+++ b/sb.js
@@ -76,9 +76,7 @@ $ = function(selector, root) {
}
var nodeList = new sb.nodeList();
-
- nodeList.setSelector(selector);
-
+ nodeList.selector = selector;
if(document.querySelectorAll){
nodeList.add(root.querySelectorAll(selector));
@@ -86,11 +84,12 @@ $ = function(selector, root) {
} else {
$.parseSelectors(nodeList, root);
}
+
if(nodeList.length() === 0 && nodeList.selector.match(/^\#\w+$/) ){
return null;
} else if(nodeList.length() == 1 && (nodeList.selector.match(/^\#\w+$/) || sb.nodeList.singleTags.some(function(v){return v === nodeList.selector;}))){
-
+
return nodeList.nodes[0];
} else {
return nodeList;
@@ -1164,7 +1163,7 @@ sb.nodeList.prototype = {
*/
add : function(nodes){
- nodes = (nodes instanceof Array || nodes instanceof NodeList) ? nodes : [nodes];
+ nodes = (nodes instanceof Array || (typeof NodeList !='undefined' && nodes instanceof NodeList)) ? nodes : [nodes];
var len = nodes.length;
|
Bug FIx:
There was a problem with QuerySelector all in Safari working with single #id tags in $
|
surebert_surebert-framework
|
train
|
js
|
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.