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 |
|---|---|---|---|---|---|
29465397ddb39a88c7534ae80b877024456fca3d | diff --git a/matterclient/matterclient.go b/matterclient/matterclient.go
index <HASH>..<HASH> 100644
--- a/matterclient/matterclient.go
+++ b/matterclient/matterclient.go
@@ -106,7 +106,7 @@ func (m *MMClient) Login() error {
}
// login to mattermost
m.Client = model.NewClient(uriScheme + m.Credentials.Server)
- m.Client.HttpClient.Transport = &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: m.SkipTLSVerify}}
+ m.Client.HttpClient.Transport = &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: m.SkipTLSVerify}, Proxy: http.ProxyFromEnvironment}
m.Client.HttpClient.Timeout = time.Second * 10
for { | Add support for HTTP{S}_PROXY env variables (#<I>) | 42wim_matterbridge | train | go |
f141db9fb648413c0518dd2ab0c0a8c363f42b51 | diff --git a/firebirdsql/tests/test_services.py b/firebirdsql/tests/test_services.py
index <HASH>..<HASH> 100755
--- a/firebirdsql/tests/test_services.py
+++ b/firebirdsql/tests/test_services.py
@@ -40,6 +40,7 @@ class TestServices(TestBase):
svc.close()
+ @unittest.skip("Fail by OperationalError in Ubuntu12.04")
def test_reapir(self):
svc = firebirdsql.services.connect(
host=self.host, | skip Service.repair() test because fail in Ubuntu<I>. I don't know why | nakagami_pyfirebirdsql | train | py |
da026a22d76c3462f1853a4a6b81d301b5e73c4a | diff --git a/neurosynth/tests/test_base.py b/neurosynth/tests/test_base.py
index <HASH>..<HASH> 100644
--- a/neurosynth/tests/test_base.py
+++ b/neurosynth/tests/test_base.py
@@ -179,10 +179,8 @@ class TestBase(unittest.TestCase):
def test_get_features_by_ids(self):
dataset = self.dataset
- ids = dataset.get_ids_by_mask(
- get_test_data_path() + 'sgacc_mask.nii.gz')
- features = dataset.feature_table.get_features_by_ids(ids)
- self.assertEquals(features.shape, (3,))
+ features = dataset.feature_table.get_features_by_ids(['study1','study3'])
+ self.assertEquals(len(features), 5)
suite = unittest.TestLoader().loadTestsFromTestCase(TestBase) | removed mask test within test_get_features_by_ids | neurosynth_neurosynth | train | py |
da1bf0e82a32d2dae512d4bdcf8a6913b2e02841 | diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php
index <HASH>..<HASH> 100644
--- a/lib/db/upgrade.php
+++ b/lib/db/upgrade.php
@@ -6483,7 +6483,7 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
if ($oldversion < 2011060500) {
- // Define index uniqueuserrating (not unique) to be dropped form rating
+ // Define index uniqueuserrating (not unique) to be dropped from rating
$table = new xmldb_table('rating');
$index = new xmldb_index('uniqueuserrating', XMLDB_INDEX_NOTUNIQUE,
array('component', 'ratingarea', 'contextid', 'itemid')); | MDL-<I> Fixed up typo in upgrade comments | moodle_moodle | train | php |
269f64b350e2172b8a16e2a3d559e390d5861051 | diff --git a/src/com/websockets/account.js b/src/com/websockets/account.js
index <HASH>..<HASH> 100644
--- a/src/com/websockets/account.js
+++ b/src/com/websockets/account.js
@@ -253,7 +253,7 @@ let subscribeMosaics = function(connector, callback, address) {
// Use address if provided
let _address = undefined !== address ? address.replace(/-/g, "").toUpperCase() : self.address;
self.stompClient.subscribe('/account/mosaic/owned/' + _address, function(data) {
- callback(JSON.parse(data.body));
+ callback(JSON.parse(data.body), _address);
});
}
@@ -274,7 +274,7 @@ let subscribeNamespaces = function(connector, callback, address) {
// Use address if provided
let _address = undefined !== address ? address.replace(/-/g, "").toUpperCase() : self.address;
self.stompClient.subscribe('/account/namespace/owned/' + _address, function(data) {
- callback(JSON.parse(data.body));
+ callback(JSON.parse(data.body), _address);
});
}
@@ -307,6 +307,4 @@ module.exports = {
owned: subscribeNamespaces
}
}
-}
-
-// End region
\ No newline at end of file
+}
\ No newline at end of file | Return address in mosaics and namespaces subscription callback | QuantumMechanics_NEM-sdk | train | js |
092f242319d9fa7d94e312e522fe6f5f86ad69c7 | diff --git a/snapcast/control/protocol.py b/snapcast/control/protocol.py
index <HASH>..<HASH> 100644
--- a/snapcast/control/protocol.py
+++ b/snapcast/control/protocol.py
@@ -25,6 +25,7 @@ class SnapcastProtocol(asyncio.Protocol):
self._transport = None
self._buffer = {}
self._callbacks = callbacks
+ self._data_buffer = ''
def connection_made(self, transport):
"""When a connection is made."""
@@ -36,7 +37,12 @@ class SnapcastProtocol(asyncio.Protocol):
def data_received(self, data):
"""Handle received data."""
- for cmd in data.decode().strip().split('\r\n'):
+ self._data_buffer += data.decode()
+ if not self._data_buffer.endswith('\r\n'):
+ return
+ data = self._data_buffer
+ self._data_buffer = '' # clear buffer
+ for cmd in data.strip().split('\r\n'):
data = json.loads(cmd)
if not isinstance(data, list):
data = [data] | Buffering data received from Snapserver until it ends in a line break (\r\n). | happyleavesaoc_python-snapcast | train | py |
4941e94e7906ae719931806ceac0922a0e8ad992 | diff --git a/lib/diarize/speaker.rb b/lib/diarize/speaker.rb
index <HASH>..<HASH> 100644
--- a/lib/diarize/speaker.rb
+++ b/lib/diarize/speaker.rb
@@ -18,17 +18,14 @@ module Diarize
attr_reader :gender
def initialize(uri = nil, gender = nil, model_file = nil)
- unless uri and gender
- unless model_file
- # A generic speaker, associated with a universal background model
- @model = Speaker.load_model(File.join(File.expand_path(File.dirname(__FILE__)), 'ubm.gmm'))
- else
- @model = Speaker.load_model(model_file)
- end
+ unless model_file
+ # A generic speaker, associated with a universal background model
+ @model = Speaker.load_model(File.join(File.expand_path(File.dirname(__FILE__)), 'ubm.gmm'))
else
- @uri = uri
- @gender = gender
+ @model = Speaker.load_model(model_file)
end
+ @uri = uri
+ @gender = gender
end
def mean_log_likelihood | Always preload a new speaker model with a generic UBM | bbc_diarize-jruby | train | rb |
117eaf5966c4d7447fc3fc4fa641619751e1013f | diff --git a/tests/parser/types/numbers/test_sqrt.py b/tests/parser/types/numbers/test_sqrt.py
index <HASH>..<HASH> 100644
--- a/tests/parser/types/numbers/test_sqrt.py
+++ b/tests/parser/types/numbers/test_sqrt.py
@@ -80,12 +80,12 @@ def test_sqrt_inline_memory_correct(get_contract_with_gas_estimation):
code = """
@public
def test(a: decimal) -> (decimal, decimal, decimal, decimal, decimal, string[100]):
- b: decimal = 1.0
- c: decimal = 2.0
- d: decimal = 3.0
+ x: decimal = 1.0
+ y: decimal = 2.0
+ z: decimal = 3.0
e: decimal = sqrt(a)
f: string[100] = 'hello world'
- return a, b, c, d, e, f
+ return a, x, y, z, e, f
"""
c = get_contract_with_gas_estimation(code) | Renamed to x, y, z. | ethereum_vyper | train | py |
0d80eca0f0e535df5889e0c61ac07d297aafc59b | diff --git a/config/constants.go b/config/constants.go
index <HASH>..<HASH> 100644
--- a/config/constants.go
+++ b/config/constants.go
@@ -84,7 +84,7 @@ func setupTestConstants() {
func setupTravisTestConstants() {
Constants.DbHost = "127.0.0.1"
- Constants.DbDatabase = "tf2stadium"
- Constants.DbUsername = "travis_ci_test"
+ Constants.DbDatabase = "TESTtf2stadium"
+ Constants.DbUsername = "postgres"
Constants.DbPassword = ""
} | Fix: Travis CI DB Settings | TF2Stadium_Helen | train | go |
84b309b8d44e413c8ce2ed3cce63275fc42f363a | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -14,7 +14,7 @@ long_description = codecs.open("README.md", "r", "utf-8").read()
setup(
name="docx2html",
- version="0.0.1",
+ version="0.0.2",
description="docx (OOXML) to html converter",
author="Jason Ward",
author_email="jason.louard.ward@gmail.com", | bumped to version <I> | PolicyStat_docx2html | train | py |
4d6bce910c44958636ebce254c18e7f298d9ddee | diff --git a/lib/pool.js b/lib/pool.js
index <HASH>..<HASH> 100644
--- a/lib/pool.js
+++ b/lib/pool.js
@@ -2,6 +2,13 @@ var Connection = require('./connection'),
util = require('util');
/**
+ * A No-Operation default for empty callbacks
+ * @private
+ * @memberOf Pool
+ */
+var NOOP = function(){};
+
+/**
* Creates a connection to a keyspace for each of the servers in the pool;
* @param {Object} options The options for the connection
@@ -94,6 +101,30 @@ Pool.prototype.connect = function(callback){
};
/**
+ * Changes the current keyspace for the connection
+ */
+Pool.prototype.use = function(keyspace, callback){
+ callback = callback || NOOP;
+
+ var self = this, i = 0, len = this.clients.length,
+ finished = 0, error, ks;
+
+ function onUse(err, keyspace){
+ finished += 1;
+ error = err;
+ ks = keyspace;
+
+ if(finished === len){
+ callback(error, ks);
+ }
+ }
+
+ for(; i < len; i += 1){
+ this.clients[i].use(keyspace, onUse);
+ }
+};
+
+/**
* Executes a command on a single client from the pool
* @param {String} command The command to execute
* additional params are supplied to the command to be executed | added 'use' to conneciton pool object | lyveminds_scamandrios | train | js |
220e1a21e7bbb831d06551c72799dfedc1db979f | diff --git a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java
+++ b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java
@@ -833,7 +833,7 @@ public abstract class NanoHTTPD {
String boundaryStartString = "boundary=";
int boundaryContentStart = contentTypeHeader.indexOf(boundaryStartString) + boundaryStartString.length();
String boundary = contentTypeHeader.substring(boundaryContentStart, contentTypeHeader.length());
- if (boundary.startsWith("\"") && boundary.startsWith("\"")) {
+ if (boundary.startsWith("\"") && boundary.endsWith("\"")) {
boundary = boundary.substring(1, boundary.length() - 1);
} | Fixed code issue - repeating 'startsWith' when it meant to have a startsWith and an endsWith. Closes issue #<I>. @psh | NanoHttpd_nanohttpd | train | java |
3d45b4247b8e40adede8b87ff1b85b6dfcbd040d | diff --git a/xhtml2pdf/context.py b/xhtml2pdf/context.py
index <HASH>..<HASH> 100644
--- a/xhtml2pdf/context.py
+++ b/xhtml2pdf/context.py
@@ -182,6 +182,8 @@ class pisaCSSBuilder(css.CSSBuilder):
c = self.c
if not name:
name = "-pdf-frame-%d" % c.UID()
+ if data.get('is_landscape', False):
+ size = (size[1], size[0])
x, y, w, h = getFrameDimensions(data, size[0], size[1])
# print name, x, y, w, h
#if not (w and h): | Fix headers/footers in landscape mode.
Now you need to set a "is_landscape:1" line in your header and footer CSS in addition
to "size:a4 landscape" in the @page frame. | xhtml2pdf_xhtml2pdf | train | py |
da04b6feb282ba491408e779d1dd67fa8703471b | diff --git a/src/Whoops/Util/SystemFacade.php b/src/Whoops/Util/SystemFacade.php
index <HASH>..<HASH> 100644
--- a/src/Whoops/Util/SystemFacade.php
+++ b/src/Whoops/Util/SystemFacade.php
@@ -124,22 +124,7 @@ class SystemFacade
*/
public function setHttpResponseCode($httpCode)
{
- if (function_exists('http_response_code')) {
- return http_response_code($httpCode);
- }
-
- // http_response_code is added in 5.4.
- // For compatibility with 5.3 we use the third argument in header call
- // First argument must be a real header.
- // If it is empty, PHP will ignore the third argument.
- // If it is invalid, such as a single space, Apache will handle it well,
- // but the PHP development server will hang.
- // Setting a full status line would require us to hardcode
- // string values for all different status code, and detect the protocol.
- // which is an extra error-prone complexity.
- header('X-Ignore-This: 1', true, $httpCode);
-
- return $httpCode;
+ return http_response_code($httpCode);
}
/** | Remove http_response_code workaround for PHP <I> | filp_whoops | train | php |
9758d5fccc2857f211eef984bb46578f81176b13 | diff --git a/src/Money.php b/src/Money.php
index <HASH>..<HASH> 100644
--- a/src/Money.php
+++ b/src/Money.php
@@ -15,7 +15,6 @@ use function array_sum;
use function count;
use function filter_var;
use function floor;
-use function is_int;
use function max;
use const FILTER_VALIDATE_INT;
@@ -74,22 +73,18 @@ final class Money implements JsonSerializable
{
$this->currency = $currency;
- if (is_int($amount)) {
- $this->amount = (string) $amount;
-
- return;
- }
-
if (filter_var($amount, FILTER_VALIDATE_INT) === false) {
$numberFromString = Number::fromString($amount);
if (! $numberFromString->isInteger()) {
throw new InvalidArgumentException('Amount must be an integer(ish) value');
}
- $amount = $numberFromString->getIntegerPart();
+ $this->amount = $numberFromString->getIntegerPart();
+
+ return;
}
- $this->amount = $amount;
+ $this->amount = (string) $amount;
}
/** | Removed `is_int()` check on `$amount` passed to `Money` constructor
This check was mostly detrimental to performance, and didn't bring in much.
Ref: <URL> | moneyphp_money | train | php |
25f9ef647688ad16bf336e9584432fbe2eefc7e1 | diff --git a/assertpy/assertpy.py b/assertpy/assertpy.py
index <HASH>..<HASH> 100644
--- a/assertpy/assertpy.py
+++ b/assertpy/assertpy.py
@@ -485,10 +485,9 @@ class AssertionBuilder(object):
elif isinstance(self.val, collections.Iterable):
if len(self.val) == 0:
raise ValueError('val must not be empty')
- for i in self.val:
- if i != prefix:
- self._err('Expected %s to start with <%s>, but did not.' % (self.val, prefix))
- break
+ first = next(i for i in self.val)
+ if first != prefix:
+ self._err('Expected %s to start with <%s>, but did not.' % (self.val, prefix))
else:
raise TypeError('val is not a string or iterable')
return self | use next() built-in to get first item of iterable | ActivisionGameScience_assertpy | train | py |
733e4e7edfe9842f70cabc24912823305c3420cb | diff --git a/src/libs/eventhandler.js b/src/libs/eventhandler.js
index <HASH>..<HASH> 100644
--- a/src/libs/eventhandler.js
+++ b/src/libs/eventhandler.js
@@ -50,7 +50,9 @@ export default class Eventhandler {
}
// bind bindObject
- Eventhandler.bindObjectToEventList(config.events, config.bind);
+ if(config.bind){
+ Eventhandler.bindObjectToEventList(config.events, config.bind);
+ }
// group events
let groupedEvents = Eventhandler.groupEvents(config.events);
// Merge passed config | Improvement:
- bind config object to eventlist if exists | SerkanSipahi_app-decorators | train | js |
93608a3424e79349bd7a0ba414a644006e610e67 | diff --git a/src/b00_breeze.ajax.angular.js b/src/b00_breeze.ajax.angular.js
index <HASH>..<HASH> 100644
--- a/src/b00_breeze.ajax.angular.js
+++ b/src/b00_breeze.ajax.angular.js
@@ -109,6 +109,7 @@
config: config,
data: data,
getHeaders: headers,
+ ngConfig: xconfig,
status: status,
statusText: statusText
};
@@ -125,6 +126,7 @@
config: config,
data: data,
getHeaders: headers,
+ ngConfig: xconfig,
status: status,
statusText: statusText
}; | Allow access to angular config via httpResponse object
Angular $httpInterceptors can be used for timing requests, or sequencing requests by adding information to the config programatically. Breeze should allow access to this information through its httpResponse object. | Breeze_breeze.js | train | js |
99eb51d9e49e1bb5496a4370997ff506cf4e143d | diff --git a/mod/forum/subscribe.php b/mod/forum/subscribe.php
index <HASH>..<HASH> 100644
--- a/mod/forum/subscribe.php
+++ b/mod/forum/subscribe.php
@@ -32,7 +32,7 @@ $user = optional_param('user',0,PARAM_INT);
$url = new moodle_url('/mod/forum/subscribe.php', array('id'=>$id));
if ($mode !== '') {
- $url->param('force', $mode);
+ $url->param('mode', $mode);
}
if ($user !== 0) {
$url->param('user', $user); | MDL-<I> forum: fixed PAGE url param set
I am pretty sure Sam overlooked this is in the commit afef<I>e | moodle_moodle | train | php |
52ce1a74c28d3d909ccb577a681d47cef0d0a55b | diff --git a/src/Foundation/App.php b/src/Foundation/App.php
index <HASH>..<HASH> 100644
--- a/src/Foundation/App.php
+++ b/src/Foundation/App.php
@@ -64,7 +64,7 @@ class App
) : ResponseInterface {
$this->run();
$psr7Response = new Psr7Response;
- $response = $psr7Response($response, $this->response);
+ $response = $psr7Response($response, $this->response->getResponse());
if ($next !== null) {
$response = $next($request, $response);
} | fixed get dependecy as an array issue | selamiphp_foundation | train | php |
86e1df65576b2e201cbeb48460c54be959ca0f70 | diff --git a/cmd/veneur-emit/main.go b/cmd/veneur-emit/main.go
index <HASH>..<HASH> 100644
--- a/cmd/veneur-emit/main.go
+++ b/cmd/veneur-emit/main.go
@@ -213,8 +213,8 @@ func timeCommand(client MinimalClient, passedFlags map[string]flag.Value) error
myTags = make([]string, 0)
}
logrus.Debugf("%s took %s", command, elapsed)
- client.Timing(passedFlags["name"].String(), elapsed, myTags, 1)
- return nil
+ err := client.Timing(passedFlags["name"].String(), elapsed, myTags, 1)
+ return err
}
func bareMetric(name string, tags string) *ssf.SSFSample { | Error handling for timeCommand | stripe_veneur | train | go |
bc441274c9c15de7227bd1f24b7f90aade8f7de0 | diff --git a/chef/spec/unit/provider/package/yum_spec.rb b/chef/spec/unit/provider/package/yum_spec.rb
index <HASH>..<HASH> 100644
--- a/chef/spec/unit/provider/package/yum_spec.rb
+++ b/chef/spec/unit/provider/package/yum_spec.rb
@@ -142,9 +142,16 @@ describe Chef::Provider::Package::Yum, "upgrade_package" do
@provider.current_resource = @current_resource
end
- it "should run yum update if the package is installed" do
+ it "should run yum update if the package is installed and no version is given" do
@provider.should_receive(:run_command_with_systems_locale).with({
- :command => "yum -d0 -e0 -y update emacs-11"
+ :command => "yum -d0 -e0 -y update emacs"
+ })
+ @provider.upgrade_package(@new_resource.name, nil)
+ end
+
+ it "should run yum install if the package is installed and a version is given" do
+ @provider.should_receive(:run_command_with_systems_locale).with({
+ :command => "yum -d0 -e0 -y install emacs-11"
})
@provider.upgrade_package(@new_resource.name, @provider.candidate_version)
end | add failing tests for CHEF-<I> | chef_chef | train | rb |
41def51e5479ff02eb185795d4a18dcb4545115d | diff --git a/lib/jss/api_object/group.rb b/lib/jss/api_object/group.rb
index <HASH>..<HASH> 100644
--- a/lib/jss/api_object/group.rb
+++ b/lib/jss/api_object/group.rb
@@ -279,7 +279,7 @@ module JSS
def remove_member(m)
raise InvalidDataError, "Smart group members can't be changed." if @is_smart
- if @members.reject!{ |mm| [mm[:id], mm[:name]].include? m }
+ if @members.reject!{ |mm| [mm[:id], mm[:name], mm[:username]].include? m }
@need_to_update = true
else
raise JSS::NoSuchItemError, "No member matches '#{m}'" | User Group members have :username, not :name | PixarAnimationStudios_ruby-jss | train | rb |
e8c5766e1c29458bd8af9457242171e1e7f8eea5 | diff --git a/src/main/com/mongodb/ServerDescription.java b/src/main/com/mongodb/ServerDescription.java
index <HASH>..<HASH> 100644
--- a/src/main/com/mongodb/ServerDescription.java
+++ b/src/main/com/mongodb/ServerDescription.java
@@ -43,7 +43,7 @@ import static org.bson.util.Assertions.notNull;
class ServerDescription {
static final int MIN_DRIVER_WIRE_VERSION = 0;
- static final int MAX_DRIVER_WIRE_VERSION = 2;
+ static final int MAX_DRIVER_WIRE_VERSION = 3;
private static final int DEFAULT_MAX_DOCUMENT_SIZE = 0x1000000; // 16MB
private static final int DEFAULT_MAX_MESSAGE_SIZE = 0x2000000; // 32MB | Bumped maxWireVersion that the driver supports to 3, which will be the maxWireVersion for server release <I>
JAVA-<I> | mongodb_mongo-java-driver | train | java |
4625b0cccef6ca40c73d59bccce1e74f7e685a21 | diff --git a/repos/index.js b/repos/index.js
index <HASH>..<HASH> 100644
--- a/repos/index.js
+++ b/repos/index.js
@@ -175,11 +175,12 @@ fs.exists(config.outfile, function(exists) {
});
} else {
console.log('Fetching public repos feed...');
- request('http://webuild.sg/repos.json', function(err, res, body) {
+ request('http://webuild.sg/api/repos', function(err, res, body) {
if (!err && res.statusCode === 200) {
- exports.feed = body;
- jf.writeFile(config.outfile, body);
- console.log('Saved %d repos to cache', body.repos.length);
+ var data = JSON.parse(body);
+ exports.feed = data;
+ jf.writeFile(config.outfile, data);
+ console.log('Saved %d repos to cache', data.repos.length);
} else {
if (res) {
console.warn('Failed to retrieve data (Status code: %s)', res.statusCode); | Request github repos from the correct URL | webuildorg_webuild-repos | train | js |
bccc3d43506b30889b9142236163eca01a6b2c71 | diff --git a/src/test/java/com/github/jreddit/entity/UserTest.java b/src/test/java/com/github/jreddit/entity/UserTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/com/github/jreddit/entity/UserTest.java
+++ b/src/test/java/com/github/jreddit/entity/UserTest.java
@@ -1,6 +1,5 @@
package com.github.jreddit.entity;
-import static com.github.jreddit.testsupport.JsonHelpers.createSubreddit;
import static com.github.jreddit.testsupport.JsonHelpers.redditListing;
import static com.github.jreddit.testsupport.JsonHelpers.userLoginResponse;
import static org.junit.Assert.assertEquals;
@@ -9,7 +8,6 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import com.github.jreddit.testsupport.JsonHelpers;
-import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.junit.Before;
import org.junit.Test; | Removed superfluous imports. | jReddit_jReddit | train | java |
9872fcc7bd0aaeb927215c00f1940974350ae804 | diff --git a/core/polyaxon/polyplot/run_plot.py b/core/polyaxon/polyplot/run_plot.py
index <HASH>..<HASH> 100644
--- a/core/polyaxon/polyplot/run_plot.py
+++ b/core/polyaxon/polyplot/run_plot.py
@@ -135,3 +135,29 @@ class MultiRunPlot(RunClient):
self.run_uuids.add(r.uuid)
self.runs[r.uuid] = r
return self.runs
+
+ def get_run_io(
+ self, query: str = None, sort: str = None, limit: int = None, offset: int = None
+ ):
+ runs = self.get_runs(query=query, sort=sort, limit=limit, offset=offset)
+ data = []
+ for r in runs:
+ values = r.inputs or {}
+ values.update(r.outputs or {})
+ data.append({'uid': r.uuid, 'values': values})
+ return data
+
+ @check_no_op
+ def gey_hiplot(
+ self, query: str = None, sort: str = None, limit: int = None, offset: int = None
+ ):
+ import hiplot
+
+ data = self.get_run_io(query=query, sort=sort, limit=limit, offset=offset)
+ exp = hiplot.Experiment()
+ for d in data:
+ dp = hiplot.Datapoint(
+ uid=data["uid"], values=data["values"],
+ )
+ exp.datapoints.append(dp)
+ return exp | Update runplot client with hiplot | polyaxon_polyaxon | train | py |
2ac98e9b346ce0a6149126bd0450221b962bbf7b | diff --git a/css.js b/css.js
index <HASH>..<HASH> 100644
--- a/css.js
+++ b/css.js
@@ -11,9 +11,7 @@ function getExistingAsset(load){
}
var isNode = typeof process === "object" &&
- {}.toString.call(process) === "[object process]" &&
- // NW.js
- !(function(){try{var nr = loader._nodeRequire; return nr && nr('nw.gui') !== 'undefined';}catch(e){return false;}})();
+ {}.toString.call(process) === "[object process]";
if(loader.env === 'production') {
exports.fetch = function(load) { | Remove node webkit detection
This is causing errors when loading production builds meant for the web
in production. | donejs_css | train | js |
1551b79913bcb4c68290106be8e30cad463e1f44 | diff --git a/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb b/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb
+++ b/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb
@@ -345,7 +345,9 @@ module ActiveRecord
quote_date_with_to_date(value)
when :string
# NCHAR and NVARCHAR2 literals should be quoted with N'...'
- column.nchar ? 'N' << super : super
+ # read directly instance variable as otherwise migrations with table column default values are failing
+ # with pass ColumnDefinition object to this method
+ column.instance_variable_get('@nchar') ? 'N' << super : super
else
super
end | fixed nchar quoting to work also when used from migrations with default column values | rsim_oracle-enhanced | train | rb |
52ac9cc98a44664c5c05277b617140de920025cd | diff --git a/Command/ImportCommand.php b/Command/ImportCommand.php
index <HASH>..<HASH> 100644
--- a/Command/ImportCommand.php
+++ b/Command/ImportCommand.php
@@ -114,7 +114,7 @@ class ImportCommand extends AbstractCommand
'no-cache',
null,
InputOption::VALUE_NONE,
- 'Do not clear cache after config data import.',
+ 'Do not clear cache after config data import.'
);
parent::configure(); | [BUGFIX] Remove trailing comma for PHP<I> compatibility | semaio_Magento2-ConfigImportExport | train | php |
b1fec0a9a2614d75d58c5fd2a63a5a329c1c4341 | diff --git a/contrib/externs/jasmine-2.0.js b/contrib/externs/jasmine-2.0.js
index <HASH>..<HASH> 100644
--- a/contrib/externs/jasmine-2.0.js
+++ b/contrib/externs/jasmine-2.0.js
@@ -382,7 +382,7 @@ function describe(description, handler) {}
* @param {string} description
* @param {function(this:jasmine.Suite)} handler
*/
-function ddescribe(description, handler) {}
+function fdescribe(description, handler) {}
/**
@@ -403,7 +403,7 @@ function it(description, handler) {}
* @param {string} description
* @param {function(this:jasmine.Spec, function()=)} handler
*/
-function iit(description, handler) {}
+function fit(description, handler) {}
/** | Replace iit with fit and ddescribe with fdescribe since Jasmine 2 no longer supports iit and ddescribe. <URL> | google_closure-compiler | train | js |
6c96dabb8c72c0101fb4e347115dbcbc17c848f7 | diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/properties/StepRegistryPropertiesConfigAdapter.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/properties/StepRegistryPropertiesConfigAdapter.java
index <HASH>..<HASH> 100644
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/properties/StepRegistryPropertiesConfigAdapter.java
+++ b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/properties/StepRegistryPropertiesConfigAdapter.java
@@ -65,6 +65,7 @@ public abstract class StepRegistryPropertiesConfigAdapter<T extends StepRegistry
return get(T::getReadTimeout, StepRegistryConfig.super::readTimeout);
}
+ @SuppressWarnings("deprecation")
@Override
public int numThreads() {
return get(T::getNumThreads, StepRegistryConfig.super::numThreads); | Suppress warnings for PushRegistryConfig.numThreads() (#<I>) | micrometer-metrics_micrometer | train | java |
2293ffae5d38765c8972ad9085f4874ed9a09df7 | diff --git a/example/mathn.rb b/example/mathn.rb
index <HASH>..<HASH> 100644
--- a/example/mathn.rb
+++ b/example/mathn.rb
@@ -38,7 +38,10 @@ attempt_parse
puts 'it terminates before we require mathn'
puts "requiring mathn now"
-require 'mathn'
+# mathn was deprecated as of Ruby 2.5
+if RUBY_VERSION.gsub(/[^\d]/, '').to_i < 250
+ require 'mathn'
+end
puts "and trying again (will hang without the fix)"
attempt_parse # but it doesn't terminate after requiring mathn
-puts "okay!"
\ No newline at end of file
+puts "okay!" | check for ruby version in mathn example
math was deprecated as of Ruby <I>, so `require 'mathn'` fails.
Fixes <URL> | kschiess_parslet | train | rb |
e48837a1a2afefd23fed58f371d69137131a99d4 | diff --git a/addon/components/nypr-brick-item.js b/addon/components/nypr-brick-item.js
index <HASH>..<HASH> 100644
--- a/addon/components/nypr-brick-item.js
+++ b/addon/components/nypr-brick-item.js
@@ -11,10 +11,13 @@ export default Component.extend({
classNameBindings: ['item.attributes.template'],
attributeBindings: ['style'],
- style: computed('backgroundImage', function() {
- return htmlSafe(`background-image: ${get(this, 'backgroundImage')}`);
- }),
+ style: computed.reads('backgroundImage'),
pk: reads('item.id'),
vertical: equal('template', 'vertical'),
- backgroundImage: computed.reads('item.attributes.imageMain.url')
+ backgroundImage: computed('item.attributes.imageMain.url', function() {
+ let backgroundImage = get(this, 'item.attributes.imageMain.url');
+ if (backgroundImage) {
+ return htmlSafe(`background-image: url(${backgroundImage});`);
+ }
+ })
}); | return backgrounImage as html safe
so it can be used as-is in the template on other elements | nypublicradio_nypr-ui | train | js |
7fe3c098b707f3265dd00d031ff573c877fb3efe | diff --git a/quart/routing.py b/quart/routing.py
index <HASH>..<HASH> 100644
--- a/quart/routing.py
+++ b/quart/routing.py
@@ -233,7 +233,7 @@ class MapAdapter:
method: Optional[str]=None,
scheme: Optional[str]=None,
external: bool=False,
- )-> str:
+ ) -> str:
values = values or {}
rules = self.map.endpoints[endpoint]
for rule in rules: | Fix a minor pep8 issue
New flake8 version. | pgjones_quart | train | py |
1006867eb346486bc8cfcca2c831b868ec4a735d | diff --git a/example/xmp.py b/example/xmp.py
index <HASH>..<HASH> 100644
--- a/example/xmp.py
+++ b/example/xmp.py
@@ -7,6 +7,8 @@
# See the file COPYING.
#
+from __future__ import print_function
+
import os, sys
from errno import *
from stat import * | Make xmp.py work on Python 2 again. | libfuse_python-fuse | train | py |
d12107770ba022ba12c5833e5cce84cc8467fbf2 | diff --git a/src/frame.js b/src/frame.js
index <HASH>..<HASH> 100644
--- a/src/frame.js
+++ b/src/frame.js
@@ -25,12 +25,15 @@ module.exports = (function () {
this.positionCamera();
- var mouse = this.mouse = { x: 1, y: 1 };
+ this.mouse = {x: 0, y: 0};
+ var self = this;
document.addEventListener('mousemove', function (evt) {
evt.preventDefault();
- mouse.x = (evt.clientX / window.innerWidth) * 2 - 1;
- mouse.y = 1 - (evt.clientY / window.innerHeight) * 2;
+ self.mouse.x = (evt.clientX / window.innerWidth) * 2 - 1;
+ self.mouse.y = 1 - (evt.clientY / window.innerHeight) * 2;
+
+ self._handleClicks();
}, false);
this._animate(); | Handle mouse clicks/hover on every mouse move | frewsxcv_graphosaurus | train | js |
1b94b6a6181dfd22bf9837010c0d4ed6f358686e | diff --git a/src/animation/requestAnimationFrame.js b/src/animation/requestAnimationFrame.js
index <HASH>..<HASH> 100644
--- a/src/animation/requestAnimationFrame.js
+++ b/src/animation/requestAnimationFrame.js
@@ -1,11 +1,13 @@
define(function(require) {
return (typeof window !== 'undefined' &&
- (window.requestAnimationFrame
- || window.msRequestAnimationFrame
- || window.mozRequestAnimationFrame
- || window.webkitRequestAnimationFrame))
- || function (func) {
- setTimeout(func, 16);
- };
+ ((window.requestAnimationFrame && window.requestAnimationFrame.bind(window))
+ // https://github.com/ecomfe/zrender/issues/189#issuecomment-224919809
+ || (window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window))
+ || window.mozRequestAnimationFrame
+ || window.webkitRequestAnimationFrame)
+ )
+ || function (func) {
+ setTimeout(func, 16);
+ };
}); | Fix requestAnimationFrame lost context in eval. #<I> | ecomfe_zrender | train | js |
de53fdf9d1d99ce19c382db73e5be9e3220cef55 | diff --git a/src/assessments/readability/sentenceLengthInDescriptionAssessment.js b/src/assessments/readability/sentenceLengthInDescriptionAssessment.js
index <HASH>..<HASH> 100644
--- a/src/assessments/readability/sentenceLengthInDescriptionAssessment.js
+++ b/src/assessments/readability/sentenceLengthInDescriptionAssessment.js
@@ -85,7 +85,7 @@ var sentenceLengthInDescriptionAssessment = function( paper, researcher, i18n )
*
* @param {Object} paper The paper to check.
*
- * @returns {boolean} Returns true if the language is available and the paper is not empty.
+ * @returns {boolean} Returns true if the paper has a meta description.
*/
const isApplicable = function( paper ) {
return paper.hasDescription(); | Update src/assessments/readability/sentenceLengthInDescriptionAssessment.js | Yoast_YoastSEO.js | train | js |
1147e31397179615add9affd0f55b21953d360ab | diff --git a/src/AlgorithmMMFlow.php b/src/AlgorithmMMFlow.php
index <HASH>..<HASH> 100644
--- a/src/AlgorithmMMFlow.php
+++ b/src/AlgorithmMMFlow.php
@@ -46,21 +46,15 @@ class AlgorithmMMFlow extends AlgorithmMM {
$vertex->setLayout('label', null);
}
-
-
-
- return $resultGraph;
- }
-
-
- public function createGraphMatchingOnly() {
-
- $resultGraph = $this->createGraph();
// Remove non matchings
foreach($resultGraph->getEdges() as $edge){
if($edge->getFlow() == 0) {
$edge->destroy();
+ } else {
+ $edgeOriginal = $this->graph->getEdgeClone($edge);
+ $edge->setCapacity($edgeOriginal->getCapacity());
+ $edge->setFlow($edgeOriginal->getFlow());
}
} | copy original edge attributes to cloned edges | graphp_algorithms | train | php |
6734448462b79977ef0d0fa1391c716ad63bee6c | diff --git a/octodns/provider/azuredns.py b/octodns/provider/azuredns.py
index <HASH>..<HASH> 100644
--- a/octodns/provider/azuredns.py
+++ b/octodns/provider/azuredns.py
@@ -632,6 +632,10 @@ class AzureProvider(BaseProvider):
else:
# dynamic record alias is broken, return dummy value and apply
# will likely overwrite/fix it
+ self.log.warn('_data_for_CNAME: Missing Traffic Manager '
+ 'alias for dynamic CNAME record %s, forcing '
+ 're-link by setting an invalid value',
+ azrecord.fqdn)
return {'value': 'iam.invalid.'}
return {'value': _check_endswith_dot(azrecord.cname_record.cname)} | log warning when dynamic CNAME has broken alias | github_octodns | train | py |
c31cecd68713bc1dc73c578fe71813974d18b4f4 | diff --git a/openquake/commonlib/oqvalidation.py b/openquake/commonlib/oqvalidation.py
index <HASH>..<HASH> 100644
--- a/openquake/commonlib/oqvalidation.py
+++ b/openquake/commonlib/oqvalidation.py
@@ -295,11 +295,6 @@ class OqParam(valid.ParamSet):
risk_investigation_time / investigation_time / ses_per_logic_tree_path
"""
- if (self.calculation_mode == 'gmf_ebrisk' and
- self.ses_per_logic_tree_path != 1):
- logging.warn('ses_per_logic_tree_path=%d for a gmf_ebrisk '
- 'calculation?\ncheck %s',
- self.ses_per_logic_tree_path, self.inputs['job_ini'])
if self.investigation_time is None:
raise ValueError('Missing investigation_time in the .ini file')
return (self.risk_investigation_time or self.investigation_time) / ( | Removed unneded warning [skip hazardlib]
Former-commit-id: 3afad<I>b3acc<I>a<I>afebd<I>e3d | gem_oq-engine | train | py |
9f42f137066950343667bcfb5a11a47552ed9a11 | diff --git a/libkbfs/cr_chains.go b/libkbfs/cr_chains.go
index <HASH>..<HASH> 100644
--- a/libkbfs/cr_chains.go
+++ b/libkbfs/cr_chains.go
@@ -243,6 +243,11 @@ func (cc *crChain) identifyType(ctx context.Context, fbo *folderBlockOps,
parentOriginal, ok := chains.originals[parentDir]
if !ok {
+ if chains.isDeleted(parentDir) {
+ // If the parent's been deleted, it doesn't matter whether
+ // we find the type or not.
+ return nil
+ }
return NoChainFoundError{parentDir}
} | cr_chains: don't error when finding types if parent's been deleted
Issue: KBFS-<I> | keybase_client | train | go |
3fab2870b7cd3d2a9dde4dd2ebdf8ccb26b79aa2 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -339,7 +339,7 @@ function msgpack() {
, header
for (key in obj) {
- if (obj.hasOwnProperty(key)) {
+ if (obj.hasOwnProperty(key) && obj[key] !== undefined) {
++length
acc.push(encode(key))
acc.push(encode(obj[key]))
diff --git a/test/15-elements-maps.js b/test/15-elements-maps.js
index <HASH>..<HASH> 100644
--- a/test/15-elements-maps.js
+++ b/test/15-elements-maps.js
@@ -60,3 +60,13 @@ test('encode/decode maps up to 15 elements', function(t) {
t.end()
})
+
+test('do not encode undefined in a map', function(t) {
+ var instance = msgpack()
+ , expected = { hello: 'world' }
+ , toEncode = { a: undefined, hello: 'world' }
+ , buf = instance.encode(toEncode)
+
+ t.deepEqual(expected, instance.decode(buf), 'must ignore undefined')
+ t.end()
+}) | Do not encode keys with undefined values when encoding objects. | mcollina_msgpack5 | train | js,js |
1993e2ccbd7c5651278ea30bdc9d8034f5197945 | diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -599,7 +599,7 @@ module ActionDispatch
def initialize(named_route, options, recall, set)
@named_route = named_route
@options = options
- @recall = recall.dup
+ @recall = recall
@set = set
normalize_recall!
@@ -621,7 +621,7 @@ module ActionDispatch
def use_recall_for(key)
if @recall[key] && (!@options.key?(key) || @options[key] == @recall[key])
if !named_route_exists? || segment_keys.include?(key)
- @options[key] = @recall.delete(key)
+ @options[key] = @recall[key]
end
end
end | Avoid hash duplication by skipping mutation
If we don't mutate the `recall` hash, then there's no reason to duplicate it. While this change doesn't get rid of that many objects, each hash object it gets rid of was massive.
Saves <I> string objects per request, <I>,<I> bytes (thats <I> mb which is kinda a lot). | rails_rails | train | rb |
705c6dcb83887c4cc7e4f060f537e412e22a4dca | diff --git a/src/phpGPX/Parsers/TrackParser.php b/src/phpGPX/Parsers/TrackParser.php
index <HASH>..<HASH> 100644
--- a/src/phpGPX/Parsers/TrackParser.php
+++ b/src/phpGPX/Parsers/TrackParser.php
@@ -86,8 +86,9 @@ abstract class TrackParser
if (isset($pt->time))
{
-// $utc = new \DateTimeZone('UTC');
- $point->timestamp = new \DateTime($pt->time);
+ $utc = new \DateTimeZone('UTC');
+ $point->timestamp = new \DateTime($pt->time, $utc);
+ $point->timestamp->setTimezone(new \DateTimeZone(date_default_timezone_get()));
}
if (isset($pt->extensions))
diff --git a/tests/Tester.php b/tests/Tester.php
index <HASH>..<HASH> 100644
--- a/tests/Tester.php
+++ b/tests/Tester.php
@@ -15,7 +15,7 @@ $gpx->load('example.gpx');
foreach ($gpx->tracks as $track)
{
- printf("Avg pace: %f\n", $track->stats->averagePace);
+ $track->stats->startedAt->getOffset();
}
//$gpx->save('output.json', phpGPX::JSON_FORMAT);
\ No newline at end of file | Save timestamp in default server timezone and format is by config on summary | Sibyx_phpGPX | train | php,php |
dff2ded4d57c5092a0d5ae80775080e044f0f35b | diff --git a/scripts/subset.py b/scripts/subset.py
index <HASH>..<HASH> 100755
--- a/scripts/subset.py
+++ b/scripts/subset.py
@@ -119,7 +119,7 @@ def subset_font_raw(font_in, font_out, unicodes, opts):
if pe:
print('Generate("' + font_out + '")', file=pe)
pe.close()
- os.system("fontforge --quiet -script " + pe_fn)
+ os.system("fontforge -script " + pe_fn)
else:
font.generate(font_out, flags = flags)
font.close() | Removing --quiet from fontforge scripts for now | googlefonts_fontbakery | train | py |
92aafc1c1465bad4ae92f82ea119bdd0ac18cd42 | diff --git a/app/bootstrap.php b/app/bootstrap.php
index <HASH>..<HASH> 100644
--- a/app/bootstrap.php
+++ b/app/bootstrap.php
@@ -11,9 +11,9 @@ mb_http_output('UTF-8');
// We assume that if '/vendor/'. is in the path, it's installed via composer. Needs confirmation..
$installedViaComposer = (strpos("/vendor/", __DIR__) !== false);
-define('BOLT_COMPOSER_INSTALLED', $installedViaComposer);
+defined('BOLT_COMPOSER_INSTALLED') or define('BOLT_COMPOSER_INSTALLED', $installedViaComposer);
-if ($installedViaComposer) {
+if (BOLT_COMPOSER_INSTALLED) {
defined('BOLT_PROJECT_ROOT_DIR') or define('BOLT_PROJECT_ROOT_DIR', substr(__DIR__, 0, -21));
defined('BOLT_WEB_DIR') or define('BOLT_WEB_DIR', BOLT_PROJECT_ROOT_DIR . '/web');
defined('BOLT_CACHE_DIR') or define('BOLT_CACHE_DIR', BOLT_PROJECT_ROOT_DIR . '/cache'); | Let the developer define installed via composer
The latest changes broke my installation, mainly because it's not able to correctly identify if it was installed via composer. So this fix let the development define the constant before this script is triggered. | bolt_bolt | train | php |
9857524d5bbf874076f63c78993844be48e31d85 | diff --git a/externs/es3.js b/externs/es3.js
index <HASH>..<HASH> 100644
--- a/externs/es3.js
+++ b/externs/es3.js
@@ -798,11 +798,12 @@ Boolean.prototype.toString = function() {};
function Number(opt_value) {}
/**
+ * @param {number=} opt_fractionDigits
* @return {string}
* @nosideeffects
* @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number/toExponential
*/
-Number.prototype.toExponential = function() {};
+Number.prototype.toExponential = function(opt_fractionDigits) {};
/**
* @param {*=} opt_digits | toExponential has an optional digit parameter
Fixes issue <I>
Fixes issue <I>
R=acleung
DELTA=2 (1 added, 0 deleted, 1 changed)
Revision created by MOE tool push_codebase.
MOE_MIGRATION=<I>
git-svn-id: <URL> | google_closure-compiler | train | js |
59917c3d0cbbbf1bb33b262b704443d66eb6804c | diff --git a/djpaypal/admin.py b/djpaypal/admin.py
index <HASH>..<HASH> 100644
--- a/djpaypal/admin.py
+++ b/djpaypal/admin.py
@@ -25,8 +25,9 @@ class BillingAgreementAdmin(admin.ModelAdmin):
@admin.register(models.PreparedBillingAgreement)
class PreparedBillingAgreementAdmin(admin.ModelAdmin):
- list_display = ("__str__", "user", "livemode")
+ list_display = ("__str__", "user", "created", "updated", "livemode")
list_filter = ("livemode", )
+ readonly_fields = ("id", "created", "updated")
raw_id_fields = ("user", ) | Improve PreparedBillingAgreement admin | HearthSim_dj-paypal | train | py |
b1add21837e7f91017e41366ff8f05c156ba546f | diff --git a/anyconfig/processors.py b/anyconfig/processors.py
index <HASH>..<HASH> 100644
--- a/anyconfig/processors.py
+++ b/anyconfig/processors.py
@@ -98,9 +98,12 @@ def list_processors_by_ext(prs):
in anyconfig.utils.groupby(ps_by_ext, operator.itemgetter(0)))
-def list_types(prs):
+def list_types(tps):
"""List types that any processors can process them are available.
+
+ :param tps: A list (generator) of (processor_type, [processor_cls])
+ :return: [processor_type]
"""
- return sorted(set(next(anyconfig.compat.izip(*prs))))
+ return sorted(set(next(anyconfig.compat.izip(*tps))))
# vim:sw=4:ts=4:et: | refactor: make clear what the argument of .processors.list_type is | ssato_python-anyconfig | train | py |
402987804a65f3dc699ed109060eed8a1a787101 | diff --git a/lib/AmazonECS.class.php b/lib/AmazonECS.class.php
index <HASH>..<HASH> 100755
--- a/lib/AmazonECS.class.php
+++ b/lib/AmazonECS.class.php
@@ -453,6 +453,14 @@ class AmazonECS
return $this->returnType($type);
}
+ /**
+ * Setting the resultpage to a specified value.
+ * Allows to browse resultsets which have more than one page.
+ *
+ * @param integer $page
+ *
+ * @return AmazonECS
+ */
public function page($page)
{
if (false === is_numeric($page) || $page <= 0)
diff --git a/samples/sampleSimilarityLookup.php b/samples/sampleSimilarityLookup.php
index <HASH>..<HASH> 100644
--- a/samples/sampleSimilarityLookup.php
+++ b/samples/sampleSimilarityLookup.php
@@ -4,7 +4,6 @@ if ("cli" !== PHP_SAPI)
echo "<pre>";
}
-
if (is_file('sampleSettings.php'))
{
include 'sampleSettings.php'; | More doc and cleaned up example file | Exeu_Amazon-ECS-PHP-Library | train | php,php |
972a0af9423267076995ee8f586048f83996befd | diff --git a/src/main/java/com/buschmais/jqassistant/scm/maven/provider/ConfigurationProvider.java b/src/main/java/com/buschmais/jqassistant/scm/maven/provider/ConfigurationProvider.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/buschmais/jqassistant/scm/maven/provider/ConfigurationProvider.java
+++ b/src/main/java/com/buschmais/jqassistant/scm/maven/provider/ConfigurationProvider.java
@@ -34,10 +34,10 @@ public class ConfigurationProvider {
* Additional {@link ConfigSource}s.
* @return The {@link MavenConfiguration}.
*/
- public synchronized MavenConfiguration getConfiguration(File executionRoot, Optional<File> configurationDirectory, ConfigSource... configSources) {
+ public synchronized MavenConfiguration getConfiguration(File executionRoot, Optional<String> configurationDirectory, ConfigSource... configSources) {
if (configurationLoader == null) {
- File effectiveConfigurationDirectory = configurationDirectory.orElse(ConfigurationLoader.getDefaultConfigurationDirectory(executionRoot));
- configurationLoader = new ConfigurationLoaderImpl(effectiveConfigurationDirectory);
+ String effectiveConfigurationDirectory = configurationDirectory.orElse(ConfigurationLoader.DEFAULT_CONFIGURATION_DIRECTORY);
+ configurationLoader = new ConfigurationLoaderImpl(executionRoot, effectiveConfigurationDirectory);
}
return configurationLoader.load(MavenConfiguration.class, configSources);
} | added support for .jqassistant.yml and .jqassistant.yaml files in working directory | buschmais_jqa-maven-plugin | train | java |
4bfe8763a98b2788abb4f69de7dc65d303121001 | diff --git a/test/gir_ffi/builders/property_builder_test.rb b/test/gir_ffi/builders/property_builder_test.rb
index <HASH>..<HASH> 100644
--- a/test/gir_ffi/builders/property_builder_test.rb
+++ b/test/gir_ffi/builders/property_builder_test.rb
@@ -59,6 +59,10 @@ describe GirFFI::Builders::PropertyBuilder do
let(:property_info) { get_property_introspection_data("GIMarshallingTests",
"PropertiesObject",
"some-strv") }
+ before do
+ skip unless property_info
+ end
+
it "generates the correct getter definition" do
expected = <<-CODE.reset_indentation
def some_strv | Add skip guard for PropertiesObject's some-strv property | mvz_gir_ffi | train | rb |
251aa5290a83a0556536ca7c2fd1591cf8523494 | diff --git a/nodeconductor/structure/serializers.py b/nodeconductor/structure/serializers.py
index <HASH>..<HASH> 100644
--- a/nodeconductor/structure/serializers.py
+++ b/nodeconductor/structure/serializers.py
@@ -618,8 +618,9 @@ class UserSerializer(serializers.HyperlinkedModelSerializer):
return fields
def validate(self, attrs):
+ agree_with_policy = attrs.pop('agree_with_policy', False)
if self.instance and not self.instance.agreement_date:
- if not attrs.pop('agree_with_policy', False):
+ if not agree_with_policy:
raise serializers.ValidationError({'agree_with_policy': 'User must agree with the policy.'})
else:
attrs['agreement_date'] = timezone.now() | Remove agree_with_policy for existing user. | opennode_waldur-core | train | py |
ae9e200591cbbe5e41ea449f4bc9214bfdcd4a79 | diff --git a/js/jquery.mapael.js b/js/jquery.mapael.js
index <HASH>..<HASH> 100644
--- a/js/jquery.mapael.js
+++ b/js/jquery.mapael.js
@@ -503,14 +503,14 @@
}
// Panning
- $("body").on("mouseup." + pluginName + (zoomOptions.touch ? " touchend" : ""), function () {
+ $("body").on("mouseup." + pluginName + (zoomOptions.touch ? " touchend." + pluginName : ""), function () {
mousedown = false;
setTimeout(function () {
self.panning = false;
}, 50);
});
- self.$map.on("mousedown." + pluginName + (zoomOptions.touch ? " touchstart" : ""), function (e) {
+ self.$map.on("mousedown." + pluginName + (zoomOptions.touch ? " touchstart." + pluginName : ""), function (e) {
if (e.pageX !== undefined) {
mousedown = true;
previousX = e.pageX;
@@ -522,7 +522,7 @@
previousY = e.originalEvent.touches[0].pageY;
}
}
- }).on("mousemove." + pluginName + (zoomOptions.touch ? " touchmove" : ""), function (e) {
+ }).on("mousemove." + pluginName + (zoomOptions.touch ? " touchmove." + pluginName : ""), function (e) {
var currentLevel = self.zoomData.zoomLevel;
var pageX = 0;
var pageY = 0; | Fix namespaces for events bindings | neveldo_jQuery-Mapael | train | js |
ed388541e56449a607a500458f011f4335104ff1 | diff --git a/activiti-spring-boot-starter/src/main/java/org/activiti/spring/boot/ActivitiProperties.java b/activiti-spring-boot-starter/src/main/java/org/activiti/spring/boot/ActivitiProperties.java
index <HASH>..<HASH> 100644
--- a/activiti-spring-boot-starter/src/main/java/org/activiti/spring/boot/ActivitiProperties.java
+++ b/activiti-spring-boot-starter/src/main/java/org/activiti/spring/boot/ActivitiProperties.java
@@ -17,7 +17,7 @@ import java.util.List;
import org.activiti.engine.impl.history.HistoryLevel;
import org.springframework.boot.context.properties.ConfigurationProperties;
-
+import org.springframework.core.io.support.ResourcePatternResolver;
@ConfigurationProperties("spring.activiti")
public class ActivitiProperties {
@@ -36,7 +36,7 @@ public class ActivitiProperties {
private String databaseSchema;
private boolean isDbHistoryUsed = false;
private HistoryLevel historyLevel = HistoryLevel.NONE;
- private String processDefinitionLocationPrefix = "classpath:**/processes/";
+ private String processDefinitionLocationPrefix = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX + "**/processes/";
private List<String> processDefinitionLocationSuffixes = Arrays.asList("**.bpmn20.xml", "**.bpmn");
private List<String> customMybatisMappers;
private List<String> customMybatisXMLMappers; | Update default processes location prefix (#<I>)
Use ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX: this fix the issue about processes not getting deployed during tests when they are located under src/main/resources/processes | Activiti_Activiti | train | java |
1ec99dc14ce3057f34172c3017dff3d77089a559 | diff --git a/tests/Unit/Suites/Import/Price/PriceTest.php b/tests/Unit/Suites/Import/Price/PriceTest.php
index <HASH>..<HASH> 100644
--- a/tests/Unit/Suites/Import/Price/PriceTest.php
+++ b/tests/Unit/Suites/Import/Price/PriceTest.php
@@ -78,6 +78,9 @@ class PriceTest extends \PHPUnit_Framework_TestCase
/**
* @dataProvider priceMultiplicationDataProvider
+ * @param int $amount
+ * @param float|int $factor
+ * @param int $expected
*/
public function testItMultipliesByTheGivenFactor($amount, $factor, $expected)
{ | Issue #<I>: Add missing PHPDoc | lizards-and-pumpkins_catalog | train | php |
0e90150e9c6f79d5f0deb8bef242fe60baa06cfb | diff --git a/rollup.config.js b/rollup.config.js
index <HASH>..<HASH> 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -1,11 +1,8 @@
import { plugins } from '../../rollup.base.config';
-import { checkIsReleaseReady } from '../../scripts/checkIsReleaseReady';
import { getBundleBanner } from '../../scripts/getBundleBanner';
import pkg from './package.json';
-checkIsReleaseReady();
-
if (!process.env.BUILD) {
throw new Error('The `BUILD` environment variable is required to build.');
} | chore(release): don't check for NODE_ENV to set banner | algolia_docsearch | train | js |
4ea475bcdca705d24a8fe6ec4430d2e24b1c6dff | diff --git a/elasticsearch-api/test/integration/yaml_test_runner.rb b/elasticsearch-api/test/integration/yaml_test_runner.rb
index <HASH>..<HASH> 100644
--- a/elasticsearch-api/test/integration/yaml_test_runner.rb
+++ b/elasticsearch-api/test/integration/yaml_test_runner.rb
@@ -83,7 +83,7 @@ url = ENV.fetch('TEST_CLUSTER_URL', "http://localhost:#{ENV['TEST_CLUSTER_PORT']
$client ||= Elasticsearch::Client.new url: url
$client.transport.logger = logger unless ENV['QUIET'] || ENV['CI']
-$client.transport.tracer = tracer if ENV['CI']
+# $client.transport.tracer = tracer if ENV['CI']
# Store Elasticsearch version
# | [CI] Disable tracing for YAML tests on Travis | elastic_elasticsearch-ruby | train | rb |
c54ec94a6e4c3276eac3e2bbea3c77a040d5674a | diff --git a/xarray/core/common.py b/xarray/core/common.py
index <HASH>..<HASH> 100644
--- a/xarray/core/common.py
+++ b/xarray/core/common.py
@@ -345,8 +345,6 @@ class DataWithCoords(AttrAccessMixin):
__slots__ = ("_close",)
- _rolling_exp_cls = RollingExp
-
def squeeze(
self,
dim: Union[Hashable, Iterable[Hashable], None] = None,
@@ -908,7 +906,7 @@ class DataWithCoords(AttrAccessMixin):
"""
window = either_dict_or_kwargs(window, window_kwargs, "rolling_exp")
- return self._rolling_exp_cls(self, window, window_type)
+ return RollingExp(self, window, window_type)
def coarsen(
self, | Small simplification to RollingExp (#<I>) | pydata_xarray | train | py |
86f6b7fb7b4d414ba061f9bfb6a29b9870504d99 | diff --git a/cmd/teams.go b/cmd/teams.go
index <HASH>..<HASH> 100644
--- a/cmd/teams.go
+++ b/cmd/teams.go
@@ -418,8 +418,9 @@ func teamsRemoveCmd(ctx *cli.Context) error {
results, err := client.Teams.GetByName(c, org.ID, teamName)
if len(results) != 1 || err != nil {
tErr = cli.NewExitError("Team not found", -1)
+ } else {
+ team = results[0]
}
- team = results[0]
wait.Done()
}() | Don't panic on teams remove with bad team name
Closes #<I> | manifoldco_torus-cli | train | go |
0d86251f5f6697f4246cde328474c5f512ec1793 | diff --git a/pkg/client/restclient/url_utils.go b/pkg/client/restclient/url_utils.go
index <HASH>..<HASH> 100644
--- a/pkg/client/restclient/url_utils.go
+++ b/pkg/client/restclient/url_utils.go
@@ -36,7 +36,7 @@ func DefaultServerURL(host, apiPath string, groupVersion unversioned.GroupVersio
if err != nil {
return nil, "", err
}
- if hostURL.Scheme == "" {
+ if hostURL.Scheme == "" || hostURL.Host == "" {
scheme := "http://"
if defaultTLS {
scheme = "https://" | Fix problem specifying fqdn:port in command line
When specifying --server in kubectl for example, we end up
with failure if you use "localhost:<I>" instead of
"<I>:<I>". This is because of the way url.Parse
works as shown in snippet:
<URL> | kubernetes_kubernetes | train | go |
b58eb23b7c574e7d452417cd7ae8a6ae5699c31f | diff --git a/integration/products_lifecycle_test.go b/integration/products_lifecycle_test.go
index <HASH>..<HASH> 100644
--- a/integration/products_lifecycle_test.go
+++ b/integration/products_lifecycle_test.go
@@ -16,6 +16,9 @@ var _ = Describe("Products Lifecycle", func() {
ID: 90,
Slug: testProductSlug,
Name: "Pivnet Resource Test",
+ S3Directory: &pivnet.S3Directory{
+ Path: "/product_files/Pivotal-Test",
+ },
}))
})
}) | Update integation test for Product
- Include s3_filepath_prefix
[#<I>] | pivotal-cf_go-pivnet | train | go |
f8b071c02d34709caea101081369559d207771d3 | diff --git a/salt/modules/nagios_rpc.py b/salt/modules/nagios_rpc.py
index <HASH>..<HASH> 100644
--- a/salt/modules/nagios_rpc.py
+++ b/salt/modules/nagios_rpc.py
@@ -143,4 +143,6 @@ def status(hostname, service=None, **kwargs):
username=config['username'],
password=config['password'])
- return _STATUS_ENUM.get(results.get('data', {}).get(target, {}).get('status', 0))
+ status_code = results.get('data', {}).get(target, {}).get('status', 0)
+
+ return kwargs.get("numeric") is False and _STATUS_ENUM.get(status_code) or status_code | Added ability to return either numeric or textual status | saltstack_salt | train | py |
658dbbaa427c29e816e3c7e3dde0a5a0d1fa9182 | diff --git a/Cojen/src/main/java/org/cojen/util/WeakIdentityMap.java b/Cojen/src/main/java/org/cojen/util/WeakIdentityMap.java
index <HASH>..<HASH> 100644
--- a/Cojen/src/main/java/org/cojen/util/WeakIdentityMap.java
+++ b/Cojen/src/main/java/org/cojen/util/WeakIdentityMap.java
@@ -73,7 +73,7 @@ public class WeakIdentityMap<K, V> extends AbstractMap<K, V> implements Map<K, V
while (hasNext) {
Object obj = it.next();
buf.append(obj == c ? "(this Collection)" : obj);
- if (hasNext) {
+ if (hasNext = it.hasNext()) {
buf.append(", ");
}
} | Fix bug in toString method. | cojen_Cojen | train | java |
8b24158180fd30e99e3b483bb563197100ce75f4 | diff --git a/tests/pytests/functional/states/test_docker_container.py b/tests/pytests/functional/states/test_docker_container.py
index <HASH>..<HASH> 100644
--- a/tests/pytests/functional/states/test_docker_container.py
+++ b/tests/pytests/functional/states/test_docker_container.py
@@ -167,6 +167,10 @@ def docker_container(states):
@pytest.fixture(scope="module")
def image(tmp_path_factory):
+ if not salt.utils.path.which("docker"):
+ # Somehow the above skip_if_binaries_missing marker for docker
+ # only get's evaluated after this fixture?!?
+ pytest.skip("The `docker` binary is not available")
container_build_dir = tmp_path_factory.mktemp("busybox")
image_name = random_string("salt-busybox-", uppercase=False) | Don't attempt to create the image if `docker` is not in PATH | saltstack_salt | train | py |
94fd94b3ae0f8fea133da3a572cafb71841a851d | diff --git a/rows/plugins/xlsx.py b/rows/plugins/xlsx.py
index <HASH>..<HASH> 100644
--- a/rows/plugins/xlsx.py
+++ b/rows/plugins/xlsx.py
@@ -90,7 +90,7 @@ def export_to_xlsx(table, filename_or_fobj=None, sheet_name='Sheet1', *args,
**kwargs):
workbook = Workbook()
- sheet = workbook.get_active_sheet()
+ sheet = workbook.active
sheet.title = sheet_name
field_names = list(enumerate(table.fields))
prepared_table = prepare_to_export(table, *args, **kwargs) | Remove openpyxl warning. Fix #<I> | turicas_rows | train | py |
4ebd256bfd877938981782e7465c2c2975eccea2 | diff --git a/lib/ruby_speech/generic_element.rb b/lib/ruby_speech/generic_element.rb
index <HASH>..<HASH> 100644
--- a/lib/ruby_speech/generic_element.rb
+++ b/lib/ruby_speech/generic_element.rb
@@ -52,22 +52,11 @@ module RubySpeech
end
def new(atts = {}, &block)
- blk_proc = lambda do |new_node|
+ super(self.registered_name, nil, self.namespace) do |new_node|
(self.defaults || {}).merge(atts).each_pair { |k, v| new_node.send :"#{k}=", v }
block_return = new_node.eval_dsl_block &block
new_node << block_return if block_return.is_a?(String)
end
-
- case RUBY_VERSION.split('.')[0,2].join.to_i
- when 18
- super(self.registered_name, nil, self.namespace).tap do |n|
- blk_proc[n]
- end
- else
- super(self.registered_name, nil, self.namespace) do |n|
- blk_proc[n]
- end
- end
end
end | [CS] Drop a complex patch for ruby <I> | adhearsion_ruby_speech | train | rb |
e38563a089986075e9920d0de7fef24ba5670abb | diff --git a/core/prey_module.js b/core/prey_module.js
index <HASH>..<HASH> 100644
--- a/core/prey_module.js
+++ b/core/prey_module.js
@@ -9,11 +9,13 @@ var sys = require('sys'),
emitter = require('events').EventEmitter;
function mixin(target, source) {
- Object.keys(source).forEach(function(key) {
- target[key] = source[key];
- });
+ Object.keys(source).forEach(function(key) {
+ // if value is 'y' or 'n' lets translate them to true or false
+ val = source[key] == 'y' ? true : source[key] == 'n' ? false : source[key];
+ target[key] = val;
+ });
- return target;
+ return target;
}
function PreyModule(){ | Transform 'y' and 'n' values into true and false | prey_prey-node-client | train | js |
79d30294d45816c8ee0a6d6ba7af40a22324f61d | diff --git a/setup_utils.py b/setup_utils.py
index <HASH>..<HASH> 100755
--- a/setup_utils.py
+++ b/setup_utils.py
@@ -182,15 +182,14 @@ class changelog(Command):
build = 1
else:
repo = git.Repo()
- config = repo.config_reader()
+ commit = repo.head.commit
+ date = commit.authored_datetime
+ tz = commit.author_tz_offset
version = str(tag)
- build = 1000
- author = config.get_value("user", "name", default="user")
- email = config.get_value("user", "email",
- default="<user@email.com>")
+ author = commit.author.name
+ email = commit.author.email
message = 'Test build'
- date = datetime.datetime.now()
- tz = 0
+ build = 1000
name = self.distribution.get_name()
if self.format == 'rpm':
formatter = self._format_entry_rpm | setup_utils.py: improved changelog for dev builds
to fix lintian errors | gwpy_gwpy | train | py |
fd6d05bafd118a5ad564a860127b2dbb0748b02b | diff --git a/src/android/WebApp.java b/src/android/WebApp.java
index <HASH>..<HASH> 100644
--- a/src/android/WebApp.java
+++ b/src/android/WebApp.java
@@ -20,6 +20,8 @@ import java.util.List;
public class WebApp extends CordovaPlugin {
private static final String LOG_TAG = "WebApp";
+ private static final String APP_AUTHORITY = "app";
+
private AssetManager assetManager;
private AssetManagerCache assetManagerCache;
@@ -28,7 +30,6 @@ public class WebApp extends CordovaPlugin {
private Uri wwwDirectoryUri;
private Uri applicationDirectoryUri;
- private final int localServerPort = 12000;
private List<WebResourceHandler> resourceHandlers;
private AssetBundle currentAssetBundle;
@@ -153,7 +154,7 @@ public class WebApp extends CordovaPlugin {
@Override
public Uri remapUri(Uri uri) {
- if (!(uri.getScheme().equals("http") && uri.getHost().equals("localhost") && uri.getPort() == localServerPort)) return null;
+ if (!(uri.getScheme().equals("file") && uri.getAuthority().equals(APP_AUTHORITY))) return null;
Uri remappedUri = null;
for (WebResourceHandler handler : resourceHandlers) { | Intercept file://app instead of http://localhost on Android
Using a file:// URL as origin allows for local file access. | meteor_cordova-plugin-meteor-webapp | train | java |
df41ccd52d6b6932adb6460418ba34905651389a | diff --git a/accentuation.py b/accentuation.py
index <HASH>..<HASH> 100644
--- a/accentuation.py
+++ b/accentuation.py
@@ -28,6 +28,10 @@ def make_paroxytone(w):
return add_accent(syllabify(w), PAROXYTONE)
+def make_proparoxytone(w):
+ return add_accent(syllabify(w), PROPAROXYTONE)
+
+
def make_perispomenon(w):
s = syllabify(w)
if PERISPOMENON in possible_accentuations(s): | added make_proparoxytone function | jtauber_greek-accentuation | train | py |
6d31e395e33812e083dd7470f8dd943b46b1cdae | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -154,7 +154,9 @@ function create (opts) {
})
function done (contentKey) {
- opened[discKey] = (opened[discKey] || 0) + 1
+ if (!opened[discKey]) opened[discKey] = {feed: feed, cnt: 0}
+ opened[discKey].cnt++
+
if (!contentKey) return cb(null, feed)
contentKey = datKeyAs.str(contentKey)
@@ -162,7 +164,9 @@ function create (opts) {
storage: storage(path.join(dir, 'data', contentKey.slice(0, 2), contentKey.slice(2) + '.data'))
})
var contentDiscKey = hypercore.discoveryKey(contentKey).toString('hex')
- opened[contentDiscKey] = (opened[contentDiscKey] || 0) + 1
+
+ if (!opened[contentDiscKey]) opened[contentDiscKey] = {feed: contentFeed, cnt: 0}
+ opened[contentDiscKey].cnt++
cb(null, feed, contentFeed)
} | fix bad reference that was losing track of opened archives | mafintosh_hypercore-archiver | train | js |
0c59810c44e455bbb86d432e77d2e7c7d6c8ea5a | diff --git a/client_task_test.go b/client_task_test.go
index <HASH>..<HASH> 100644
--- a/client_task_test.go
+++ b/client_task_test.go
@@ -1090,7 +1090,16 @@ var _ = Describe("Client - Task operations", func() {
expectedError := errors.New("jsonHelper error")
BeforeEach(func() {
- fakeJSONHelper.UnmarshalReturns(nil, expectedError)
+ callCount := 0
+ fakeJSONHelper.UnmarshalStub = func([]byte, interface{}) (interface{}, error) {
+ callCount++
+ switch callCount {
+ case 1:
+ return expectedGetTask, nil
+ default:
+ return nil, expectedError
+ }
+ }
})
It("forwards the error", func() { | Missing test case in UpdateTask.
[#<I>] | robdimsdale_wl | train | go |
23f078d83abe680e9bdba442bf2767c127d48440 | diff --git a/salt/runners/launchd.py b/salt/runners/launchd.py
index <HASH>..<HASH> 100644
--- a/salt/runners/launchd.py
+++ b/salt/runners/launchd.py
@@ -23,19 +23,28 @@ def write_launchd_plist(program):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
-<dict>
+ <dict>
<key>Label</key>
<string>org.saltstack.{program}</string>
-
+ <key>RunAtLoad</key>
+ <true/>
+ <key>KeepAlive</key>
+ <true/>
<key>ProgramArguments</key>
<array>
- <string>{python}</string>
<string>{script}</string>
</array>
-
- <key>RunAtLoad</key>
- <true/>
-</dict>
+ <key>SoftResourceLimits</key>
+ <dict>
+ <key>NumberOfFiles</key>
+ <integer>100000</integer>
+ </dict>
+ <key>HardResourceLimits</key>
+ <dict>
+ <key>NumberOfFiles</key>
+ <integer>100000</integer>
+ </dict>
+ </dict>
</plist>
'''.strip() | Use plist from pkg in launchd runner. | saltstack_salt | train | py |
ec3157f4db4e945911196978aee56227d865d8a6 | diff --git a/lib/haml/template/plugin.rb b/lib/haml/template/plugin.rb
index <HASH>..<HASH> 100644
--- a/lib/haml/template/plugin.rb
+++ b/lib/haml/template/plugin.rb
@@ -16,7 +16,11 @@ module Haml
def compile(template)
options = Haml::Template.options.dup
- options[:mime_type] = template.mime_type if template.respond_to? :mime_type
+ if template.respond_to? :type
+ options[:mime_type] = template.type
+ elsif template.respond_to? :mime_type
+ options[:mime_type] = template.mime_type
+ end
options[:filename] = template.identifier
Haml::Engine.new(template.source, options).compiler.precompiled_with_ambles([])
end | Use type instead of mime_type in plugin.rb
Template#mime_type method is deprecated in Rails 4.
Use Template#type in template/plugin.rb if it's available. | haml_haml | train | rb |
27a3f686ad76d388ea066ba3e6589b3a631df221 | diff --git a/owncloud/__init__.py b/owncloud/__init__.py
index <HASH>..<HASH> 100644
--- a/owncloud/__init__.py
+++ b/owncloud/__init__.py
@@ -467,6 +467,34 @@ class Client():
)
raise ResponseError(res)
+ def get_config(self):
+ """Returns ownCloud config information as JSON
+ :returns: JSON object with config information
+ e.g. {'website': 'ownCloud', 'ssl': 'false', 'host': 'cloud.example.com', 'version': '1.7', 'contact': ''}
+ :raises: ResponseError in case an HTTP error status was returned
+ """
+ path = 'config'
+ res = self.__make_ocs_request(
+ 'GET',
+ '',
+ path
+ )
+ if res.status_code == 200:
+ tree = ET.fromstring(res.text)
+ self.__check_ocs_status(tree)
+ values = []
+
+ element = tree.find('data')
+ if element != None:
+ keys = [ 'version', 'website', 'host', 'contact', 'ssl' ]
+ for key in keys:
+ text = element.find(key).text or ''
+ values.append(text)
+ return dict(zip(keys, values))
+ else:
+ return None
+ raise ResponseError(res)
+
def get_attribute(self, app = None, key = None):
"""Returns an application attribute | Added function get_config() - the name speaks for itself | owncloud_pyocclient | train | py |
1916bb29c9e58c3bcfc1d364f0b60c03cb94d6df | diff --git a/lib/penpal.rb b/lib/penpal.rb
index <HASH>..<HASH> 100644
--- a/lib/penpal.rb
+++ b/lib/penpal.rb
@@ -5,7 +5,7 @@ require 'uri'
module Penpal
# TODO: Hardcode default delivery host
- @@delivery_host = URI(ENV['PENPAL_DELIVERY_HOST'] || 'http://penpal-app.herokuapp.com')
+ @@delivery_host = URI(ENV['PENPAL_DELIVERY_HOST'] || 'http://penpal-deliver.herokuapp.com')
@@domain_key = ENV['PENPAL_DOMAIN_KEY']
def self.delivery_host=(host) | s/app/deliver/g | apostle_apostle-ruby | train | rb |
1c4acca0ec7c1307fa689ea4aec0d5cb45ab7913 | diff --git a/dusty/commands/test.py b/dusty/commands/test.py
index <HASH>..<HASH> 100644
--- a/dusty/commands/test.py
+++ b/dusty/commands/test.py
@@ -143,15 +143,14 @@ def _cleanup_bad_test_state(app_or_lib_name, suite_name, service_name):
client = get_docker_client()
compose_project_name = _compose_project_name(app_or_lib_name, suite_name)
compose_container_name = _test_compose_container_name(compose_project_name, service_name)
- try:
+
+ running_containers = client.containers(filters={'name': compose_container_name})
+ if running_containers != []:
client.kill(compose_container_name)
- except:
- pass
- try:
+ containers = client.containers(all=True, filters={'name': compose_container_name})
+ if containers != []:
client.remove_container(compose_container_name, v=True)
- except:
- pass
return compose_container_name | check if container is running and then check if there is a container | gamechanger_dusty | train | py |
e41fa08dd9977394d94a6ad4ccc8b58ba473caa4 | diff --git a/db/schema.rb b/db/schema.rb
index <HASH>..<HASH> 100755
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -73,7 +73,7 @@ ActiveRecord::Schema.define(:version => 0) do
create_table "posts", :force => true do |t|
t.integer "admin_id"
t.datetime "post_date"
- t.text "post_content", :limit => 2147483647
+ t.text "post_content",
t.text "post_title"
t.string "post_status"
t.string "post_template" | updaets to the seeds file | mrsimonfletcher_roroacms | train | rb |
426bdc97ef1fa929ec6c4a711daff5d621f92762 | diff --git a/lib/mail/version_specific/ruby_1_9.rb b/lib/mail/version_specific/ruby_1_9.rb
index <HASH>..<HASH> 100644
--- a/lib/mail/version_specific/ruby_1_9.rb
+++ b/lib/mail/version_specific/ruby_1_9.rb
@@ -88,6 +88,7 @@ module Mail
end
def Ruby19.transcode_charset(str, from_encoding, to_encoding = Encoding::UTF_8)
+ to_encoding = to_encoding.to_s if RUBY_VERSION < '1.9.3'
to_encoding = Encoding.find(to_encoding)
replacement_char = to_encoding == Encoding::UTF_8 ? '�' : '?'
charset_encoder.encode(str.dup, from_encoding).encode(to_encoding, :undef => :replace, :invalid => :replace, :replace => replacement_char) | Fix for eb1e<I> on Ruby <I> which can't do Encoding.find on Encoding instances | mikel_mail | train | rb |
601f174ea01f8ba1f3239209595078ef29ceb72f | diff --git a/models/migrations/v16.go b/models/migrations/v16.go
index <HASH>..<HASH> 100644
--- a/models/migrations/v16.go
+++ b/models/migrations/v16.go
@@ -51,7 +51,8 @@ func updateRepositorySizes(x *xorm.Engine) (err error) {
countObject, err := git.GetRepoSize(repoPath)
if err != nil {
- return fmt.Errorf("GetRepoSize: %v", err)
+ log.Warn("GetRepoSize: %v", err)
+ return nil
}
repo.Size = countObject.Size + countObject.SizePack | migrations/<I>: only Warn if repository happens to have bad data | gogs_gogs | train | go |
8dab270932d63fe8d7787c845c0611e1e16c1b9b | diff --git a/update.changelog.rb b/update.changelog.rb
index <HASH>..<HASH> 100644
--- a/update.changelog.rb
+++ b/update.changelog.rb
@@ -48,7 +48,7 @@ id.inc()
ARGF.each do |line|
if /=BEGIN=/ =~ line
puts line
- puts "<h3><a name=v#{id}>What's new in #{id}</a></h3>"
+ puts "<h3><a name=v#{id}>What's new in #{id}</a> <!--=DATE=--></h3>"
puts "<!--=RC-CHANGES=-->"
puts "</div><!--=END=-->"
@@ -57,5 +57,9 @@ ARGF.each do |line|
if /=END=/ =~ line
next
end
+ if /=DATE=/ =~ line
+ puts line.gsub("<!--=DATE=-->",Time.now.strftime("(%Y/%m/%d)"))
+ next
+ end
puts line
end | [FIXED HUDSON-<I>] release date is added to the changelog automatically
git-svn-id: <URL> | jenkinsci_jenkins | train | rb |
533734f27ae982a87d39dc67200aeacd829ab401 | diff --git a/src/browser.js b/src/browser.js
index <HASH>..<HASH> 100644
--- a/src/browser.js
+++ b/src/browser.js
@@ -136,8 +136,8 @@
}
crossDomain = isCrossDomain(currentLocation, uri);
/*************** start XHR **************/
- if(typeof input === 'object' && httpinvoke.requestTextOnly) {
- return failWithoutRequest(cb, new Error('bytearray inputType is not supported on this platform, please always test using requestTextOnly feature flag'));
+ if(typeof input === 'object' && !isFormData(input) && httpinvoke.requestTextOnly) {
+ return failWithoutRequest(cb, new Error('bytearray inputType is not supported on this platform, please always test using requestTextOnly feature flag - hint - you may want to try sending FormData (formdata type)'));
}
if(crossDomain && !httpinvoke.cors) {
return failWithoutRequest(cb, new Error('Cross-origin requests are not supported')); | src: browser.js: support 'formdata' inputType even if 'requestTextOnly' feature flag is true
Fixes FormData-related tests in uploading.js for Safari <I>. | jakutis_httpinvoke | train | js |
ae83eec6ff5679992404ecd20d2019cb21422adb | diff --git a/Tests/DependencyInjection/Fixtures/Util/EventDispatcherSpy.php b/Tests/DependencyInjection/Fixtures/Util/EventDispatcherSpy.php
index <HASH>..<HASH> 100644
--- a/Tests/DependencyInjection/Fixtures/Util/EventDispatcherSpy.php
+++ b/Tests/DependencyInjection/Fixtures/Util/EventDispatcherSpy.php
@@ -2,7 +2,6 @@
namespace OpenClassrooms\Bundle\UseCaseBundle\Tests\DependencyInjection\Fixtures\Util;
-use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcher;
/**
@@ -26,11 +25,11 @@ class EventDispatcherSpy extends EventDispatcher
self::$sent = false;
}
- public function dispatch($eventName, Event $event = null)
+ public function dispatch($event, string $eventName = null)
{
self::$eventName = $eventName;
self::$sent = true;
- parent::dispatch($eventName, $event);
+ parent::dispatch($event, $eventName);
}
} | chore(f-deprecation): refactored EventDispatcherSpy following deprecation cleanup | OpenClassrooms_UseCaseBundle | train | php |
2a40ac9a065e88f7aa7a5a94cce6cefd07e49fc6 | diff --git a/src/frontend/org/voltdb/ClientInterface.java b/src/frontend/org/voltdb/ClientInterface.java
index <HASH>..<HASH> 100644
--- a/src/frontend/org/voltdb/ClientInterface.java
+++ b/src/frontend/org/voltdb/ClientInterface.java
@@ -100,7 +100,6 @@ import org.voltdb.iv2.Iv2Trace;
import org.voltdb.iv2.LeaderCache;
import org.voltdb.iv2.LeaderCacheReader;
import org.voltdb.iv2.MpInitiator;
-import org.voltdb.iv2.TransactionTaskQueue;
import org.voltdb.messaging.FastDeserializer;
import org.voltdb.messaging.FastSerializer;
import org.voltdb.messaging.InitiateResponseMessage;
@@ -1692,7 +1691,10 @@ public class ClientInterface implements SnapshotDaemon.DaemonInitiator {
ClientResponseImpl dispatchSendSentinel(ByteBuffer buf,
StoredProcedureInvocation invocation)
{
- // TODO: need real txnIds for deduping
+ /*
+ * Sentinels will be deduped by ReplaySequencer. They don't advance the
+ * last replayed txnIds.
+ */
// First parameter is the partition ID
sendSentinel(invocation.getOriginalTxnId(), | Add a comment to ClientInterface to explain how sentinels are deduped. | VoltDB_voltdb | train | java |
a97e11119a029de9297960079a6b3e2bb0757d2f | diff --git a/buildbot/scripts/runner.py b/buildbot/scripts/runner.py
index <HASH>..<HASH> 100644
--- a/buildbot/scripts/runner.py
+++ b/buildbot/scripts/runner.py
@@ -7,7 +7,6 @@ import traceback
from twisted.python import usage, util, runtime
from buildbot.interfaces import BuildbotNotRunningError
-from buildbot.db import schema
# the create/start/stop commands should all be run as the same user,
# preferably a separate 'buildbot' account.
@@ -270,7 +269,7 @@ class Maker:
f.close()
def create_db(self):
- from buildbot.db import dbspec, exceptions
+ from buildbot.db import dbspec, exceptions, schema
spec = dbspec.DBSpec.from_url(self.config["db"], self.basedir)
if not self.config['quiet']: print "creating database" | don't import schema globally, since it ends up pulling in a reactor; fixes #<I> | buildbot_buildbot | train | py |
aed0d5b3a73fbc99f78cda5c98e6d9687d371ba2 | diff --git a/textx/cli/generate.py b/textx/cli/generate.py
index <HASH>..<HASH> 100644
--- a/textx/cli/generate.py
+++ b/textx/cli/generate.py
@@ -78,7 +78,8 @@ def generate(ctx, model_files, output_path, language, target, overwrite,
language = language_for_file(model_file).name
metamodel = metamodel_for_file(model_file)
model = metamodel.model_from_file(model_file)
- generator = generator_for_language_target(language, target)
+ generator = generator_for_language_target(
+ language, target, any_permitted=per_file_metamodel)
generator(metamodel, model, output_path, overwrite, debug) | Allow for `any` language is language is not explicitly given | textX_textX | train | py |
a86f0be913061ba1753559ca91191b5d8f4c6fcb | 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
@@ -1,14 +1,15 @@
# frozen_string_literal: true
require "bundler/setup"
+
require "simplecov"
+SimpleCov.start
+
require "pry"
require "pry-byebug"
require "climate_control"
require "tocer"
-SimpleCov.start
-
Dir[File.join(__dir__, "support", "shared_contexts", "**/*.rb")].each(&method(:require))
RSpec.configure do |config| | Fixed SimpleCov setup in RSpec spec helper.
Ensures SimpleCov is properly covering all files in the project. This
improves [RubyCritic](<URL>)
reporting too. | bkuhlmann_tocer | train | rb |
575d5efde4c55f83518c9ecbecc1e2f20e1f617a | diff --git a/src/directives/marker.js b/src/directives/marker.js
index <HASH>..<HASH> 100644
--- a/src/directives/marker.js
+++ b/src/directives/marker.js
@@ -99,6 +99,7 @@ angular.module('openlayers-directive').directive('olMarker', function($log, $q,
var marker;
scope.$on('$destroy', function() {
+ markerLayer.getSource().removeFeature(marker);
markerLayerManager.deregisterScope(scope, map);
}); | Fix marker removal not removing a marker, see issue #<I> | tombatossals_angular-openlayers-directive | train | js |
95440c923ef61e33baedc2c8e48556e0f819e6a5 | diff --git a/src/gl/texture.js b/src/gl/texture.js
index <HASH>..<HASH> 100644
--- a/src/gl/texture.js
+++ b/src/gl/texture.js
@@ -81,7 +81,7 @@ export default class Texture {
}
}
- bind(unit) {
+ bind(unit = 0) {
if (!this.valid) {
return;
} | GL: default texture unit binding to 0 | tangrams_tangram | train | js |
44a44738ecbd4e3d22be327854dfbfb925f45826 | diff --git a/src/wormhole/server/cli.py b/src/wormhole/server/cli.py
index <HASH>..<HASH> 100644
--- a/src/wormhole/server/cli.py
+++ b/src/wormhole/server/cli.py
@@ -117,9 +117,13 @@ def start(cfg, signal_error, no_daemon, blur_usage, advertise_version,
"--disallow-list", is_flag=True,
help="never send list of allocated nameplates",
)
+@_relay_database_path
+@_stats_json_path
@click.pass_obj
def restart(cfg, signal_error, no_daemon, blur_usage, advertise_version,
- transit, rendezvous, disallow_list):
+ transit, rendezvous, disallow_list, relay_database_path,
+ stats_json_path,
+ ):
"""
Re-start a relay server
"""
@@ -131,6 +135,8 @@ def restart(cfg, signal_error, no_daemon, blur_usage, advertise_version,
cfg.rendezvous = str(rendezvous)
cfg.signal_error = signal_error
cfg.allow_list = not disallow_list
+ cfg.relay_database_path = relay_database_path
+ cfg.stats_json_path = stats_json_path
restart_server(cfg) | take new args for 'restart' too, fixes test failure | warner_magic-wormhole | train | py |
4cd1f7a104881a20cb580bfa477f3bfdbb1d4f4e | diff --git a/plugins/inputs/ping/ping.go b/plugins/inputs/ping/ping.go
index <HASH>..<HASH> 100644
--- a/plugins/inputs/ping/ping.go
+++ b/plugins/inputs/ping/ping.go
@@ -76,7 +76,8 @@ func (p *Ping) Gather(acc telegraf.Accumulator) error {
go func(u string) {
defer wg.Done()
args := p.args(u)
- out, err := p.pingHost(p.Timeout, args...)
+ totalTimeout := float64(p.Count)*p.Timeout + float64(p.Count-1)*p.PingInterval
+ out, err := p.pingHost(totalTimeout, args...)
if err != nil {
// Combine go err + stderr output
errorChannel <- errors.New( | Increase ping timeout based on ping count and interval | influxdata_telegraf | train | go |
65dcef2ae45b6400b33ac598f8237a9ee3f6882b | diff --git a/version.php b/version.php
index <HASH>..<HASH> 100644
--- a/version.php
+++ b/version.php
@@ -29,11 +29,11 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2014042400.00; // YYYYMMDD = weekly release date of this DEV branch.
+$version = 2014042900.00; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
-$release = '2.7beta+ (Build: 20140424)'; // Human-friendly version name
+$release = '2.7beta+ (Build: 20140429)'; // Human-friendly version name
$branch = '27'; // This version's branch.
$maturity = MATURITY_BETA; // This version's maturity level. | on-demand release <I>beta+ | moodle_moodle | train | php |
f408e19a7a712913b05731300389383e5cc9a9f2 | diff --git a/connection.go b/connection.go
index <HASH>..<HASH> 100644
--- a/connection.go
+++ b/connection.go
@@ -1061,11 +1061,17 @@ func (c *connection) receiveChunk(msg *pp.Message) {
c.postCancel(req)
}
- cl.mu.Unlock()
- // Write the chunk out. Note that the upper bound on chunk writing
- // concurrency will be the number of connections.
- err := t.writeChunk(int(msg.Index), int64(msg.Begin), msg.Piece)
- cl.mu.Lock()
+ err := func() error {
+ cl.mu.Unlock()
+ defer cl.mu.Lock()
+ // Write the chunk out. Note that the upper bound on chunk writing
+ // concurrency will be the number of connections. We write inline with
+ // receiving the chunk (with this lock dance), because we want to
+ // handle errors synchronously and I haven't thought of a nice way to
+ // defer any concurrency to the storage and have that notify the
+ // client of errors. TODO: Do that instead.
+ return t.writeChunk(int(msg.Index), int64(msg.Begin), msg.Piece)
+ }()
piece.decrementPendingWrites() | Survive panics while writing chunks
Also improve the comment on that code | anacrolix_torrent | train | go |
72da6a524a4514914031c367f112facbbeb0f73a | diff --git a/src/Illuminate/Hashing/ArgonHasher.php b/src/Illuminate/Hashing/ArgonHasher.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Hashing/ArgonHasher.php
+++ b/src/Illuminate/Hashing/ArgonHasher.php
@@ -40,7 +40,7 @@ class ArgonHasher implements HasherContract
$hash = password_hash($value, PASSWORD_ARGON2I, [
'memory_cost' => $this->memory($options),
'time_cost' => $this->time($options),
- 'threads' => $this->processors($options)
+ 'threads' => $this->processors($options),
]);
if ($hash === false) {
@@ -79,7 +79,7 @@ class ArgonHasher implements HasherContract
return password_needs_rehash($hashedValue, PASSWORD_ARGON2I, [
'memory_cost' => $this->memory($options),
'time_cost' => $this->time($options),
- 'threads' => $this->processors($options)
+ 'threads' => $this->processors($options),
]);
}
@@ -157,4 +157,4 @@ class ArgonHasher implements HasherContract
{
return $options['processors'] ?? $this->processors;
}
-}
\ No newline at end of file
+} | Apply fixes from StyleCI (#<I>) | laravel_framework | train | php |
e493abd33df3b32f957fa2d3fb4bb9436ab7fd41 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -15,7 +15,7 @@ setup(
package_data={'': ['schemata/*.json',
'schemata/namespaces/*.json',
'schemata/namespaces/*/*.json']},
- long_description="""A python module for audio and music processing.""",
+ long_description='A JSON Annotated Music Specification for Reproducible MIR Research',
classifiers=[
"License :: OSI Approved :: ISC License (ISCL)",
"Programming Language :: Python", | fixing a typo in setup.py description field | marl_jams | train | py |
3a157b54917a3a1dd2431f38d88ea4b89fd36942 | diff --git a/examples/record_loader.rb b/examples/record_loader.rb
index <HASH>..<HASH> 100644
--- a/examples/record_loader.rb
+++ b/examples/record_loader.rb
@@ -11,10 +11,7 @@ class RecordLoader < GraphQL::Batch::Loader
end
def perform(keys)
- query(keys).each do |record|
- value = @column_type.cast(record.public_send(@column))
- fulfill(value, record)
- end
+ query(keys).each { |record| fulfill(record.public_send(@column), record) }
keys.each { |key| fulfill(key, nil) unless fulfilled?(key) }
end | docs(example): Remove unnecessary type cast in RecordLoader example
The record's attribute reader method should already be returning
values of the right type. | Shopify_graphql-batch | train | rb |
1d287345f64077ff62eca9d126c1b109109d5ea8 | diff --git a/src/term/render/renderHtml.js b/src/term/render/renderHtml.js
index <HASH>..<HASH> 100644
--- a/src/term/render/renderHtml.js
+++ b/src/term/render/renderHtml.js
@@ -1,5 +1,6 @@
'use strict';
-//im not sure this is safe.
+//turn xml special characters into apersand-encoding.
+//i'm not sure this is perfectly safe.
const escapeHtml = (s) => {
const HTML_CHAR_MAP = {
'<': '<',
@@ -39,6 +40,7 @@ const sanitize = (html) => {
return html.replace(/</g, '<');
}
+//turn the term into ~properly~ formatted html
const renderHtml = function(t) {
let classes = Object.keys(t.pos).filter((tag) => tag !== 'Term');
classes = classes.map(c => 'nlp' + c); | kinda sanitize html | spencermountain_compromise | 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.