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 |
|---|---|---|---|---|---|
e6e34d461e4763102c51ff9d8b157e2ec0dc7d46 | diff --git a/lib/socket.js b/lib/socket.js
index <HASH>..<HASH> 100644
--- a/lib/socket.js
+++ b/lib/socket.js
@@ -284,6 +284,23 @@
};
/**
+ * Disconnects the socket with a sync XHR.
+ *
+ * @api private
+ */
+
+ Socket.prototype.disconnectSync = function () {
+ // ensure disconnection
+ var xhr = io.util.request()
+ , uri = this.resource + '/' + io.protocol + '/' + this.sessionid;
+
+ xhr.open('GET', uri, true);
+
+ // handle disconnection immediately
+ this.onDisconnect('booted');
+ };
+
+ /**
* Check if we need to use cross domain enabled transports. Cross domain would
* be a different port or different domain name.
* | Added `Socket#disconnectSync` private function. | tsjing_socket.io-client | train | js |
cac173b1b7c0e0f247752691021c1f9dbb3ef665 | diff --git a/common/types/policy.go b/common/types/policy.go
index <HASH>..<HASH> 100644
--- a/common/types/policy.go
+++ b/common/types/policy.go
@@ -642,9 +642,9 @@ func (pn *PolicyNode) Merge(obj *PolicyNode) error {
func (pn *PolicyNode) AddChild(name string, child *PolicyNode) error {
if _, ok := pn.Children[name]; ok {
- if err := pn.Children[name].Merge(child); err != nil {
- return err
- }
+ child.Parent = pn
+ child.Path()
+ return pn.Children[name].Merge(child)
} else {
pn.Children[name] = child
child.Parent = pn | Policy: bug fix for merging nodes | cilium_cilium | train | go |
86c155d3e8a8630f46ec3a762fb22141c26011e3 | diff --git a/bokeh/models/callbacks.py b/bokeh/models/callbacks.py
index <HASH>..<HASH> 100644
--- a/bokeh/models/callbacks.py
+++ b/bokeh/models/callbacks.py
@@ -51,6 +51,7 @@ class CustomJS(Callback):
@classmethod
def from_coffeescript(cls, code, args={}):
+ """ Create a ``CustomJS`` instance from CoffeeScript code. """
compiled = nodejs_compile(code, lang="coffeescript", file="???")
if "error" in compiled:
raise CompilationError(compiled.error)
@@ -70,4 +71,7 @@ class CustomJS(Callback):
a ``cb_obj`` parameter contains the object that triggered the callback
and an optional ``cb_data`` parameter that contains any tool-specific data
(i.e. mouse coordinates and hovered glyph indices for the HoverTool).
+
+ .. note:: Use ``CustomJS.from_coffeescript()`` for CoffeeScript source code.
+
""") | Add a note about CoffeeScript to CustomJS.code | bokeh_bokeh | train | py |
1fa2f866370f3f7d214066ec859737f4e690bc1f | diff --git a/torchvision/transforms/functional.py b/torchvision/transforms/functional.py
index <HASH>..<HASH> 100644
--- a/torchvision/transforms/functional.py
+++ b/torchvision/transforms/functional.py
@@ -203,8 +203,8 @@ def normalize(tensor, mean, std, inplace=False):
if not inplace:
tensor = tensor.clone()
- mean = torch.tensor(mean, dtype=torch.float32, device=tensor.device)
- std = torch.tensor(std, dtype=torch.float32, device=tensor.device)
+ mean = torch.as_tensor(mean, dtype=torch.float32, device=tensor.device)
+ std = torch.as_tensor(std, dtype=torch.float32, device=tensor.device)
tensor.sub_(mean[:, None, None]).div_(std[:, None, None])
return tensor | change tensor to as_tensor (#<I>) | pytorch_vision | train | py |
84da70139636c792ca82d7730fe527e9c9dd68ab | diff --git a/tools/rebasehelpers/util/git.go b/tools/rebasehelpers/util/git.go
index <HASH>..<HASH> 100644
--- a/tools/rebasehelpers/util/git.go
+++ b/tools/rebasehelpers/util/git.go
@@ -115,7 +115,9 @@ type File string
// HasVendoredCodeChanges verifies if the modified file is from Godeps/_workspace/
// or vendor/ directories.
func (f File) HasVendoredCodeChanges() bool {
- return strings.HasPrefix(string(f), "Godeps/_workspace") || strings.HasPrefix(string(f), "vendor")
+ return strings.HasPrefix(string(f), "Godeps/_workspace") ||
+ strings.HasPrefix(string(f), "vendor") ||
+ strings.HasPrefix(string(f), "pkg/build/vendor")
}
// HasGodepsChanges verifies if the modified file is Godeps/Godeps.json. | hack/verify-upstream-commits.sh: take into account pkg/build/vendor directory. | openshift_origin | train | go |
765b315b327df4cca8d845e87a2c14b5a86e214e | diff --git a/mingus/extra/fft.py b/mingus/extra/fft.py
index <HASH>..<HASH> 100644
--- a/mingus/extra/fft.py
+++ b/mingus/extra/fft.py
@@ -129,7 +129,7 @@ def find_notes(freqTable, maxNote=100):
def data_from_file(file):
"""Return (first channel data, sample frequency, sample width) from a .wav
file."""
- fp = wave.open(file, "r")
+ fp = wave.open(file, "rb")
data = fp.readframes(fp.getnframes())
channels = fp.getnchannels()
freq = fp.getframerate()
diff --git a/mingus/midi/midi_file_in.py b/mingus/midi/midi_file_in.py
index <HASH>..<HASH> 100644
--- a/mingus/midi/midi_file_in.py
+++ b/mingus/midi/midi_file_in.py
@@ -372,7 +372,7 @@ class MidiFile(object):
track data and the number of bytes read.
"""
try:
- f = open(file, "r")
+ f = open(file, "rb")
except:
raise IOError("File not found")
self.bytes_read = 0 | Fix #<I>: binary file open mode for MIDI and WAVE files | bspaans_python-mingus | train | py,py |
3087ca836fa02b496a048c93cb955714bb439589 | diff --git a/NavigationJS/Sample/Knockout/app.js b/NavigationJS/Sample/Knockout/app.js
index <HASH>..<HASH> 100644
--- a/NavigationJS/Sample/Knockout/app.js
+++ b/NavigationJS/Sample/Knockout/app.js
@@ -43,7 +43,6 @@
self.dateOfBirth(person.dateOfBirth);
};
personStates.details.dispose = function () { self.id(null); };
- Navigation.start();
};
Navigation.StateInfoConfig.build([
@@ -53,3 +52,4 @@ Navigation.StateInfoConfig.build([
{ key: 'details', route: 'person', title: 'Person Details', }]}
]);
ko.applyBindings(new PersonViewModel());
+Navigation.start(); | Moved start to match React sample
Safe now that plugin tolerates link exceptions. When it first loads
refresh links throw exceptions because there's no State. Sorts itself
out after start call | grahammendick_navigation | train | js |
524be98e0c9a0a23278e4f94c4f710cff829c742 | diff --git a/tests/Configurator/JavaScript/RegexpConvertorTest.php b/tests/Configurator/JavaScript/RegexpConvertorTest.php
index <HASH>..<HASH> 100644
--- a/tests/Configurator/JavaScript/RegexpConvertorTest.php
+++ b/tests/Configurator/JavaScript/RegexpConvertorTest.php
@@ -374,7 +374,7 @@ class RegexpConvertorTest extends Test
*/
public function testConvertRegexpDuplicateNamedCapturesMap()
{
- $regexp = RegexpConvertor::toJS('/(?<foo>[0-9]+)|(?<foo>[a-z]+)/');
+ $regexp = RegexpConvertor::toJS('/(?J)(?<foo>[0-9]+)|(?<foo>[a-z]+)/');
$this->assertEquals(
'/([0-9]+)|([a-z]+)/', | Updated RegexpConvertorTest | s9e_TextFormatter | train | php |
35deeb5d718186eebdad022c96a6ab0f39696d62 | diff --git a/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/opentracing/OpentracingAutoConfiguration.java b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/opentracing/OpentracingAutoConfiguration.java
index <HASH>..<HASH> 100644
--- a/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/opentracing/OpentracingAutoConfiguration.java
+++ b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/opentracing/OpentracingAutoConfiguration.java
@@ -44,6 +44,7 @@ public class OpentracingAutoConfiguration {
@Bean
@ConditionalOnMissingBean
+ @ConditionalOnClass(name = "brave.opentracing.BraveTracer")
Tracer sleuthOpenTracing(brave.Tracing braveTracing) {
return BraveTracer.create(braveTracing);
} | Added conditional on class for BraveTracer; fixes gh-<I> | spring-cloud_spring-cloud-sleuth | train | java |
2280f94d01c2ced72ece6eedb0165acb1e5ae3b9 | diff --git a/isochrones/starmodel.py b/isochrones/starmodel.py
index <HASH>..<HASH> 100644
--- a/isochrones/starmodel.py
+++ b/isochrones/starmodel.py
@@ -59,12 +59,18 @@ class StarModel(object):
"""
def __init__(self,ic,maxAV=1,max_distance=3000,**kwargs):
- self.ic = ic
+ self._ic = ic
self.properties = kwargs
self.max_distance = max_distance
self.maxAV = maxAV
self._samples = None
+ @property
+ def ic(self):
+ if type(self._ic)==type:
+ self._ic = self._ic()
+ return self._ic
+
def add_props(self,**kwargs):
"""
Adds observable properties to ``self.properties``.
@@ -667,8 +673,9 @@ class StarModel(object):
ic_type = attrs.ic_type
store.close()
- ic = ic_type()
- mod = cls(ic, maxAV=maxAV, max_distance=max_distance,
+ #ic = ic_type() don't need to initialize anymore
+
+ mod = cls(ic_type, maxAV=maxAV, max_distance=max_distance,
**properties)
mod._samples = samples
return mod | now can initialize StarModel with just the *type* of ichrone, and it will get created when used | timothydmorton_isochrones | train | py |
6a5e90d1de7e9030b57576a378f5eacb67ae72de | diff --git a/pybar/scans/scan_ext_trigger.py b/pybar/scans/scan_ext_trigger.py
index <HASH>..<HASH> 100644
--- a/pybar/scans/scan_ext_trigger.py
+++ b/pybar/scans/scan_ext_trigger.py
@@ -20,7 +20,7 @@ class ExtTriggerScan(Fei4RunBase):
_default_run_conf = {
"trig_count": 0, # FE-I4 trigger count, number of consecutive BCs, 0 means 16, from 0 to 15
"trigger_latency": 232, # FE-I4 trigger latency, in BCs, external scintillator / TLU / HitOR: 232, USBpix self-trigger: 220
- "trigger_delay": 14, # trigger delay, in BCs
+ "trigger_delay": 8, # trigger delay, in BCs
"trigger_rate_limit": 500, # artificially limiting the trigger rate, in BCs (25ns)
"col_span": [1, 80], # defining active column interval, 2-tuple, from 1 to 80
"row_span": [1, 336], # defining active row interval, 2-tuple, from 1 to 336 | MAINT: decrease trigger delay for TDC trigger input | SiLab-Bonn_pyBAR | train | py |
6a34f8d6dd3e85573b10bf36d39290ffc3fc608e | diff --git a/lib/capybara/session.rb b/lib/capybara/session.rb
index <HASH>..<HASH> 100644
--- a/lib/capybara/session.rb
+++ b/lib/capybara/session.rb
@@ -129,6 +129,7 @@ module Capybara
if @touched
driver.reset!
@touched = false
+ @scopes = [nil]
end
@server&.wait_for_pending_requests
raise_server_error! | Reset @scopes when session is reset
Otherwise they persist between RSpec tests.
Fix #<I> | teamcapybara_capybara | train | rb |
3d256fc5de403b4721e89e301a32d01bfcaf10f8 | diff --git a/test/mockContext.test.js b/test/mockContext.test.js
index <HASH>..<HASH> 100644
--- a/test/mockContext.test.js
+++ b/test/mockContext.test.js
@@ -106,7 +106,7 @@ test('Context methods', function(t) {
});
t.test('context.getRemainingTimeInMillis: returns 0 when timeInMillis is not sepcified', function(st) {
function callBack() {};
- delete ctxOpts.timeInMillis;
+ ctxOpts.timeInMillis = '0';
var context = mockContextCreator(ctxOpts, callBack);
st.equal(context.getRemainingTimeInMillis(), 0);
st.end(); | Fixes timeinMillis test to get <I>% coverage | dwyl_aws-lambda-test-utils | train | js |
a110605d1bdf8da02f6d4808580da47adb8aedd8 | diff --git a/tasks/helpers.js b/tasks/helpers.js
index <HASH>..<HASH> 100644
--- a/tasks/helpers.js
+++ b/tasks/helpers.js
@@ -123,8 +123,8 @@ exports.init = function(grunt) {
storeCoverage : function(coverage, options, done) {
flow(function write_json(cov) {
var json = path.resolve(options.dir, options.json);
- grunt.file.mkdir(path.dirname(json));
- fs.writeFile(json, JSON.stringify(cov), 'utf8', this.async(as(1)));
+ grunt.file.write(json, JSON.stringify(cov));
+ this.next();
}, function() {
flowEnd(this.err, done);
})(coverage); | storeCoverage: use grunt.file.write to respect --no-write
This makes the code simpler and makes the task not actually write
anything if the --no-write flag has been passed to Grunt. | taichi_grunt-istanbul | train | js |
281f072688280a0298085add9093d14d22617a88 | diff --git a/go/vt/vtgate/planbuilder/querytree.go b/go/vt/vtgate/planbuilder/querytree.go
index <HASH>..<HASH> 100644
--- a/go/vt/vtgate/planbuilder/querytree.go
+++ b/go/vt/vtgate/planbuilder/querytree.go
@@ -49,6 +49,10 @@ type (
tableNames() []string
}
+ vindexTable struct {
+ table *abstract.VindexTable
+ }
+
joinTables struct {
lhs, rhs relation
pred sqlparser.Expr
@@ -88,6 +92,11 @@ var _ relation = (*routeTable)(nil)
var _ relation = (*joinTables)(nil)
var _ relation = (parenTables)(nil)
var _ relation = (*derivedTable)(nil)
+var _ relation = (*vindexTable)(nil)
+
+func (v vindexTable) tableID() semantics.TableSet { return v.table.TableID }
+
+func (v vindexTable) tableNames() []string { return []string{v.table.Table.Name.String()} }
func (d *derivedTable) tableID() semantics.TableSet { return d.tables.tableID() } | Addition of the vindexTable relation | vitessio_vitess | train | go |
e8383e697770eeb1e7a164c938785868afa5970c | diff --git a/lib/mongo/bulk/bulk_collection_view.rb b/lib/mongo/bulk/bulk_collection_view.rb
index <HASH>..<HASH> 100644
--- a/lib/mongo/bulk/bulk_collection_view.rb
+++ b/lib/mongo/bulk/bulk_collection_view.rb
@@ -136,7 +136,7 @@ module Mongo
spec = { updates: [{ q: @selector,
u: update_doc,
multi: multi,
- upsert: upsert }],
+ upsert: @upsert }],
db_name: @bulk_write.db_name,
coll_name: @bulk_write.coll_name,
ordered: @bulk_write.ordered? } | RUBY-<I> Use upsert instance variable so not confused with API method | mongodb_mongo-ruby-driver | train | rb |
059581ee4eb4b1a27fafc1cd5cdb23028b448170 | diff --git a/node-persist.js b/node-persist.js
index <HASH>..<HASH> 100644
--- a/node-persist.js
+++ b/node-persist.js
@@ -679,7 +679,7 @@ var parseDirSync = function(dir, hash) {
var arr = fs.readdirSync(dir);
for (var i = 0; i < arr.length; i++) {
var curr = arr[i];
- if (curr[0] !== '.') {
+ if (arr[i] && curr[0] !== '.') {
var json = fs.readFileSync(path.join(dir, curr), options.encoding);
hash[curr] = parseString(json);
} | Fixed one more thing in regards to issue <I> | simonlast_node-persist | train | js |
28f2fd04e556bae8d756ed95d5242817ceae7059 | diff --git a/esgfpid/rabbit/asynchronous/thread_builder.py b/esgfpid/rabbit/asynchronous/thread_builder.py
index <HASH>..<HASH> 100644
--- a/esgfpid/rabbit/asynchronous/thread_builder.py
+++ b/esgfpid/rabbit/asynchronous/thread_builder.py
@@ -211,14 +211,9 @@ class ConnectionBuilder(object):
parameters=params,
on_open_callback=self.on_connection_open,
on_open_error_callback=self.on_connection_error,
- on_close_callback=self.on_connection_closed,
- stop_ioloop_on_close=False # why? see below.
+ on_close_callback=self.on_connection_closed
+ # Removed parameter, see https://github.com/pika/pika/issues/961
)
- # Don't stop ioloop on connection close, because
- # otherwise the thread would not accept more events/
- # messages (and might end) after a connection is
- # closed. We still want to accept messages and try
- # to reconnect and send them then.
''' Callback, called by RabbitMQ.'''
def on_connection_open(self, unused_connection): | pika <I> -> <I>: Removed param 'stop_ioloop...' that was removed in pika. | IS-ENES-Data_esgf-pid | train | py |
5553277de43a774eac26e92477e09228ae28f99b | diff --git a/test/image-tests/make-image-test.php b/test/image-tests/make-image-test.php
index <HASH>..<HASH> 100644
--- a/test/image-tests/make-image-test.php
+++ b/test/image-tests/make-image-test.php
@@ -208,7 +208,7 @@ println('<?php
class %s extends UnitTestCase {
function __construct() {
- require_once(\'../PelJpeg.php\');
+ require_once(\'../src/PelJpeg.php\');
parent::__construct(\'PEL %s Tests\');
}
@@ -218,7 +218,7 @@ class %s extends UnitTestCase {
$jpeg = new PelJpeg(dirname(__FILE__) . \'/%s\');
', $test_name, $image_filename, $image_filename);
-require_once('../../PelJpeg.php');
+require_once('../../src/PelJpeg.php');
$jpeg = new PelJpeg($image_filename);
$indent = 2; | Required files are located in src. | pel_pel | train | php |
16e1b69e1eda2ed58561de2bd248c8cce068d4d1 | diff --git a/test/hmac_strategy_test.rb b/test/hmac_strategy_test.rb
index <HASH>..<HASH> 100644
--- a/test/hmac_strategy_test.rb
+++ b/test/hmac_strategy_test.rb
@@ -42,7 +42,7 @@ context "HMAC" do
context "> with no signature" do
setup do
- get "http://example.org/?user_id=123&token=foo"
+ get "http://example.org/?user_id=123&token="
end
asserts(:status).equals(401)
@@ -99,7 +99,7 @@ context "HMAC" do
context "> with no signature" do
setup do
- get "http://example.org/?user_id=123&token=foo"
+ get "http://example.org/?user_id=123&token="
end
asserts(:status).equals(401) | fix some testcases (no token) to actually do what they pretend to do | Asquera_warden-hmac-authentication | train | rb |
2187deb0a8cd2e5a8a00132954c815581dcd9390 | diff --git a/templates/hooks/after_prepare/icons_and_splashscreens.js b/templates/hooks/after_prepare/icons_and_splashscreens.js
index <HASH>..<HASH> 100755
--- a/templates/hooks/after_prepare/icons_and_splashscreens.js
+++ b/templates/hooks/after_prepare/icons_and_splashscreens.js
@@ -47,7 +47,9 @@ function copyFile (src, dest, ncpOpts, callback) {
}
// Main
-var platforms = fs.readdirSync('platforms');
+var platforms = _.filter(fs.readdirSync('platforms'), function (file) {
+ return fs.statSync(path.resolve('platforms', file)).isDirectory();
+});
_.each(platforms, function (platform) {
var base = path.resolve('platforms', platform, BASES[platform]);
glob(base + '/**/*.png', function (err, files) { | fix(hook): Ignore non-directory platforms when processing icons and
splashscreens. Closes #<I> | diegonetto_generator-ionic | train | js |
6206bc435ed0aed52857b08cc14f052dbbe39762 | diff --git a/render/hyperscript.js b/render/hyperscript.js
index <HASH>..<HASH> 100644
--- a/render/hyperscript.js
+++ b/render/hyperscript.js
@@ -65,7 +65,4 @@ function hyperscript(selector) {
return Vnode(selector, attrs && attrs.key, attrs || {}, Vnode.normalizeChildren(children), undefined, undefined)
}
-hyperscript.trust = require("./trust")
-hyperscript.fragment = require("./fragment")
-
module.exports = hyperscript | Remove redundant lines that break the examples (#<I>) | MithrilJS_mithril.js | train | js |
47184f4725f30a4504bcdd3dbaef51f3e3663954 | diff --git a/lib/deride.js b/lib/deride.js
index <HASH>..<HASH> 100644
--- a/lib/deride.js
+++ b/lib/deride.js
@@ -85,6 +85,9 @@ var Expectations = function(obj, method) {
function invocation(index){
var values = _.map(_.values(calledWithArgs), _.values);
+ if(values.length <= index || index < 0){
+ throw new Error('invocation out of range');
+ }
var arg = values[index];
return {
withArg : withArg(arg)
diff --git a/test/test-deride.js b/test/test-deride.js
index <HASH>..<HASH> 100644
--- a/test/test-deride.js
+++ b/test/test-deride.js
@@ -364,6 +364,16 @@ _.forEach(tests, function(test) {
done();
});
+ it('throws an exception for an invocation requested which is out of range', function(done){
+ bob = deride.wrap(bob);
+ bob.greet('alice');
+ bob.greet('bob');
+ (function() {
+ bob.expect.greet.invocation(2).withArg('alice');
+ }).should.throw('invocation out of range');
+ done();
+ });
+
it('enables overriding a methods body', function(done) {
bob = deride.wrap(bob);
bob.setup.greet.toDoThis(function(otherPersonName) { | throws an exception for an invocation requested which is out of range | guzzlerio_deride | train | js,js |
177d1df3bee119599b6ac18367bab2ce5151d503 | diff --git a/openxc/src/main/java/com/openxc/sinks/MockedLocationSink.java b/openxc/src/main/java/com/openxc/sinks/MockedLocationSink.java
index <HASH>..<HASH> 100644
--- a/openxc/src/main/java/com/openxc/sinks/MockedLocationSink.java
+++ b/openxc/src/main/java/com/openxc/sinks/MockedLocationSink.java
@@ -56,9 +56,14 @@ public class MockedLocationSink extends ContextualVehicleDataSink {
}
Location location = new Location(LocationManager.GPS_PROVIDER);
- location.setLatitude(((Number)get(Latitude.ID).getValue()).doubleValue());
- location.setLongitude(((Number)get(Longitude.ID).getValue()).doubleValue());
- location.setSpeed(((Number)(get(VehicleSpeed.ID).getValue())).floatValue());
+ try {
+ location.setLatitude(((Number)get(Latitude.ID).getValue()).doubleValue());
+ location.setLongitude(((Number)get(Longitude.ID).getValue()).doubleValue());
+ location.setSpeed(((Number)(get(VehicleSpeed.ID).getValue())).floatValue());
+ } catch(ClassCastException e) {
+ Log.e(TAG, "Expected a Number, but got something " +
+ "else -- not updating location", e);
+ }
location.setTime(System.currentTimeMillis());
try { | Watch out for non-Number values when casting. | openxc_openxc-android | train | java |
42840ecd9b601ff3f6900c69bc1d9eb9074b1c9c | diff --git a/tests/integration/modules/test_win_lgpo.py b/tests/integration/modules/test_win_lgpo.py
index <HASH>..<HASH> 100644
--- a/tests/integration/modules/test_win_lgpo.py
+++ b/tests/integration/modules/test_win_lgpo.py
@@ -31,7 +31,7 @@ class WinLgpoTest(ModuleCase):
for use in validating the registry.pol files
'''
ret = self.run_function('archive.unzip',
- 'https://www.microsoft.com/en-us/download/confirmation.aspx?id=55319&6B49FDFB-8E5B-4B07-BC31-15695C5A2143=1'
+ 'https://www.microsoft.com/en-us/download/confirmation.aspx?id=55319&6B49FDFB-8E5B-4B07-BC31-15695C5A2143=1',
dest='c:\\windows\\system32')
@destructiveTest | add missing comma in function call | saltstack_salt | train | py |
7aec8fc9b3e969eb7a345aefd689501035d967dd | diff --git a/tornado/ioloop.py b/tornado/ioloop.py
index <HASH>..<HASH> 100644
--- a/tornado/ioloop.py
+++ b/tornado/ioloop.py
@@ -461,7 +461,9 @@ class PeriodicCallback(object):
def _schedule_next(self):
if self._running:
- self._next_timeout += self.callback_time / 1000.0
+ current_time = time.time()
+ while self._next_timeout < current_time:
+ self._next_timeout += self.callback_time / 1000.0
self.io_loop.add_timeout(self._next_timeout, self._run) | If a PeriodicCallback runs longer than its period, skip the missed callbacks
instead of trying to run all the missed callbacks to catch up. | tornadoweb_tornado | train | py |
2a43565e30e8df26df368abce88bcdc735a5ef61 | diff --git a/cmd/kops/create_cluster.go b/cmd/kops/create_cluster.go
index <HASH>..<HASH> 100644
--- a/cmd/kops/create_cluster.go
+++ b/cmd/kops/create_cluster.go
@@ -381,7 +381,7 @@ func (c *CreateClusterCmd) Run(args []string) error {
fmt.Printf(" * edit your node instance group: kops edit ig --name=%s %s\n", clusterName, nodes[0].Name)
}
if len(masters) > 0 {
- fmt.Printf(" * edit your master istance group: kops edit ig --name=%s %s\n", clusterName, masters[0].Name)
+ fmt.Printf(" * edit your master instance group: kops edit ig --name=%s %s\n", clusterName, masters[0].Name)
}
fmt.Printf("\n")
fmt.Printf("Finally configure your cluster with: kops update cluster %s --yes\n", clusterName) | Fix typo: istance -> instance | kubernetes_kops | train | go |
df50413c6c0118c6b3bd01f1dabd23482c4bb6c5 | diff --git a/tests/Propel/Tests/Runtime/ActiveQuery/ModelCriteriaTest.php b/tests/Propel/Tests/Runtime/ActiveQuery/ModelCriteriaTest.php
index <HASH>..<HASH> 100644
--- a/tests/Propel/Tests/Runtime/ActiveQuery/ModelCriteriaTest.php
+++ b/tests/Propel/Tests/Runtime/ActiveQuery/ModelCriteriaTest.php
@@ -2774,4 +2774,12 @@ class ModelCriteriaTest extends BookstoreTestBase
BookQuery::create()->requireOneByTitleAndId('Not Existing Book', -1337);
}
+
+ public function testJoinSelectColumn()
+ {
+ BookQuery::create()
+ ->innerJoinAuthor()
+ ->select(AuthorTableMap::COL_LAST_NAME)
+ ->find();
+ }
} | selecting column from joined table throws exception (tests for #<I>) | propelorm_Propel2 | train | php |
a6931ad85a9361a2ab4af88155dc5e69fe446677 | diff --git a/lib/manageiq/smartstate/version.rb b/lib/manageiq/smartstate/version.rb
index <HASH>..<HASH> 100644
--- a/lib/manageiq/smartstate/version.rb
+++ b/lib/manageiq/smartstate/version.rb
@@ -1,5 +1,5 @@
module ManageIQ
module Smartstate
- VERSION = "0.3.2".freeze
+ VERSION = "0.3.3".freeze
end
end | Updated to version "<I>". | ManageIQ_manageiq-smartstate | train | rb |
70308fa48f7dd8a1b9ff1f6b62c51cd0f4d56769 | diff --git a/presto-orc/src/main/java/com/facebook/presto/orc/reader/SliceDirectBatchStreamReader.java b/presto-orc/src/main/java/com/facebook/presto/orc/reader/SliceDirectBatchStreamReader.java
index <HASH>..<HASH> 100644
--- a/presto-orc/src/main/java/com/facebook/presto/orc/reader/SliceDirectBatchStreamReader.java
+++ b/presto-orc/src/main/java/com/facebook/presto/orc/reader/SliceDirectBatchStreamReader.java
@@ -178,7 +178,7 @@ public class SliceDirectBatchStreamReader
}
if (totalLength > ONE_GIGABYTE) {
throw new PrestoException(GENERIC_INTERNAL_ERROR,
- format("Values in column \"%s\" are too large to process for Presto. %s column values are larger than 1GB [%s]", streamDescriptor.getFieldName(), nextBatchSize, streamDescriptor.getOrcDataSourceId()));
+ format("Values in column \"%s\" are too large to process for Presto. %s column values are larger than 1GB [%s]", streamDescriptor.getFieldName(), currentBatchSize, streamDescriptor.getOrcDataSourceId()));
}
if (dataStream == null) {
throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is not null but data stream is missing"); | Fix Values are too large error message
Number of columns in the error message was always zero. | prestodb_presto | train | java |
2830e4e3e1d811e5622857abe798fe5499234894 | diff --git a/lib/graphql/relay/walker/client_ext.rb b/lib/graphql/relay/walker/client_ext.rb
index <HASH>..<HASH> 100644
--- a/lib/graphql/relay/walker/client_ext.rb
+++ b/lib/graphql/relay/walker/client_ext.rb
@@ -3,6 +3,8 @@ module GraphQL::Relay::Walker
# Walk this client's graph from the given GID.
#
# from_id: - The String GID to start walking from.
+ # variables: - A Hash of variables to be passed to GraphQL::Client.
+ # context: - A Hash containing context to be passed to GraphQL::Client.
# &blk - A block to call with each Walker::Frame that is visited.
#
# Returns nothing. | needs moar docs yo | github_graphql-relay-walker | train | rb |
ead06e9a1c1211ebdaec2b902d91ae05d69308c1 | diff --git a/authentication.go b/authentication.go
index <HASH>..<HASH> 100644
--- a/authentication.go
+++ b/authentication.go
@@ -12,13 +12,13 @@ import (
)
var (
- // Returned by digestAuthHeader when the WWW-Authenticate header is missing
+ // ErrWWWAuthenticateHeaderMissing is returned by digestAuthHeader when the WWW-Authenticate header is missing
ErrWWWAuthenticateHeaderMissing = errors.New("WWW-Authenticate header is missing")
- // Returned by digestAuthHeader when the WWW-Authenticate invalid
+ // ErrWWWAuthenticateHeaderInvalid is returned by digestAuthHeader when the WWW-Authenticate invalid
ErrWWWAuthenticateHeaderInvalid = errors.New("WWW-Authenticate header is invalid")
- // Returned by digestAuthHeader when the WWW-Authenticate header is not 'Digest'
+ // ErrWWWAuthenticateHeaderNotDigest is returned by digestAuthHeader when the WWW-Authenticate header is not 'Digest'
ErrWWWAuthenticateHeaderNotDigest = errors.New("WWW-Authenticate header type is not Digest")
) | fix comments above errors in authentication.go | andygrunwald_go-gerrit | train | go |
1bd1fdc3277984df30793690c83ca1eb20f2dab6 | diff --git a/lib/amazon-drs/error.rb b/lib/amazon-drs/error.rb
index <HASH>..<HASH> 100644
--- a/lib/amazon-drs/error.rb
+++ b/lib/amazon-drs/error.rb
@@ -2,11 +2,13 @@ require 'amazon-drs/base'
module AmazonDrs
class Error < Base
- attr_accessor :message
+ attr_accessor :message, :error_description, :error
def parse_body
json = JSON.parse(body)
@message = json['message'] if json['message']
+ @error = json['error'] if json['error']
+ @error_description = json['error_description'] if json['error_description']
end
end
end | Add error and error_description attr to Error model | aycabta_amazon-drs | train | rb |
03aca3ea148fe9b4b23ca9bed5988f6604d7d42e | diff --git a/src/components/media_control/media_control.js b/src/components/media_control/media_control.js
index <HASH>..<HASH> 100644
--- a/src/components/media_control/media_control.js
+++ b/src/components/media_control/media_control.js
@@ -190,7 +190,7 @@ export default class MediaControl extends UIObject {
this.trigger(Events.MEDIACONTROL_PLAYING)
} else {
this.$playPauseToggle.append(playIcon)
- this.$playStopToggle.append(pauseIcon)
+ this.$playStopToggle.append(playIcon)
this.trigger(Events.MEDIACONTROL_NOTPLAYING)
}
this.applyButtonStyle(this.$playPauseToggle) | media control: fix play/stop button toggle | clappr_clappr | train | js |
8109c59190bdf192a7f03bcf534feb82a0a67797 | diff --git a/lib/dm-core/query.rb b/lib/dm-core/query.rb
index <HASH>..<HASH> 100644
--- a/lib/dm-core/query.rb
+++ b/lib/dm-core/query.rb
@@ -72,7 +72,9 @@ module DataMapper
#
# Conditions are "greater than" operator for "wins"
# field and exact match operator for "conference"
- # field
+ # field:
+ #
+ # [[:gt, #<Property:Team:wins>, 30], [:eql, #<Property:Team:conference>, "East"]]
#
# @return [Array]
# the conditions that will be used to scope the results | Example of array of triples returned by DataMapper::Query#conditions | datamapper_dm-core | train | rb |
f39680206a07104b1d87b40674ed6b4c3f340d44 | diff --git a/admin/javascript/LeftAndMain.Tree.js b/admin/javascript/LeftAndMain.Tree.js
index <HASH>..<HASH> 100644
--- a/admin/javascript/LeftAndMain.Tree.js
+++ b/admin/javascript/LeftAndMain.Tree.js
@@ -189,7 +189,7 @@
* DOMElement
*/
getNodeByID: function(id) {
- return this.jstree('get_node', this.find('*[data-id='+id+']'));
+ return this.find('*[data-id='+id+']');
},
/** | BUGFIX Fixed $('.cms-tree').getNodeByID(), was always returning tree instance instead of node because 'get_node' isn't a public method, hence ignored | silverstripe_silverstripe-framework | train | js |
ca3074898f060d5e45e7e099966b6d8955959890 | diff --git a/lib/request.js b/lib/request.js
index <HASH>..<HASH> 100644
--- a/lib/request.js
+++ b/lib/request.js
@@ -67,6 +67,9 @@ function makeRequestWithNoResponse(options) {
if (options.method === 'POST') {
req.write(options.body);
}
+ req.on('error', (e) => {
+ pxLogger.debug(`Error making a non response request: ${e.message}`);
+ });
req.end();
} | added error catcher to makeRequestWithNoResponse (#<I>) | PerimeterX_perimeterx-node-core | train | js |
b37a788596caeca811b0456b3a67fdabf0b535ef | diff --git a/src/admin/class-papi-admin-assets.php b/src/admin/class-papi-admin-assets.php
index <HASH>..<HASH> 100644
--- a/src/admin/class-papi-admin-assets.php
+++ b/src/admin/class-papi-admin-assets.php
@@ -48,8 +48,9 @@ final class Papi_Admin_Assets {
*/
public function enqueue_locale() {
wp_localize_script( 'papi-main', 'papiL10n', [
- 'edit' => __( 'Edit', 'papi' ),
- 'remove' => __( 'Remove', 'papi' ),
+ 'close' => __( 'Close' ),
+ 'edit' => __( 'Edit' ),
+ 'remove' => __( 'Remove' ),
'requiredError' => __( 'This fields are required:', 'papi' ),
] );
} | Add more texts to `papiL<I>n` | wp-papi_papi | train | php |
e3a1489362a852c57c0a8e60ded26392947de853 | diff --git a/Doctrine/Orm/Paginator.php b/Doctrine/Orm/Paginator.php
index <HASH>..<HASH> 100644
--- a/Doctrine/Orm/Paginator.php
+++ b/Doctrine/Orm/Paginator.php
@@ -83,14 +83,6 @@ class Paginator implements \IteratorAggregate, PaginatorInterface
/**
* {@inheritdoc}
*/
- public function getMembers()
- {
- return $this->paginator;
- }
-
- /**
- * {@inheritdoc}
- */
public function getIterator()
{
return $this->paginator->getIterator();
diff --git a/Model/PaginatorInterface.php b/Model/PaginatorInterface.php
index <HASH>..<HASH> 100644
--- a/Model/PaginatorInterface.php
+++ b/Model/PaginatorInterface.php
@@ -45,11 +45,4 @@ interface PaginatorInterface extends \Traversable
* @return float
*/
public function getTotalItems();
-
- /**
- * Gets members of this page.
- *
- * @return array|\Traversable
- */
- public function getMembers();
} | Remove `PaginatorInteface::getMembers` since it's not used | api-platform_core | train | php,php |
322a3c2f5db9a3c867f822f56e2e46cb45a973e2 | diff --git a/opal/corelib/string.rb b/opal/corelib/string.rb
index <HASH>..<HASH> 100644
--- a/opal/corelib/string.rb
+++ b/opal/corelib/string.rb
@@ -386,7 +386,7 @@ class String
return self;
}
- var chomped = #{chomp},
+ var chomped = #{chomp(separator)},
trailing = self.length != chomped.length,
splitted = chomped.split(separator);
diff --git a/spec/filters/bugs/string.rb b/spec/filters/bugs/string.rb
index <HASH>..<HASH> 100644
--- a/spec/filters/bugs/string.rb
+++ b/spec/filters/bugs/string.rb
@@ -7,10 +7,8 @@ opal_filter "String" do
fails "String#dup does not copy constants defined in the singleton class"
- fails "String#each_line uses $/ as the separator when none is given"
fails "String#each_line yields subclass instances for subclasses"
- fails "String#lines uses $/ as the separator when none is given"
fails "String#lines yields subclass instances for subclasses"
fails "String#slice with Range calls to_int on range arguments" | Fix String#each_line/#lines uses $/ as the separator when none is given | opal_opal | train | rb,rb |
096875b21fa915ae2e7298ddb936366524f6a3d4 | diff --git a/src/main/java/net/sf/esfinge/metadata/locate/conventions/ConventionsLocator.java b/src/main/java/net/sf/esfinge/metadata/locate/conventions/ConventionsLocator.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/sf/esfinge/metadata/locate/conventions/ConventionsLocator.java
+++ b/src/main/java/net/sf/esfinge/metadata/locate/conventions/ConventionsLocator.java
@@ -25,6 +25,11 @@ public class ConventionsLocator extends MetadataLocator {
Annotation annotations[] = annotationClass.getAnnotations();
for(Annotation annot: annotations) {
+ //see if there is an annotation with @Verifier
+ //create the processor with the class configured using reflection
+ //initialize with the annotation
+ //execute if Convention is Present
+
if(annot instanceof PrefixConvention){
String prefix = ((PrefixConvention) annot).value();
@@ -44,6 +49,12 @@ public class ConventionsLocator extends MetadataLocator {
return true;
}
}
+
+ //all the test should execute
+ //this class should not have dependence to any specific convention
+
+ //bonus: create a new convention using the new structure
+ //RegularExpression
}
} | Update ConventionsLocator.java | EsfingeFramework_metadata | train | java |
34915fd7aece8e909a313a5dd7efe7257030721b | diff --git a/platform/boot.php b/platform/boot.php
index <HASH>..<HASH> 100644
--- a/platform/boot.php
+++ b/platform/boot.php
@@ -28,6 +28,8 @@ error_reporting(E_ALL | E_STRICT);
// As we preform our own exception handling we need to stop fatal errors from showing stack traces.
ini_set("display_errors", "off");
+define( "VENDOR_DIR", realpath("vendor") );
+
// Include the composer autoloader
/** @noinspection PhpIncludeInspection */
include("vendor/autoload.php"); | Added constant for the location of the vendor folder | RhubarbPHP_Rhubarb | train | php |
d53b1adc11c65bfb044c7bd4b3f79f602acf9728 | diff --git a/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php b/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php
+++ b/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php
@@ -24,7 +24,7 @@ class LoadConfiguration
// First we will see if we have a cache configuration file. If we do, we'll load
// the configuration items from that file so that it is very quick. Otherwise
// we will need to spin through every configuration file and load them all.
- if (is_file($cached = $app->getCachedConfigPath())) {
+ if (file_exists($cached = $app->getCachedConfigPath())) {
$items = require $cached;
$loadedFromCache = true; | fix: require fails if is_file cached by opcache (#<I>) | laravel_framework | train | php |
b5dfcfbfda8a307f74a9650c216c349c4c3a864a | diff --git a/src/uploader/cos.js b/src/uploader/cos.js
index <HASH>..<HASH> 100644
--- a/src/uploader/cos.js
+++ b/src/uploader/cos.js
@@ -6,6 +6,7 @@
'use strict';
const request = require('superagent');
+const debug = require('debug')('cos');
const Promise = require('../promise');
module.exports = function upload(uploadInfo, data, file, saveOptions = {}) { | fix(File): add missing debug requirement | leancloud_javascript-sdk | train | js |
1d635134fcc2252ccb794ba4934578c48ce9591d | diff --git a/datalad_service/common/annex.py b/datalad_service/common/annex.py
index <HASH>..<HASH> 100644
--- a/datalad_service/common/annex.py
+++ b/datalad_service/common/annex.py
@@ -16,7 +16,7 @@ def filter_git_files(files):
def get_repo_files(dataset, branch=None):
# If we're on the right branch, use the fast path with branch=None
- if branch == dataset.repo.get_active_branch():
+ if branch == 'HEAD' or branch == dataset.repo.get_active_branch():
branch = None
working_files = filter_git_files(dataset.repo.get_files(branch=branch))
files = [] | Another fix for slow get_files when requests are made for HEAD. | OpenNeuroOrg_openneuro | train | py |
ccc7f0951fbbf5a94478fc36bc79781d9288f211 | diff --git a/beeswarm/hive/consumer/consumer.py b/beeswarm/hive/consumer/consumer.py
index <HASH>..<HASH> 100644
--- a/beeswarm/hive/consumer/consumer.py
+++ b/beeswarm/hive/consumer/consumer.py
@@ -51,7 +51,7 @@ class Consumer:
session = self.sessions[session_id]
if not session.is_connected():
for log in active_loggers:
- session.source_ip = self.hive_ip
+ session.destination_ip = self.hive_ip
try:
log.log(session)
#make sure this greenlet does not crash on errors while calling loggers | trying to keep my sanity | honeynet_beeswarm | train | py |
1b92de05bc361156819bd0c2551c960b83b829ff | diff --git a/src/StructureApplication.php b/src/StructureApplication.php
index <HASH>..<HASH> 100644
--- a/src/StructureApplication.php
+++ b/src/StructureApplication.php
@@ -24,7 +24,7 @@ class StructureApplication extends \samson\cms\App
public function main()
{
// Get new 5 structures
- $query = dbQuery('samson\cms\cmsnav')
+ $query = dbQuery('samson\cms\CMSNav')
->join('user')
->Active(1)
->order_by('Created', 'DESC') | Fixed incorrect classname in db request | samsonos_cms_app_navigation | train | php |
5043a9607a15b811efb8ece87617f04a11a7a49b | diff --git a/src/test/java/com/watchitlater/spring/webapp/WebServer.java b/src/test/java/com/watchitlater/spring/webapp/WebServer.java
index <HASH>..<HASH> 100644
--- a/src/test/java/com/watchitlater/spring/webapp/WebServer.java
+++ b/src/test/java/com/watchitlater/spring/webapp/WebServer.java
@@ -6,14 +6,19 @@ import org.mortbay.jetty.webapp.WebAppContext;
public class WebServer {
private Server server;
+ private final int port;
public WebServer(int port) {
- server = new Server(port);
+ this.port = port;
}
public WebServer start() throws Exception {
+ System.setProperty("org.mortbay.xml.XmlParser.Validating", "false");
+
+ server = new Server(port);
server.addHandler(new WebAppContext("src/test/webapp", "/stringtemplate"));
server.start();
+
return this;
} | use non-validating parser in jetty to start up faster | tomcz_spring-stringtemplate | train | java |
987c4522f3449b91f9e9a8f54b15a02b5ae02633 | diff --git a/mapillary_tools/process_geotag_properties.py b/mapillary_tools/process_geotag_properties.py
index <HASH>..<HASH> 100644
--- a/mapillary_tools/process_geotag_properties.py
+++ b/mapillary_tools/process_geotag_properties.py
@@ -57,7 +57,7 @@ def process_geotag_properties(import_path,
"failed",
verbose)
return
- elif geotag_source not in ["exif", 'blackvue'] and not os.path.isfile(geotag_source_path):
+ elif geotag_source != "exif" and not os.path.isfile(geotag_source_path) and not os.path.isdir(geotag_source_path):
print("Error, " + geotag_source_path +
" file source of gps/time properties does not exist. If geotagging from external log, rather than image EXIF, you need to provide full path to the log file.")
processing.create_and_log_process_in_list(process_file_list, | fix: gpx source condition | mapillary_mapillary_tools | train | py |
be8a8742cacca7cdbf31a1dd8ccee6091976bc49 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -115,7 +115,10 @@ Web3ProviderEngine.prototype._handleAsync = function(payload, finished) {
}
if (error != null) {
- resultObj.error = error.stack || error.message || error
+ resultObj.error = {
+ message: error.stack || error.message || error,
+ code: -32000
+ };
finished(null, resultObj)
} else {
self._inspectResponseForNewBlock(payload, resultObj, finished)
@@ -204,7 +207,7 @@ Web3ProviderEngine.prototype._fetchBlock = function(number, cb){
}
Web3ProviderEngine.prototype._inspectResponseForNewBlock = function(payload, resultObj, cb) {
-
+
// these methods return responses with a block reference
if (payload.method != 'eth_getTransactionByHash'
&& payload.method != 'eth_getTransactionReceipt') { | Return an error object inline with the JSON RPC spec. | MetaMask_web3-provider-engine | train | js |
302d4820ff95aca27880c20b05b5fa6cc4467a40 | diff --git a/refcycle/__init__.py b/refcycle/__init__.py
index <HASH>..<HASH> 100644
--- a/refcycle/__init__.py
+++ b/refcycle/__init__.py
@@ -112,13 +112,12 @@ def snapshot():
"""
all_objects = gc.get_objects()
this_frame = inspect.currentframe()
- graph = ObjectGraph(
- [
- obj for obj in all_objects
- if obj is not this_frame
- ]
- )
- del this_frame, all_objects
+ selected_objects = []
+ for obj in all_objects:
+ if obj is not this_frame:
+ selected_objects.append(obj)
+ graph = ObjectGraph(selected_objects)
+ del this_frame, all_objects, selected_objects, obj
return graph | Lose the list comprehension, which was creating an extra cell in Python 3. | mdickinson_refcycle | train | py |
786047e2da41add6a7d27aefa9fc7e4a18bd3ad4 | diff --git a/src/main/java/gr/iti/mklab/visual/dimreduction/PCA.java b/src/main/java/gr/iti/mklab/visual/dimreduction/PCA.java
index <HASH>..<HASH> 100644
--- a/src/main/java/gr/iti/mklab/visual/dimreduction/PCA.java
+++ b/src/main/java/gr/iti/mklab/visual/dimreduction/PCA.java
@@ -142,8 +142,8 @@ public class PCA {
// compute the mean of all the samples
for (int i = 0; i < numSamples; i++) {
for (int j = 0; j < sampleSize; j++) {
- double val = A.get(i, j);
- means.set(j, val);
+ double val = means.get(j);
+ means.set(j, val + A.get(i, j));
}
}
for (int j = 0; j < sampleSize; j++) { | Working on issue #<I> resovling wrong assignment value in pca means vector calculation. | MKLab-ITI_multimedia-indexing | train | java |
964d90a968b23e6edbee8bd883f887e283f41d31 | diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -71,12 +71,15 @@ module Puppet
:type => :boolean,
:desc => 'Whether to enable a pre-Facter 4.0 release of Facter (distributed as
the "facter-ng" gem). This is not necessary if Facter 3.x or later is installed.
- This setting is still experimental and has been only included on Windows builds',
+ This setting is still experimental.',
:hook => proc do |value|
- if value && Puppet::Util::Platform.windows?
+ if value
begin
+ ORIGINAL_FACTER = Object.const_get(:Facter)
+ Object.send(:remove_const, :Facter)
require 'facter-ng'
rescue LoadError
+ Object.const_set(:Facter, ORIGINAL_FACTER)
raise ArgumentError, 'facter-ng could not be loaded'
end
end
diff --git a/spec/unit/defaults_spec.rb b/spec/unit/defaults_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/defaults_spec.rb
+++ b/spec/unit/defaults_spec.rb
@@ -182,7 +182,7 @@ describe "Defaults" do
end
end
- describe "facterng", :if => Puppet::Util::Platform.windows? do
+ describe "facterng" do
it "defaults to false" do
expect(Puppet[:facterng]).to be_falsey
end | (PUP-<I>) facter-ng available on all platforms
This commit makes facter-ng activation available on all platforms.
It also removes `Facter` module before loading `facter-ng`
to ensure that Facter 2.x and its Utils are not used. | puppetlabs_puppet | train | rb,rb |
43fdfcef1753bfa5d954088fdf1dba3587cccf4b | diff --git a/examples/echo.rb b/examples/echo.rb
index <HASH>..<HASH> 100644
--- a/examples/echo.rb
+++ b/examples/echo.rb
@@ -3,12 +3,10 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'ponder'
# This Thaum will parrot all channel messages.
-@thaum = Ponder::Thaum.new do |t|
- t.server = 'chat.freenode.org'
- t.port = 6667
- t.nick = 'Ponder'
- t.verbose = true
- t.logging = false
+@thaum = Ponder::Thaum.new do |config|
+ config.server = 'chat.freenode.org'
+ config.port = 6667
+ config.nick = 'Ponder'
end
@thaum.on :connect do | Updated example. [ci skip]
- Changed block variable name.
- Removed configuration items. | tbuehlmann_ponder | train | rb |
baf42153e12e2e24a9250abfe374b2bfddac6851 | diff --git a/lib/spidr/cookie_jar.rb b/lib/spidr/cookie_jar.rb
index <HASH>..<HASH> 100644
--- a/lib/spidr/cookie_jar.rb
+++ b/lib/spidr/cookie_jar.rb
@@ -130,6 +130,11 @@ module Spidr
@dirty.delete(host)
end
+ hdomain = host.split('.')
+ if hdomain.length > 2 && (parent_cookies = for_host(hdomain[1..-1].join('.')))
+ @cookies[host] = @cookies[host].nil? ? parent_cookies : "#{parent_cookies}; #{@cookies[host]}"
+ end
+
return @cookies[host]
end
diff --git a/spec/cookie_jar_spec.rb b/spec/cookie_jar_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/cookie_jar_spec.rb
+++ b/spec/cookie_jar_spec.rb
@@ -107,5 +107,15 @@ describe CookieJar do
cookie.should include('; ')
cookie.should include('other=1')
end
+
+ it "should include cookies for the parent domain" do
+ @cookie_jar['zerosum.org'] = {'admin' => 'ofcourseiam'}
+ @cookie_jar['sub.zerosum.org'] = {'other' => '1'}
+ cookie = @cookie_jar.for_host('sub.zerosum.org')
+
+ cookie.should include('admin=ofcourseiam')
+ cookie.should include('; ')
+ cookie.should include('other=1')
+ end
end
end | include cookies set by parent domain if they exist | postmodern_spidr | train | rb,rb |
f6234f3908802a07aad2bc9aad6279d7dabef294 | diff --git a/src/Event.php b/src/Event.php
index <HASH>..<HASH> 100644
--- a/src/Event.php
+++ b/src/Event.php
@@ -48,7 +48,9 @@ class Event
*/
function __invoke(callable $callable, array $args = [], callable $callback = null)
{
- $model = $this->signal($callable, !$args || !is_string(key($args)) ? $args : $this->args() + $args, $callback);
+ $model = $this->signal(
+ $callable, !$args ? $this->args() : (!is_string(key($args)) ? $args : $this->args() + $args), $callback
+ );
null !== $model
&& $this->model = $model; | model event without args should be stoppable | mvc5_mvc5 | train | php |
5ab028a9128b289b0c840bdb6901021fc482e6f5 | diff --git a/src/core/instance/inject.js b/src/core/instance/inject.js
index <HASH>..<HASH> 100644
--- a/src/core/instance/inject.js
+++ b/src/core/instance/inject.js
@@ -41,14 +41,13 @@ export function resolveInject (inject: any, vm: Component): ?Object {
// inject is :any because flow is not smart enough to figure out cached
const result = Object.create(null)
const keys = hasSymbol
- ? Reflect.ownKeys(inject).filter(key => {
- /* istanbul ignore next */
- return Object.getOwnPropertyDescriptor(inject, key).enumerable
- })
+ ? Reflect.ownKeys(inject)
: Object.keys(inject)
for (let i = 0; i < keys.length; i++) {
const key = keys[i]
+ // #6574 in case the inject object is observed...
+ if (key === '__ob__') continue
const provideKey = inject[key].from
let source = vm
while (source) { | refactor: speed up injection resolution | kaola-fed_megalo | train | js |
cbbee5dfe90d9047976413223f6a3cc8eac90fd0 | diff --git a/src/main/java/water/parser/CsvParser.java b/src/main/java/water/parser/CsvParser.java
index <HASH>..<HASH> 100644
--- a/src/main/java/water/parser/CsvParser.java
+++ b/src/main/java/water/parser/CsvParser.java
@@ -445,7 +445,10 @@ NEXT_CHAR:
dout.rollbackLine();
// If offset is still validly within the buffer, save it so the next pass
// can start from there.
- if( offset+1 < bits.length ) din.setChunkDataStart(cidx+1, offset+1 );
+ if( offset+1 < bits.length ) {
+ if( state == EXPECT_COND_LF && bits[offset+1] == CHAR_LF ) offset++;
+ if( offset+1 < bits.length ) din.setChunkDataStart(cidx+1, offset+1 );
+ }
return dout;
} | Fix a windows gzip parse bug
handle CR/LF at chunk boundary during unzip; was adding an extra line of
all NA's | h2oai_h2o-2 | train | java |
cd73c997b995db2a5cbb2ade6deed756b53cd864 | diff --git a/client/lib/abtest/active-tests.js b/client/lib/abtest/active-tests.js
index <HASH>..<HASH> 100644
--- a/client/lib/abtest/active-tests.js
+++ b/client/lib/abtest/active-tests.js
@@ -45,8 +45,8 @@ module.exports = {
signupThemeStepCopyChanges: {
datestamp: '20170420',
variations: {
- original: 20,
- modified: 80,
+ original: 50,
+ modified: 50,
},
defaultVariation: 'original',
}, | Updated the split for the signupThemeStepCopyChanges test (#<I>) | Automattic_wp-calypso | train | js |
6f677800fe4ba08a2b765e99fca4076293db5ce4 | diff --git a/bin/bootstrap.js b/bin/bootstrap.js
index <HASH>..<HASH> 100755
--- a/bin/bootstrap.js
+++ b/bin/bootstrap.js
@@ -306,6 +306,7 @@ CasperError.prototype = Object.getPrototypeOf(new Error());
// declare a dummy patchRequire function
require.globals.patchRequire = global.patchRequire = function(req) { return req;};
+ require.globals.CasperError = CasperError;
}
else {
// patch require | Refs #<I>: CasperError should be declared as a global function | casperjs_casperjs | train | js |
171ef87d9941dbaf052a62bef9d54197a986187e | diff --git a/gwpy/table/tests/test_table.py b/gwpy/table/tests/test_table.py
index <HASH>..<HASH> 100644
--- a/gwpy/table/tests/test_table.py
+++ b/gwpy/table/tests/test_table.py
@@ -75,9 +75,11 @@ def mock_hacr_connection(table, start, stop):
cursor.execute = execute
def fetchall():
- if cursor._query.get_real_name() == 'job':
+ q = cursor._query
+ name = q.get_real_name() or q._get_first_name()
+ if name == 'job':
return [(1, start, stop)]
- if cursor._query.get_real_name() == 'mhacr':
+ if name == 'mhacr':
columns = list(map(
str, list(cursor._query.get_sublists())[0].get_identifiers()))
selections = list(map( | gwpy.table: fix tests for sqlparse-<I> | gwpy_gwpy | train | py |
ce66a0c8b0e42a1b3855792b424a54291568f468 | diff --git a/atrcopy/segments.py b/atrcopy/segments.py
index <HASH>..<HASH> 100644
--- a/atrcopy/segments.py
+++ b/atrcopy/segments.py
@@ -553,7 +553,7 @@ class DefaultSegment:
r = r.get_indexed[other.order]
return r
- def save_session(self, mdict):
+ def serialize_session(self, mdict):
"""Save extra metadata to a dict so that it can be serialized
This is not saved by __getstate__ because child segments will point to
diff --git a/test/test_serialize.py b/test/test_serialize.py
index <HASH>..<HASH> 100644
--- a/test/test_serialize.py
+++ b/test/test_serialize.py
@@ -47,15 +47,15 @@ class TestSegment:
s.set_user_data([r], 4, 99)
out = dict()
- s.serialize_extra_to_dict(out)
+ s.serialize_session(out)
print("saved", out)
data = np.ones([4000], dtype=np.uint8)
r = SegmentData(data)
s2 = DefaultSegment(r, 0)
- s2.restore_extra_from_dict(out)
+ s2.restore_session(out)
out2 = dict()
- s2.serialize_extra_to_dict(out2)
+ s2.serialize_session(out2)
print("loaded", out2)
assert out == out2 | Changed save_session to serialize_session | robmcmullen_atrcopy | train | py,py |
7a705d44bd2fc3adc8444761531f2c0f2f6709a8 | diff --git a/lib/metro/models/model_factory.rb b/lib/metro/models/model_factory.rb
index <HASH>..<HASH> 100644
--- a/lib/metro/models/model_factory.rb
+++ b/lib/metro/models/model_factory.rb
@@ -4,9 +4,8 @@ module Metro
attr_reader :name
def initialize(name,options)
- options.symbolize_keys!
@name = name.to_s.downcase
- @options = options
+ @options = options.symbolize_keys
end
def create | Model Factory symbolizing the keys of the options stored | burtlo_metro | train | rb |
34affc1a7a338aa372d5005472ea5c7d123547be | diff --git a/packages/vue-styleguidist/src/client/rsg-components/Usage/index.js b/packages/vue-styleguidist/src/client/rsg-components/Usage/index.js
index <HASH>..<HASH> 100644
--- a/packages/vue-styleguidist/src/client/rsg-components/Usage/index.js
+++ b/packages/vue-styleguidist/src/client/rsg-components/Usage/index.js
@@ -1 +1 @@
-export { default } from './Usage'
+export { default } from 'rsg-components/Usage/Usage' | style: allow customization of Usage component | vue-styleguidist_vue-styleguidist | train | js |
5981fc20abc43a5c2cd90774da84abe57886068a | diff --git a/VERSION b/VERSION
index <HASH>..<HASH> 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.2.3
+0.2.4
diff --git a/lib/tabular/row.rb b/lib/tabular/row.rb
index <HASH>..<HASH> 100644
--- a/lib/tabular/row.rb
+++ b/lib/tabular/row.rb
@@ -88,6 +88,10 @@ module Tabular
column = columns[key]
column.renderer.render column, self
end
+
+ def metadata
+ @table.metadata
+ end
def to_hash
hash.dup
diff --git a/lib/tabular/table.rb b/lib/tabular/table.rb
index <HASH>..<HASH> 100644
--- a/lib/tabular/table.rb
+++ b/lib/tabular/table.rb
@@ -181,6 +181,11 @@ module Tabular
def renderers
columns.renderers
end
+
+ # Last-resort storage for client code data
+ def metadata
+ @metadata ||= {}
+ end
def to_s
"#<#{self.class} #{rows.size}>" | Add Table#metadata. Sometimes you just have to pass arbritrary data around. | scottwillson_tabular | train | VERSION,rb,rb |
f3a55ca48a94304ebd955548ae8c657a3a86e497 | diff --git a/freemius/templates/pricing.php b/freemius/templates/pricing.php
index <HASH>..<HASH> 100644
--- a/freemius/templates/pricing.php
+++ b/freemius/templates/pricing.php
@@ -39,7 +39,7 @@
);
}
- $query_params = array_merge( $context_params, array(
+ $query_params = array_merge( $context_params, $_GET, array(
'next' => $fs->_get_admin_page_url( 'account', array( 'fs_action' => $slug . '_sync_license' ) ),
'plugin_version' => $fs->get_plugin_version(),
// Billing cycle. | [pricing] [checkout] Send querystring $_GET params to the iframe to enable special params transfer like forcing cc payment with payment_method=cc. | Freemius_wordpress-sdk | train | php |
dfbca089bc0e62ec34945fa772724d0c3f545d76 | diff --git a/pythran/unparse.py b/pythran/unparse.py
index <HASH>..<HASH> 100644
--- a/pythran/unparse.py
+++ b/pythran/unparse.py
@@ -17,7 +17,7 @@ import io
# Large float and imaginary literals get turned into infinities in the AST.
# We unparse those infinities to INFSTR.
-INFSTR = "1e" + repr(sys.float_info.max_10_exp + 1)
+INFSTR = "(1e1000 ** 2)"
def interleave(inter, f, seq): | Nit: unparser displays a large value to represent infinite
That's not satisfying, use an infinite value instead (D'oh) | serge-sans-paille_pythran | train | py |
239404aa04e4434b6010db38b7d38d557d4acff4 | diff --git a/src/sentry_plugins/gitlab/client.py b/src/sentry_plugins/gitlab/client.py
index <HASH>..<HASH> 100644
--- a/src/sentry_plugins/gitlab/client.py
+++ b/src/sentry_plugins/gitlab/client.py
@@ -68,5 +68,5 @@ class GitLabClient(object):
def list_project_members(self, repo):
return self.request(
'GET',
- '/projects/{}/members'.format(quote(repo, safe='')),
+ '/projects/{}/members?per_page=100'.format(quote(repo, safe='')),
) | ref(gitlab):Increase member request to <I> results (#<I>) | getsentry_sentry-plugins | train | py |
943203c1aa4119a07b3815ae50eaae33b710e730 | diff --git a/toml.py b/toml.py
index <HASH>..<HASH> 100644
--- a/toml.py
+++ b/toml.py
@@ -501,15 +501,17 @@ def _load_value(v):
if v[0] == '-':
neg = True
v = v[1:]
- if '.' in v or 'e' in v:
- if v.split('.', 1)[1] == '':
+ elif v[0] == '+':
+ v = v[1:]
+ v = v.replace('_', '')
+ if '.' in v or 'e' in v or 'E' in v:
+ if '.' in v and v.split('.', 1)[1] == '':
raise TomlDecodeError("This float is missing digits after the point")
if v[0] not in '0123456789':
raise TomlDecodeError("This float doesn't have a leading digit")
v = float(v)
itype = "float"
else:
- v = v.replace('_', '')
v = int(v)
if neg:
return (0 - v, itype) | fix float with E, fix float without dot | uiri_toml | train | py |
028ce9242ec459ffeecdb8fd5f4a93e5f536c429 | diff --git a/source/index.js b/source/index.js
index <HASH>..<HASH> 100644
--- a/source/index.js
+++ b/source/index.js
@@ -21,10 +21,14 @@ var self = function SixToLibrary () {
AMDFormatter.apply(this, arguments);
this.globalExportId = t.toIdentifier(basename(this.file.opts.filename));
this.globalIds = {};
+
+ // Remove the module-wide "use strict" statement.
+ this.file.transformers = this.file.transformers.filter(function (transformer) {
+ return (transformer.key != 'useStrict');
+ });
};
util.inherits(self, AMDFormatter);
-
// Override the method `transform`.
self.prototype.transform = function (ast) {
var moduleName;
@@ -47,7 +51,8 @@ self.prototype.transform = function (ast) {
( null
, [t.identifier('exports')].concat(ids.map(pluck('value')))
, t.blockStatement(
- program.body
+ [].concat(t.literal('use strict'))
+ .concat(program.body)
.concat(template('resolve-exports'))
)
); | Switch to function form of "use strict" | architectcodes_6-to-library | train | js |
3e131f5b709c5f32d3f1057fe9eb3ad3d1344efd | diff --git a/tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTest.php b/tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTest.php
index <HASH>..<HASH> 100644
--- a/tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTest.php
+++ b/tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTest.php
@@ -168,6 +168,7 @@ class HttpCacheTest extends HttpCacheTestCase
$response->setContent('private data');
}
} else {
+ $response->headers->set('Cache-Control', 'public');
$response->setETag('"public tag"');
if (in_array('"public tag"', $etags)) {
$response->setStatusCode(304); | [HttpKernel] fixed invalid test
According to ResponseHeaderBag::computeCacheControlValue(), a response with an ETag but no explicit Cache-Control header should have a sensible Cache-Control of "private, must-revalidate" set. According to Response::isCacheable(), a response that includes a private Cache-Controls is not considered cacheable. Therefore, in order for this test response to be cacheable and stored, it requires an explicit Cache-Control of public. | symfony_symfony | train | php |
2e276f87de7a9ddbf089fc3767a31b53b4bfabd4 | diff --git a/tests/grammar/test_alter_table.py b/tests/grammar/test_alter_table.py
index <HASH>..<HASH> 100644
--- a/tests/grammar/test_alter_table.py
+++ b/tests/grammar/test_alter_table.py
@@ -1,11 +1,14 @@
# -*- encoding:utf-8 -*-
-from __future__ import absolute_import, division, print_function, unicode_literals
+try:
+ from __future__ import absolute_import, division, print_function, unicode_literals
-import unittest
+ import unittest
-import pyparsing
+ import pyparsing
-from mysqlparse.grammar.alter_table import alter_table_syntax
+ from mysqlparse.grammar.alter_table import alter_table_syntax
+except ImportError as ex:
+ print(ex)
class AlterTableSyntaxTest(unittest.TestCase): | Debug the travis-ci build
Can't recreate the travis-ci build failure locally, so we'll have to go through this painful process to find out which import in the tests is causing the test suite to fail. | seporaitis_mysqlparse | train | py |
ea3d77955a313433fea7e7eec724defdfad364fd | diff --git a/angr/project.py b/angr/project.py
index <HASH>..<HASH> 100644
--- a/angr/project.py
+++ b/angr/project.py
@@ -393,8 +393,8 @@ class Project(object):
if self.arch.name != 'ARM':
return False
- if self._cfg is not None:
- return self._cfg.is_thumb_addr(addr)
+ if self.analyzed('CFG'):
+ return self.analyze('CFG').cfg.is_thumb_addr(addr)
# What binary is that ?
obj = self.binary_by_addr(addr) | Use CFG analysis instead of cached CFG | angr_angr | train | py |
e314a5f17913dbf88cc26f2fd8963b154722cdc3 | diff --git a/extras/basic_example/public/script.js b/extras/basic_example/public/script.js
index <HASH>..<HASH> 100644
--- a/extras/basic_example/public/script.js
+++ b/extras/basic_example/public/script.js
@@ -100,8 +100,8 @@ window.onload = function () {
};
room.addEventListener('room-connected', function (roomEvent) {
-
- room.publish(localStream, {maxVideoBW: 300, metadata: {type: 'publisher'}});
+ var onlySubscribe = getParameterByName('onlySubscribe');
+ if (!onlySubscribe) room.publish(localStream, {metadata: {type: 'publisher'}});
subscribeToStreams(roomEvent.streams);
}); | Enable Subscribe only option when loading basic example (#<I>) | lynckia_licode | train | js |
2aebd503ae77ff6037fe8f3fb1d60bca9b1c4d0f | diff --git a/src/Event/Subscriber/FormSubscriber.php b/src/Event/Subscriber/FormSubscriber.php
index <HASH>..<HASH> 100644
--- a/src/Event/Subscriber/FormSubscriber.php
+++ b/src/Event/Subscriber/FormSubscriber.php
@@ -96,7 +96,7 @@ class FormSubscriber implements EventSubscriberInterface
}
$form->handleRequest($event->getRequest());
- if ($form->isValid() && $form->isSubmitted()) {
+ if ($form->isSubmitted() && $form->isValid()) {
$data = $form->getData();
foreach ($filters as $name => $options) { | Fix call order when checking if a form is submitted or valid | larriereguichet_AdminBundle | train | php |
3a8d3617f6e8c065f41b2392c2850d894bd15f4f | diff --git a/web/dispatch/object/dispatch.py b/web/dispatch/object/dispatch.py
index <HASH>..<HASH> 100644
--- a/web/dispatch/object/dispatch.py
+++ b/web/dispatch/object/dispatch.py
@@ -3,7 +3,6 @@
from __future__ import unicode_literals
from inspect import isclass, isroutine
-from functools import partial
from .util import nodefault, ipeek, str
@@ -36,8 +35,8 @@ class ObjectDispatch(object):
if __debug__:
if not isinstance(path, deque):
warnings.warn(
- "Your code uses auto-casting of paths to a deque; "
- "this will explode gloriously if run in a production environment.",
+ "Your code is providing the path as a string; this will be cast to a deque in development but"
+ "will explode gloriously if run in a production environment.",
RuntimeWarning, stacklevel=1
)
diff --git a/web/dispatch/object/util.py b/web/dispatch/object/util.py
index <HASH>..<HASH> 100644
--- a/web/dispatch/object/util.py
+++ b/web/dispatch/object/util.py
@@ -1,9 +1,9 @@
# encoding: utf-8
-try: # pragma: cover py2
+try:
str = unicode
range = xrange
-except: # pragma: cover py3
+except:
str = str
range = range | Wording correction and removal of pragmas because codecov.io. | marrow_web.dispatch.object | train | py,py |
c67fbe80d0c710e68e4b750aca86e2a74e74ffbc | diff --git a/NavigationReactNative/sample/twitter/index.ios.js b/NavigationReactNative/sample/twitter/index.ios.js
index <HASH>..<HASH> 100644
--- a/NavigationReactNative/sample/twitter/index.ios.js
+++ b/NavigationReactNative/sample/twitter/index.ios.js
@@ -20,9 +20,9 @@ export default Twitter = () => (
<View>
<SceneNavigator
startStateKey="home"
- unmountedStyle={{ translate: spring(100), scale: spring(1) }}
+ unmountedStyle={{ translate: spring(1), scale: spring(1) }}
mountedStyle={{ translate: spring(0), scale: spring(1) }}
- crumbStyle={{ translate: spring(5), scale: spring(0.9) }}
+ crumbStyle={{ translate: spring(0.05), scale: spring(0.9) }}
stateNavigator={stateNavigator}>
{({translate, scale}, scene, active) => (
<View
@@ -30,7 +30,7 @@ export default Twitter = () => (
style={[
styles.scene,
{ transform: [
- { translateX: Dimensions.get('window').width * translate / 100 },
+ { translateX: Dimensions.get('window').width * translate },
{ scale: scale },
]
}, | Divided translate spring by <I> | grahammendick_navigation | train | js |
bbc8d53183460b80944556b10f15a8410cd5e820 | diff --git a/spyder/plugins/statusbar/plugin.py b/spyder/plugins/statusbar/plugin.py
index <HASH>..<HASH> 100644
--- a/spyder/plugins/statusbar/plugin.py
+++ b/spyder/plugins/statusbar/plugin.py
@@ -68,7 +68,7 @@ class StatusBar(SpyderPluginV2):
self.add_status_widget(
self.clock_status, StatusBarWidgetPosition.Right)
- def on_close(self):
+ def on_close(self, _unused):
self._statusbar.setVisible(False)
@on_plugin_available(plugin=Plugins.Preferences) | Add proper signature to statusbar on_close method | spyder-ide_spyder | train | py |
f04f5de883cb2421c6bd9fb67951cdb5fc1eeff5 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -13,14 +13,19 @@ function walkLib ({ lib, parameters, pastParameters = [] }) {
}
const nextCommand = parameters.shift()
+ const nextLib = lib[nextCommand]
+
+ if (typeof nextLib === 'undefined') {
+ return {
+ command: lib,
+ parameters,
+ pastParameters
+ }
+ }
pastParameters.push(nextCommand)
- return walkLib({
- lib: lib[nextCommand],
- parameters,
- pastParameters
- })
+ return walkLib({ lib: nextLib, parameters, pastParameters })
}
async function execute ({ | fix: when next command does not exist | gumieri_lib2cli | train | js |
e41f3f74831e67b186ab4ff7d249148e829508c8 | diff --git a/lib/client-base.js b/lib/client-base.js
index <HASH>..<HASH> 100644
--- a/lib/client-base.js
+++ b/lib/client-base.js
@@ -697,17 +697,16 @@ function resume (client) {
// TODO: Convert into buffer if ended && length > 0.
const state = body._readableState
- if (
- state && state.ended && state.length === 0 &&
- typeof body.destroy === 'function' && !body.destroyed
- ) {
+ if (state && state.ended && state.length === 0) {
// Wait for 'end' before destroying to avoid close before end errors.
body
.on('data', function () {
// TODO: What to do?
})
.on('end', function () {
- this.destroy()
+ if (typeof this.destroy === 'function' && !this.destroyed) {
+ this.destroy()
+ }
})
request.body = null | refactor: move body.destroy into end handler | mcollina_undici | train | js |
1229903dcc8def7f0ebec3d07bef72f0568c397a | diff --git a/cas_server/views.py b/cas_server/views.py
index <HASH>..<HASH> 100644
--- a/cas_server/views.py
+++ b/cas_server/views.py
@@ -58,11 +58,12 @@ def login(request):
form = forms.UserCredential(initial={'service':service,'method':method,'warn':request.session.get("warn")})
# if authenticated and successfully renewed authentication if needed
- if request.session.get("authenticated") and (not renew or renewed):
+ if request.session.get("authenticated") request.session.get("username") and (not renew or renewed):
try:
user = models.User.objects.get(username=request.session["username"])
except models.User.DoesNotExist:
_logout(request)
+ return redirect("login")
# if login agains a service is requestest
if service: | redirect to login if user do not exists | nitmir_django-cas-server | train | py |
93fa3ef6a920f5d3f4b616f844c7c01094cc669b | diff --git a/aiocache/cache.py b/aiocache/cache.py
index <HASH>..<HASH> 100644
--- a/aiocache/cache.py
+++ b/aiocache/cache.py
@@ -453,6 +453,8 @@ class RedisCache(RedisBackend, BaseCache):
:param port: int with the port to connect to
:param db: int indicating database to use
:param password: str indicating password to use
+ :param pool_min_size: int minimum pool size for the redis connections pool
+ :param pool_max_size: int maximum pool size for the redis connections pool
"""
def __init__(self, **kwargs):
super().__init__(**kwargs) | Updated RedisCache docs @minor | argaen_aiocache | train | py |
209a60e59167382e363b5cb7bb803199b626499a | diff --git a/src/aspectlib/utils.py b/src/aspectlib/utils.py
index <HASH>..<HASH> 100644
--- a/src/aspectlib/utils.py
+++ b/src/aspectlib/utils.py
@@ -35,6 +35,7 @@ def logf(logger_func):
logProcesses = logging.logProcesses
logThreads = logging.logThreads
logging.logThreads = logging.logProcesses = False
+ # disable logging pids and tids - we don't want extra calls around, especilly when we monkeypatch stuff
try:
return logger_func(*args)
finally: | Add a note about the logging.logThreads and logging.logProcesses flags. | ionelmc_python-aspectlib | train | py |
5e2e4c1de5c92cc47a5779309956ddb656ace42c | diff --git a/lib/rfunk/version.rb b/lib/rfunk/version.rb
index <HASH>..<HASH> 100644
--- a/lib/rfunk/version.rb
+++ b/lib/rfunk/version.rb
@@ -1,3 +1,3 @@
module RFunk
- VERSION = '0.6.1'
+ VERSION = '0.7.0'
end | Bumped to version <I> | alexfalkowski_rfunk | train | rb |
7aabb13906173251524aee715f81146d01d2b9f4 | diff --git a/underfs/swift/src/main/java/alluxio/underfs/swift/SwiftOutputStream.java b/underfs/swift/src/main/java/alluxio/underfs/swift/SwiftOutputStream.java
index <HASH>..<HASH> 100644
--- a/underfs/swift/src/main/java/alluxio/underfs/swift/SwiftOutputStream.java
+++ b/underfs/swift/src/main/java/alluxio/underfs/swift/SwiftOutputStream.java
@@ -73,6 +73,7 @@ public class SwiftOutputStream extends OutputStream {
// Status 400 and up should be read from error stream
// Expecting here 201 Create or 202 Accepted
if (mHttpCon.getResponseCode() >= 400) {
+ LOG.error("Failed to write data to Swift, error code: " + mHttpCon.getResponseCode());
is = mHttpCon.getErrorStream();
} else {
is = mHttpCon.getInputStream(); | Log an error when Swift output stream does not successfully close. | Alluxio_alluxio | train | java |
a9c53be96a79c3fef67fba8e8962ad4e069b2d13 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -14,7 +14,7 @@ with open(os.path.join(here, 'README.rst')) as f:
REQUIREMENTS = [
'httplib2 >= 0.9.1',
'googleapis-common-protos',
- 'oauth2client >= 2.0.0',
+ 'oauth2client >= 2.0.0.post1',
'protobuf >= 3.0.0b2',
'pyOpenSSL',
'six',
@@ -22,7 +22,7 @@ REQUIREMENTS = [
setup(
name='gcloud',
- version='0.10.0',
+ version='0.10.1',
description='API Client library for Google Cloud',
author='Google Cloud Platform',
author_email='jjg+gcloud-python@google.com', | Upgrading version to <I>.
This is necessitated by the broken GCE support in oauth2client
<I>. | googleapis_google-cloud-python | train | py |
969878dfd1b8827d39174322cbdf8c83378c76e0 | diff --git a/src/main/org/openscience/cdk/io/PDBReader.java b/src/main/org/openscience/cdk/io/PDBReader.java
index <HASH>..<HASH> 100644
--- a/src/main/org/openscience/cdk/io/PDBReader.java
+++ b/src/main/org/openscience/cdk/io/PDBReader.java
@@ -671,9 +671,19 @@ public class PDBReader extends DefaultChemObjectReader {
// oAtom.setSymbol((new String(cLine.substring(76, 78))).trim());
// }
if (lineLength >= 79) {
- String frag = cLine.substring(78, 80).trim();
+ String frag;
+ if (lineLength >= 80) {
+ frag = cLine.substring(78, 80).trim();
+ } else {
+ frag = cLine.substring(78);
+ }
if (frag.length() > 0) {
- oAtom.setCharge(Double.parseDouble(frag));
+ // see Format_v33_A4.pdf, p. 178
+ if (frag.endsWith("-") || frag.endsWith("+")) {
+ oAtom.setCharge(Double.parseDouble(new StringBuilder(frag).reverse().toString()));
+ } else {
+ oAtom.setCharge(Double.parseDouble(frag));
+ }
}
} | Fix for charge parsing in PDB files, based on the patch by Nils <<EMAIL>>
Change-Id: I<I>ac<I>febdebfc6e<I>f2c6 | cdk_cdk | train | java |
3db6b80e768b9a71a518b74acfb04379e94c2004 | diff --git a/lib/critical_path_css/rails/version.rb b/lib/critical_path_css/rails/version.rb
index <HASH>..<HASH> 100644
--- a/lib/critical_path_css/rails/version.rb
+++ b/lib/critical_path_css/rails/version.rb
@@ -1,6 +1,6 @@
module CriticalPathCSS
module Rails
- VERSION = '0.2.2'
+ VERSION = '0.2.3'
PENTHOUSE_VERSION = '0.3.4'
end
end | Update version to account for the last commit by Piero | mudbugmedia_critical-path-css-rails | train | rb |
51c8a310bea322ab035257679d8b17538946f3d6 | diff --git a/zipline/finance/trading.py b/zipline/finance/trading.py
index <HASH>..<HASH> 100644
--- a/zipline/finance/trading.py
+++ b/zipline/finance/trading.py
@@ -95,8 +95,6 @@ class TradingEnvironment(object):
if max_date:
self.treasury_curves = self.treasury_curves.ix[:max_date, :]
- self.full_trading_day = datetime.timedelta(hours=6, minutes=30)
- self.early_close_trading_day = datetime.timedelta(hours=3, minutes=30)
self.exchange_tz = exchange_tz
bi = self.benchmark_returns.index | MAINT: Remove unused members of TradingEnvironment.
The following members are no longer referenced elsewhere:
- `full_trading_day`
- `early_close_trading_day` | quantopian_zipline | train | py |
4633ef607b6651d3692563f0edd28a0030750a32 | diff --git a/osbs/http.py b/osbs/http.py
index <HASH>..<HASH> 100644
--- a/osbs/http.py
+++ b/osbs/http.py
@@ -215,6 +215,7 @@ class PycurlAdapter(object):
self.c.setopt(pycurl.WRITEFUNCTION, self.response.write)
self.c.setopt(pycurl.HEADERFUNCTION, self.response_headers.write)
self.c.setopt(pycurl.SSL_VERIFYPEER, 1 if verify_ssl else 0)
+ self.c.setopt(pycurl.SSL_VERIFYHOST, 1 if verify_ssl else 0)
self.c.setopt(pycurl.VERBOSE, 1 if self.verbose else 0)
if username and password:
self.c.setopt(pycurl.USERPWD, b"%s:%s" % (username, password)) | http: Don't verify host if verify_ssl is disabled
Sometimes OpenShift self-signed certificate isn't created correctly and
CommonName is <I> instead of IP address/FQDN under which is
OpenShift available. This change allows ignore this inconsistency which
would otherwise cause following fatal error:
SSL: certificate subject name (<I>) does not match target host
name 'openshift.example.com' | projectatomic_osbs-client | train | py |
7ddd4b427e69a40554ba0d6806bc7233bd277235 | diff --git a/src/Chromabits/Nucleus/Testing/TestCase.php b/src/Chromabits/Nucleus/Testing/TestCase.php
index <HASH>..<HASH> 100644
--- a/src/Chromabits/Nucleus/Testing/TestCase.php
+++ b/src/Chromabits/Nucleus/Testing/TestCase.php
@@ -94,4 +94,21 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase
$message
);
}
+
+ /**
+ * Assert that an object has all attributes in an array.
+ *
+ * @param array $attributes
+ * @param mixed $object
+ * @param string $message
+ */
+ public function assertObjectHasAttributes(
+ array $attributes,
+ $object,
+ $message = ''
+ ) {
+ foreach ($attributes as $attr) {
+ $this->assertObjectHasAttribute($attr, $object, $message);
+ }
+ }
} | Bring test utility function from Illuminated | chromabits_nucleus | train | php |
9fd8e2aa81961b6d4305cd8fd723d5c89eec6759 | diff --git a/addon/model-definition.js b/addon/model-definition.js
index <HASH>..<HASH> 100644
--- a/addon/model-definition.js
+++ b/addon/model-definition.js
@@ -105,9 +105,22 @@ export default class Definition {
});
}
+ shouldSerialize(internal, type) {
+ if(type === 'shoebox') {
+ let state = internal.state;
+ if(!state.isLoaded && !state.isNew) {
+ return false;
+ }
+ if(state.isNew && !internal.id) {
+ return false;
+ }
+ }
+ return true;
+ }
+
serialize(internal, type='document') {
isOneOf('type', type, [ 'preview', 'document', 'shoebox' ]);
- if(type === 'shoebox' && !internal.state.isNew && !internal.state.isLoaded) {
+ if(!this.shouldSerialize(internal, type)) {
return;
}
let doc = copy(internal.raw || {}); | definition.shouldSerialize
checks if internalModel is loaded and, if new, whether has id | ampatspell_ember-cli-sofa | train | js |
d590ffdc68d763feca60e1b88c5f179442ca578e | diff --git a/mod/assign/mod_form.php b/mod/assign/mod_form.php
index <HASH>..<HASH> 100644
--- a/mod/assign/mod_form.php
+++ b/mod/assign/mod_form.php
@@ -92,9 +92,9 @@ class mod_assign_mod_form extends moodleform_mod {
$mform->addHelpButton('submissiondrafts', 'submissiondrafts', 'assign');
$mform->setDefault('submissiondrafts', 0);
// submission statement
- if (!empty($config->requiresubmissionstatement)) {
+ if (empty($config->requiresubmissionstatement)) {
$mform->addElement('selectyesno', 'requiresubmissionstatement', get_string('requiresubmissionstatement', 'assign'));
- $mform->setDefault('requiresubmissionstatement', !empty($config->submissionstatement));
+ $mform->setDefault('requiresubmissionstatement', 0);
$mform->addHelpButton('requiresubmissionstatement', 'requiresubmissionstatement', 'assign');
} else {
$mform->addElement('hidden', 'requiresubmissionstatement', 1); | MDL-<I> Assignment : fixed requiresubmission setting states | moodle_moodle | train | php |
ce16c7e124cf73b45a48ee46ab06739a8263e1c9 | diff --git a/addon/mixins/base-query-manager.js b/addon/mixins/base-query-manager.js
index <HASH>..<HASH> 100644
--- a/addon/mixins/base-query-manager.js
+++ b/addon/mixins/base-query-manager.js
@@ -1,11 +1,10 @@
import { inject as service } from '@ember/service';
import Mixin from '@ember/object/mixin';
-import { computed } from '@ember/object';
export default Mixin.create({
apolloService: service('apollo'),
-
- apollo: computed(function() {
- return this.get('apolloService').createQueryManager();
- }),
+ init() {
+ this._super(...arguments);
+ this.set('apollo', this.get('apolloService').createQueryManager());
+ },
}); | Replace 0-arg CP w/ eager instantiation (#<I>) | ember-graphql_ember-apollo-client | train | js |
4e941e3d2de1a15f0961a2b033a23a4a45482d1f | diff --git a/src/Symfony/Component/Process/Pipes/WindowsPipes.php b/src/Symfony/Component/Process/Pipes/WindowsPipes.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/Process/Pipes/WindowsPipes.php
+++ b/src/Symfony/Component/Process/Pipes/WindowsPipes.php
@@ -230,7 +230,7 @@ class WindowsPipes extends AbstractPipes
if (false === $data || (true === $close && feof($r['input']) && '' === $data)) {
// no more data to read on input resource
// use an empty buffer in the next reads
- unset($this->input);
+ $this->input = null;
}
} | [Process] Fix input reset in WindowsPipes
Unsetting the input property causes an E_NOTICE error when the
property is checked on line <I> (and is likely unintentional anyway). | symfony_symfony | train | php |
697e18a720b06b5f67a519240b928ad43850f79b | diff --git a/lib/ronin.rb b/lib/ronin.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin.rb
+++ b/lib/ronin.rb
@@ -22,4 +22,5 @@
#
require 'ronin/environment'
+require 'ronin/platform'
require 'ronin/version' | Have reqire 'ronin', also require 'ronin/platform'. | ronin-ruby_ronin | train | rb |
da29bd2cbe3e40d52f6bbd71ebcf642e34035605 | diff --git a/pkg/controller/nodelifecycle/node_lifecycle_controller.go b/pkg/controller/nodelifecycle/node_lifecycle_controller.go
index <HASH>..<HASH> 100644
--- a/pkg/controller/nodelifecycle/node_lifecycle_controller.go
+++ b/pkg/controller/nodelifecycle/node_lifecycle_controller.go
@@ -1042,6 +1042,8 @@ func (nc *Controller) ReducedQPSFunc(nodeNum int) float32 {
// addPodEvictorForNewZone checks if new zone appeared, and if so add new evictor.
func (nc *Controller) addPodEvictorForNewZone(node *v1.Node) {
+ nc.evictorLock.Lock()
+ defer nc.evictorLock.Unlock()
zone := utilnode.GetZoneKey(node)
if _, found := nc.zoneStates[zone]; !found {
nc.zoneStates[zone] = stateInitial | Fix data race in node lifecycle controller | kubernetes_kubernetes | train | go |
80348f719d1276bb503292d5c613e7a32c84715e | diff --git a/programs/conversion_scripts/cit_magic.py b/programs/conversion_scripts/cit_magic.py
index <HASH>..<HASH> 100644
--- a/programs/conversion_scripts/cit_magic.py
+++ b/programs/conversion_scripts/cit_magic.py
@@ -248,7 +248,6 @@ def main(**kwargs):
else:
SampRec['method_codes']='SO-MAG'
for line in Lines[2:len(Lines)]:
- #print 'line:', line
if line == '\n': continue
MeasRec=SpecRec.copy()
MeasRec.pop('sample')
diff --git a/programs/convert2unix.py b/programs/convert2unix.py
index <HASH>..<HASH> 100755
--- a/programs/convert2unix.py
+++ b/programs/convert2unix.py
@@ -7,7 +7,7 @@ def main():
convert2unix.py
DESCRIPTION
- converts mac or dos formatted file to unix file in plac
+ converts mac or dos formatted file to unix file in place
SYNTAX
convert2unix.py FILE | fixed some typos in convert2unix and native <I> cit_magic | PmagPy_PmagPy | train | py,py |
4289b56ebe944f689d1db52d29ea3a306f683e1d | diff --git a/spec/heroku/command/apps_spec.rb b/spec/heroku/command/apps_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/heroku/command/apps_spec.rb
+++ b/spec/heroku/command/apps_spec.rb
@@ -9,14 +9,6 @@ module Heroku::Command
stub_core
end
- before(:each) do
- WebMock.disable!
- end
-
- after(:each) do
- WebMock.enable!
- end
-
context("info") do
before(:each) do
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -19,6 +19,8 @@ require "webmock/rspec"
include WebMock::API
+WebMock::HttpLibAdapters::ExconAdapter.disable!
+
def api
Heroku::API.new(:api_key => "pass", :mock => true)
end | completely disable webmock for excon connections | heroku_legacy-cli | train | rb,rb |
23a0b6e9109c07f53a43f8a4b0b01dccf10760b3 | diff --git a/undocker.py b/undocker.py
index <HASH>..<HASH> 100644
--- a/undocker.py
+++ b/undocker.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
import argparse
+import errno
import json
import logging
import os
@@ -118,7 +119,7 @@ def main():
os.mkdir(args.output)
for id in reversed(layers):
- if args.layer and not id in args.layer:
+ if args.layer and id not in args.layer:
continue
LOG.info('extracting layer %s', id)
@@ -136,9 +137,13 @@ def main():
else:
newpath = path.replace('/.wh.', '/')
- LOG.info('removing path %s', newpath)
- os.unlink(path)
- os.unlink(newpath)
+ try:
+ LOG.info('removing path %s', newpath)
+ os.unlink(path)
+ os.unlink(newpath)
+ except OSError as err:
+ if err.errno != errno.ENOENT:
+ raise
if __name__ == '__main__': | failure to remove a file should not be fatal
when processing whiteouts, failure to remove a file should
not be fatal, since our desired end state is that the file is absent.
Closes #8. | larsks_undocker | train | py |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.