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
|
---|---|---|---|---|---|
fe6ebea40e773998a941eeeb8688dca219ddc160
|
diff --git a/lib/assets/javascripts/_modules/search.js b/lib/assets/javascripts/_modules/search.js
index <HASH>..<HASH> 100644
--- a/lib/assets/javascripts/_modules/search.js
+++ b/lib/assets/javascripts/_modules/search.js
@@ -149,9 +149,10 @@
break;
}
- var containsMark = sentences[i].includes('mark>');
- if (containsMark) {
- selectedSentences.push(sentences[i].trim());
+ var sentence = sentences[i].trim();
+ var containsMark = sentence.includes('mark>');
+ if (containsMark && (selectedSentences.indexOf(sentence) == -1)) {
+ selectedSentences.push(sentence);
}
}
if(selectedSentences.length > 0) {
|
Do not print identical search snippets twice. Fixes alphagov/tech-docs-template#<I>
|
alphagov_tech-docs-gem
|
train
|
js
|
5f52da13ce440bedd08174316d3a467df9b69711
|
diff --git a/lib/rules/rules.js b/lib/rules/rules.js
index <HASH>..<HASH> 100644
--- a/lib/rules/rules.js
+++ b/lib/rules/rules.js
@@ -35,7 +35,7 @@ var ALL_STAR_RE = /^\*{3,}$/;
var STAR_RE = /\*+/g;
var PORT_PATTERN_RE = /^!?:\d{1,5}$/;
var QUERY_RE = /[?#].*$/;
-var COMMENT_RE = /#.*$/gm;
+var COMMENT_RE = /#.*$/;
var CONTROL_RE = /[\u001e\u001f\u200e\u200f\u200d\u200c\u202a\u202d\u202e\u202c\u206e\u206f\u206b\u206a\u206d\u206c]/g;
function domainToRegExp(all, index) {
@@ -727,10 +727,9 @@ function resolveMatchFilter(list) {
}
function parseText(rulesMgr, text, root, append) {
- text = text.replace(COMMENT_RE, '').replace(CONTROL_RE, '');
getLines(text, root).forEach(function(line) {
var raw = line;
- line = line.trim();
+ line = line.replace(COMMENT_RE, '').replace(CONTROL_RE, '').trim();
line = line && line.split(/\s+/);
var len = line && line.length;
if (!len || len < 2) {
|
refactor: filter unicode control characters
|
avwo_whistle
|
train
|
js
|
3e906ba9348b0e795cbce419f9623325c6234a9e
|
diff --git a/mod/exercise/index.php b/mod/exercise/index.php
index <HASH>..<HASH> 100644
--- a/mod/exercise/index.php
+++ b/mod/exercise/index.php
@@ -72,6 +72,7 @@
if (isteacher($course->id)) {
$phase = '';
switch ($exercise->phase) {
+ case 0:
case 1: $phase = get_string("phase1short", "exercise");
break;
case 2: $phase = get_string("phase2short", "exercise");
|
Prints correct phase for newly created exercise (when phase is 0).
|
moodle_moodle
|
train
|
php
|
adb0f319a534a8ccd929a2153118386c6aae666a
|
diff --git a/vncdotool/api.py b/vncdotool/api.py
index <HASH>..<HASH> 100644
--- a/vncdotool/api.py
+++ b/vncdotool/api.py
@@ -36,9 +36,8 @@ def connect(server, password=None):
in the main thread of non-Twisted Python Applications, EXPERIMENTAL.
>>> from vncdotool import api
- >>> client = api.connect('host')
- >>> client.keyPress('c')
- >>> api.shutdown()
+ >>> with api.connect('host') as client
+ >>> client.keyPress('c')
You may then call any regular VNCDoToolClient method on client from your
application code.
@@ -83,6 +82,12 @@ class ThreadedVNCClientProxy(object):
self.queue = queue.Queue()
self._timeout = 60 * 60
+ def __enter__(self):
+ return self
+
+ def __exit__(self, *_):
+ self.disconnect()
+
@property
def timeout(self):
"""Timeout in seconds for API requests."""
|
issue #<I>: add context manager protocol to client
|
sibson_vncdotool
|
train
|
py
|
234f9cf17e565895c02270fd2a6e94413f3ef782
|
diff --git a/src/Nut/Extensions.php b/src/Nut/Extensions.php
index <HASH>..<HASH> 100644
--- a/src/Nut/Extensions.php
+++ b/src/Nut/Extensions.php
@@ -25,8 +25,8 @@ class Extensions extends BaseCommand
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
- if (count($this->app['extend.manager']->messages)) {
- foreach ($this->app['extend.manager']->messages as $message) {
+ if (count($this->app['extend.manager']->getMessages())) {
+ foreach ($this->app['extend.manager']->getMessages() as $message) {
$output->writeln(sprintf('<error>%s</error>', $message));
}
return;
|
fix extensions command
it try to get messages, but this property is private. Now it use
the getMessages method and it works!
|
bolt_bolt
|
train
|
php
|
5128fca5adf0998b595b0bc6dfe8a99982abc5e6
|
diff --git a/lib/Skeleton/Database/Driver/Mysqli/Statement.php b/lib/Skeleton/Database/Driver/Mysqli/Statement.php
index <HASH>..<HASH> 100644
--- a/lib/Skeleton/Database/Driver/Mysqli/Statement.php
+++ b/lib/Skeleton/Database/Driver/Mysqli/Statement.php
@@ -86,7 +86,11 @@ class Statement extends \Mysqli_Stmt {
* @access public
*/
public function execute() {
- parent::execute();
+ try {
+ parent::execute();
+ } catch (\Exception $e) {
+ throw new \Skeleton\Database\Exception\Connection($this->sqlstate . ': ' . $this->error);
+ }
if ($this->errno > 0){
throw new \Skeleton\Database\Exception\Query($this->error);
}
|
Update Statement.php
catch error when query fails
|
tigron_skeleton-database
|
train
|
php
|
6412c5851bb0e308b13efad00c70ac3031d46805
|
diff --git a/moco-runner/src/main/java/com/github/dreamhead/moco/parser/BaseParser.java b/moco-runner/src/main/java/com/github/dreamhead/moco/parser/BaseParser.java
index <HASH>..<HASH> 100644
--- a/moco-runner/src/main/java/com/github/dreamhead/moco/parser/BaseParser.java
+++ b/moco-runner/src/main/java/com/github/dreamhead/moco/parser/BaseParser.java
@@ -10,7 +10,7 @@ import java.io.InputStream;
public abstract class BaseParser<T extends Server> implements Parser<T> {
protected abstract T createServer(final ImmutableList<SessionSetting> read,
- final Optional<Integer> port, final MocoConfig[] configs);
+ final Optional<Integer> port, final MocoConfig... configs);
private final CollectionReader reader;
|
fixed create parser signature in base parser for compilation warning
|
dreamhead_moco
|
train
|
java
|
5498205e4fb8f56c9c858127027a54e6241ecc67
|
diff --git a/tests/before_travis_test.js b/tests/before_travis_test.js
index <HASH>..<HASH> 100644
--- a/tests/before_travis_test.js
+++ b/tests/before_travis_test.js
@@ -261,7 +261,7 @@ function seedDataForAuthModule() {
proc.on('close', function (code) {
console.log('step #7 process exited with code ' + code + '\n' );
- console.dir( require( 'config' ) );
+ console.dir( require( path.resolve( path.join( __dirname, '..', 'config' ) ) ) );
console.dir( require( path.resolve( path.join( __dirname, '..', 'package.json' ) ) ) );
resolve();
});
|
debug(travis): More debugging
|
CleverStack_clever-auth
|
train
|
js
|
4816b9e711a4c3616f291ee5c2f28d0d5c49e220
|
diff --git a/src/Symfony/Bundle/AsseticBundle/Command/DumpCommand.php b/src/Symfony/Bundle/AsseticBundle/Command/DumpCommand.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Bundle/AsseticBundle/Command/DumpCommand.php
+++ b/src/Symfony/Bundle/AsseticBundle/Command/DumpCommand.php
@@ -66,7 +66,12 @@ class DumpCommand extends Command
*/
protected function watch(LazyAssetManager $am, $baseDir, OutputInterface $output, $debug = false)
{
- $previously = array();
+ $cache = sys_get_temp_dir().'/assetic_watch_'.substr(sha1($baseDir), 0, 7);
+ if (file_exists($cache)) {
+ $previously = unserialize(file_get_contents($cache));
+ } else {
+ $previously = array();
+ }
while (true) {
// reload formulae when in debug
@@ -80,6 +85,7 @@ class DumpCommand extends Command
}
}
+ file_put_contents($cache, serialize($previously));
sleep(1);
}
}
|
[AsseticBundle] added a simple cache to --watch so it picks up where it left off last time
|
symfony_symfony
|
train
|
php
|
b7edab3c4690425e9e4f9dbcae9bbde4100003af
|
diff --git a/connector.go b/connector.go
index <HASH>..<HASH> 100644
--- a/connector.go
+++ b/connector.go
@@ -18,6 +18,7 @@
package siesta
import (
+ "errors"
"fmt"
"io"
"net"
@@ -25,7 +26,6 @@ import (
"strings"
"sync"
"time"
- "errors"
)
type Connector interface {
@@ -69,7 +69,7 @@ type DefaultConnector struct {
lock sync.Mutex
//offset coordination part
- offsetCoordinators map[string]int32
+ offsetCoordinators map[string]int32
}
func NewDefaultConnector(config *ConnectorConfig) *DefaultConnector {
@@ -208,9 +208,9 @@ func (this *DefaultConnector) refreshMetadata(topics []string) {
}
this.links = append(this.links, newBrokerLink(&Broker{NodeId: -1, Host: hostPort[0], Port: int32(port)},
- this.keepAlive,
- this.keepAliveTimeout,
- this.maxConnectionsPerBroker))
+ this.keepAlive,
+ this.keepAliveTimeout,
+ this.maxConnectionsPerBroker))
}
}
@@ -442,7 +442,7 @@ func correlationIdGenerator(out chan int32, stop chan bool) {
}
type rawResponseAndError struct {
- bytes []byte
- link *brokerLink
- err error
+ bytes []byte
+ link *brokerLink
+ err error
}
|
go fmt changes. re #7, re #<I>
|
elodina_siesta
|
train
|
go
|
a3797ae095354a09a35f55acea646703d700e8b3
|
diff --git a/lib/logdna/client.rb b/lib/logdna/client.rb
index <HASH>..<HASH> 100755
--- a/lib/logdna/client.rb
+++ b/lib/logdna/client.rb
@@ -49,8 +49,7 @@ module Logdna
sleep(@exception_flag ? @retry_timeout : @flush_interval)
flush if @flush_scheduled
}
- thread = Thread.new { start_timer.call }
- thread.join
+ Thread.new { start_timer.call }
end
def write_to_buffer(msg, opts)
|
Drop blocking thread.join call (#<I>)
* Drop blocking thread.join call
* Drop unused thread variable
|
logdna_ruby
|
train
|
rb
|
360990a92cf19b1ef9bcec5574d12711f356dfb5
|
diff --git a/tests/RefineryTest.php b/tests/RefineryTest.php
index <HASH>..<HASH> 100644
--- a/tests/RefineryTest.php
+++ b/tests/RefineryTest.php
@@ -215,8 +215,13 @@ class RefineryTest extends PHPUnit_Framework_TestCase
$refined = $refinery->refine($raw);
$this->assertArrayNotHasKey('namedKey', $refined);
+ $retainKey = false;
+ $refined = $refinery->refine($raw, $retainKey);
+ $this->assertArrayNotHasKey('namedKey', $refined);
+
// With Key
- $refined = $refinery->refine($raw, true);
+ $retainKey = true;
+ $refined = $refinery->refine($raw, $retainKey);
$this->assertArrayHasKey('namedKey', $refined);
}
|
added test to show default behaviour maintains functionality
|
michaeljennings_refinery
|
train
|
php
|
a31e46fb1203a326a1c5ed2703653bf7aaa4d1d1
|
diff --git a/user_guide_src/source/testing/controllers/006.php b/user_guide_src/source/testing/controllers/006.php
index <HASH>..<HASH> 100644
--- a/user_guide_src/source/testing/controllers/006.php
+++ b/user_guide_src/source/testing/controllers/006.php
@@ -1,6 +1,12 @@
<?php
-$request = new \CodeIgniter\HTTP\IncomingRequest(new \Config\App(), new URI('http://example.com'));
+$request = new \CodeIgniter\HTTP\IncomingRequest(
+ new \Config\App(),
+ new \CodeIgniter\HTTP\URI('http://example.com'),
+ null,
+ new \CodeIgniter\HTTP\UserAgent()
+);
+
$request->setLocale($locale);
$results = $this->withRequest($request)
|
Doc: Incorrect example of creating an IncomingRequest instance.
|
codeigniter4_CodeIgniter4
|
train
|
php
|
5b5ecb8f3bbcbfce1db53b46d5643d125717209a
|
diff --git a/connection.go b/connection.go
index <HASH>..<HASH> 100644
--- a/connection.go
+++ b/connection.go
@@ -585,10 +585,10 @@ func (c *connection) stopRequestingPiece(piece int) {
}
func (c *connection) updatePiecePriority(piece int) {
+ tpp := c.t.piecePriority(piece)
if !c.PeerHasPiece(piece) {
- return
+ tpp = PiecePriorityNone
}
- tpp := c.t.piecePriority(piece)
if tpp == PiecePriorityNone {
c.stopRequestingPiece(piece)
return
|
Still update a connections piece priority even if the peer doesn't have the piece
|
anacrolix_torrent
|
train
|
go
|
986db9d0e73831aae7301c5cde5a783f9a694999
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -17,7 +17,7 @@ import setuptools
setuptools.setup(
name='PyKMIP',
- version='0.1.0',
+ version='0.1.1',
description='KMIP v1.1 library',
keywords='KMIP',
author='Peter Hamilton',
|
Updating PyKMIP to <I>.
|
OpenKMIP_PyKMIP
|
train
|
py
|
f56f1740fda8989a50c1e55e23f1d543582851ec
|
diff --git a/command/inspect/command.go b/command/inspect/command.go
index <HASH>..<HASH> 100644
--- a/command/inspect/command.go
+++ b/command/inspect/command.go
@@ -33,7 +33,7 @@ func (c Command) Run(env packer.Environment, args []string) int {
}
// Read the file into a byte array so that we can parse the template
- log.Printf("Reading template: %s", args[0])
+ log.Printf("Reading template: %#v", args[0])
tpl, err := packer.ParseTemplateFile(args[0])
if err != nil {
env.Ui().Error(fmt.Sprintf("Failed to parse template: %s", err))
|
command/inspect: change logging to be %#v for better values
|
hashicorp_packer
|
train
|
go
|
867d16fff629c166a9ce58986c99c5941e4f89ba
|
diff --git a/src/Gzero/Repository/ContentRepository.php b/src/Gzero/Repository/ContentRepository.php
index <HASH>..<HASH> 100644
--- a/src/Gzero/Repository/ContentRepository.php
+++ b/src/Gzero/Repository/ContentRepository.php
@@ -500,6 +500,7 @@ class ContentRepository extends BaseRepository {
function () use ($content) {
// First we need to delete route because it's polymorphic relation
$content->route()->delete();
+ /** @TODO We also need delete the routes of all descendants **/
return $content->delete();
}
);
|
ContentRepository delete method TODO for deleting routes of all descendants
|
GrupaZero_cms
|
train
|
php
|
e50b186e40b7deb98a4381b9e682f645d987cfe6
|
diff --git a/components/fields/SubmitButtonField.js b/components/fields/SubmitButtonField.js
index <HASH>..<HASH> 100644
--- a/components/fields/SubmitButtonField.js
+++ b/components/fields/SubmitButtonField.js
@@ -37,10 +37,12 @@ class SubmitButtonField extends React.Component {
}
render() {
- const { pristine, loading, disabled } = this.props;
+ const { pristine, loading, disabled, leftIcon, rightIcon } = this.props;
return (
<ButtonField
disabled={pristine || loading || disabled}
+ leftIcon={leftIcon}
+ rightIcon={rightIcon}
type="submit"
>
{this.renderContents()}
|
Fix icons on SubmitButtonField
|
Bandwidth_shared-components
|
train
|
js
|
f104d382122624b382ded63d3ed22ecf85588ef5
|
diff --git a/admin/report/spamcleaner/index.php b/admin/report/spamcleaner/index.php
index <HASH>..<HASH> 100755
--- a/admin/report/spamcleaner/index.php
+++ b/admin/report/spamcleaner/index.php
@@ -41,10 +41,6 @@ $id = optional_param('id', '', PARAM_INT);
require_login();
admin_externalpage_setup('reportspamcleaner');
-$PAGE->requires->yui2_lib('json');
-$PAGE->requires->yui2_lib('connection');
-
-// Implement some AJAX calls
// Delete one user
if (!empty($del) && confirm_sesskey() && ($id != $USER->id)) {
|
MDL-<I> removed unnecessary yui2 includes
|
moodle_moodle
|
train
|
php
|
fc4cd496b3c5543b0d3fe5b344c9ad03817c7243
|
diff --git a/indra/tests/test_groundingmapper.py b/indra/tests/test_groundingmapper.py
index <HASH>..<HASH> 100644
--- a/indra/tests/test_groundingmapper.py
+++ b/indra/tests/test_groundingmapper.py
@@ -339,9 +339,10 @@ def test_adeft_mapping():
pmid2})])
mapped_stmts1 = gm.map_stmts([stmt1])
- assert mapped_stmts1[0].sub.name == 'ESR1'
- assert mapped_stmts1[0].sub.db_refs['HGNC'] == '3467'
- assert mapped_stmts1[0].sub.db_refs['UP'] == 'P03372'
+ assert mapped_stmts1[0].sub.name == 'ESR', \
+ mapped_stmts1[0].sub.name
+ assert mapped_stmts1[0].sub.db_refs['FPLX'] == 'ESR', \
+ mapped_stmts1[0].sub.db_refs
mapped_stmts2 = gm.map_stmts([stmt2])
assert mapped_stmts2[0].obj.name == 'endoplasmic reticulum', \
|
Update Adeft test with new grounding
|
sorgerlab_indra
|
train
|
py
|
376dc7b703d96f644d6354502b32a7cf5579917f
|
diff --git a/zipline/assets/assets.py b/zipline/assets/assets.py
index <HASH>..<HASH> 100644
--- a/zipline/assets/assets.py
+++ b/zipline/assets/assets.py
@@ -750,8 +750,11 @@ class AssetFinder(object):
# Build an Asset of the appropriate type, default to Equity
asset_type = entry.pop('asset_type', 'equity')
if asset_type.lower() == 'equity':
- fuzzy = entry['symbol'].replace(self.fuzzy_char, '') \
- if self.fuzzy_char else None
+ try:
+ fuzzy = entry['symbol'].replace(self.fuzzy_char, '') \
+ if self.fuzzy_char else None
+ except KeyError:
+ fuzzy = None
asset = Equity(**entry)
c = self.conn.cursor()
t = (asset.sid,
|
BUG: Fix exception on no symbol with fuzzy enabled
If there is no symbol there should be no fuzzy lookup either.
|
quantopian_zipline
|
train
|
py
|
d5df1e1a0af8b7eccb9d71af8b7c610c381d58ce
|
diff --git a/openxc/src/main/java/com/openxc/VehicleService.java b/openxc/src/main/java/com/openxc/VehicleService.java
index <HASH>..<HASH> 100644
--- a/openxc/src/main/java/com/openxc/VehicleService.java
+++ b/openxc/src/main/java/com/openxc/VehicleService.java
@@ -134,10 +134,11 @@ public class VehicleService extends Service {
private void notifyListeners(
Class<? extends VehicleMeasurement> measurementType,
VehicleMeasurement measurement) {
- // TODO probably want to do a coarse lock around this
- for(VehicleMeasurement.Listener listener :
- mListeners.get(measurementType)) {
- listener.receive(measurement);
+ synchronized(mListeners) {
+ for(VehicleMeasurement.Listener listener :
+ mListeners.get(measurementType)) {
+ listener.receive(measurement);
+ }
}
}
|
Lock around the listener map when notifying.
Fixed #<I>.
|
openxc_openxc-android
|
train
|
java
|
808691312feb28477a28de4d8461fc82749a5025
|
diff --git a/smartcard/pcsc/PCSCExceptions.py b/smartcard/pcsc/PCSCExceptions.py
index <HASH>..<HASH> 100644
--- a/smartcard/pcsc/PCSCExceptions.py
+++ b/smartcard/pcsc/PCSCExceptions.py
@@ -69,5 +69,5 @@ if __name__ == "__main__":
import sys
try:
raise EstablishContextException( smartcard.scard.SCARD_E_NO_MEMORY )
- except:
- print sys.exc_info()[1]
+ except BaseSCardException as exc:
+ print exc
|
Only catch BaseSCardException exceptions in the sample code
|
LudovicRousseau_pyscard
|
train
|
py
|
180b9b50442a64683dff0010987e1c5d8dfa524c
|
diff --git a/plugin.php b/plugin.php
index <HASH>..<HASH> 100644
--- a/plugin.php
+++ b/plugin.php
@@ -535,7 +535,7 @@ function json_api_default_filters( $server ) {
add_filter( 'deprecated_argument_trigger_error', '__return_false' );
// Default serving
- add_filter( 'json_serve_request', 'json_send_cors_headers' );
+ add_filter( 'json_pre_serve_request', 'json_send_cors_headers' );
add_filter( 'json_post_dispatch', 'json_send_allow_header', 10, 3 );
add_filter( 'json_pre_dispatch', 'json_handle_options_request', 10, 3 );
|
Switch CORS headers callback to new action
|
WP-API_WP-API
|
train
|
php
|
1ee38ee5f4f366091f99feda9830c170b01f986e
|
diff --git a/detox/test/android/app/src/main/java/com/example/NativeModule.java b/detox/test/android/app/src/main/java/com/example/NativeModule.java
index <HASH>..<HASH> 100644
--- a/detox/test/android/app/src/main/java/com/example/NativeModule.java
+++ b/detox/test/android/app/src/main/java/com/example/NativeModule.java
@@ -114,19 +114,8 @@ public class NativeModule extends ReactContextBaseJavaModule {
@Override
public void onViewFound(View view) {
- final ReactFindViewUtil.OnViewFoundListener onViewFoundListener = this;
- view.setOnLongClickListener(new View.OnLongClickListener() {
- @Override
- public boolean onLongClick(View v) {
- throw new IllegalStateException("Validation failed: component \"" + testID + "\" was long-tapped!!!");
- }
- });
-
- view.post(new Runnable() {
- @Override
- public void run() {
- ReactFindViewUtil.removeViewListener(onViewFoundListener);
- }
+ view.setOnLongClickListener(v -> {
+ throw new IllegalStateException("Validation failed: component \"" + testID + "\" was long-tapped!!!");
});
}
});
|
Get rid of unnecessary RN view-found listener, causing ConcurrentModificationExceptions
|
wix_Detox
|
train
|
java
|
4953161e23f9ea6cad008ad5af2f4aef7ac2bc8d
|
diff --git a/stellar_sdk/operation/allow_trust.py b/stellar_sdk/operation/allow_trust.py
index <HASH>..<HASH> 100644
--- a/stellar_sdk/operation/allow_trust.py
+++ b/stellar_sdk/operation/allow_trust.py
@@ -62,9 +62,9 @@ class AllowTrust(Operation):
authorize: Union[TrustLineEntryFlag, bool],
source: Optional[Union[MuxedAccount, str]] = None,
) -> None:
+ # We keep this class to ensure that the SDK can correctly parse historical transactions.
warnings.warn(
- "Will be removed in version v5.0.0, "
- "use `stellar_sdk.operation.set_trust_line_flags.SetTrustLineFlags` instead.",
+ "Use `stellar_sdk.operation.set_trust_line_flags.SetTrustLineFlags` instead.",
DeprecationWarning,
)
super().__init__(source)
|
chore: Amend the deprecation warning message of `AllowTrust`.
We keep this class to ensure that the SDK can correctly parse historical transactions.
|
StellarCN_py-stellar-base
|
train
|
py
|
0b9a7208a088d63aa58ae9ff6c787993c1027e54
|
diff --git a/bin/moleculer-runner.js b/bin/moleculer-runner.js
index <HASH>..<HASH> 100755
--- a/bin/moleculer-runner.js
+++ b/bin/moleculer-runner.js
@@ -141,7 +141,8 @@ function loadConfigFile() {
const ext = path.extname(filePath);
switch (ext) {
case ".json":
- case ".js": {
+ case ".js":
+ case ".ts": {
configFile = require(filePath);
break;
}
|
allow to load moleculer.config.ts file for typescript projects
|
moleculerjs_moleculer
|
train
|
js
|
e2524d0ad596560f5e4337588fd727bc9ffcec47
|
diff --git a/src/main/java/com/github/tomakehurst/wiremock/http/HttpHeaders.java b/src/main/java/com/github/tomakehurst/wiremock/http/HttpHeaders.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/github/tomakehurst/wiremock/http/HttpHeaders.java
+++ b/src/main/java/com/github/tomakehurst/wiremock/http/HttpHeaders.java
@@ -79,10 +79,6 @@ public class HttpHeaders {
return ContentTypeHeader.absent();
}
- public boolean hasContentTypeHeader() {
- return headers.containsKey(ContentTypeHeader.KEY);
- }
-
public Collection<HttpHeader> all() {
List<HttpHeader> httpHeaderList = newArrayList();
for (CaseInsensitiveKey key: headers.keySet()) {
@@ -92,11 +88,6 @@ public class HttpHeaders {
return httpHeaderList;
}
- public String put(String key, String value) {
- headers.put(caseInsensitive(key), value);
- return value;
- }
-
public Set<String> keys() {
return newHashSet(transform(headers.keySet(), new Function<CaseInsensitiveKey, String>() {
public String apply(CaseInsensitiveKey input) {
|
Removed put() completely from HttpHeaders
|
tomakehurst_wiremock
|
train
|
java
|
e82f206a94a75518b59554d6c454247eb93b2d72
|
diff --git a/activerecord/examples/simple.rb b/activerecord/examples/simple.rb
index <HASH>..<HASH> 100644
--- a/activerecord/examples/simple.rb
+++ b/activerecord/examples/simple.rb
@@ -1,4 +1,4 @@
-$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"
+require File.expand_path('../../../load_paths', __FILE__)
require 'active_record'
class Person < ActiveRecord::Base
|
activerecord/examples/simple.rb use master branch activesupport gem
|
rails_rails
|
train
|
rb
|
2ab6c9c3cc880b6ba8e7cc8ada249308e1515c1d
|
diff --git a/src/Administration/Resources/e2e/repos/administration/specs/media/folder/folder-dissolve.spec.js b/src/Administration/Resources/e2e/repos/administration/specs/media/folder/folder-dissolve.spec.js
index <HASH>..<HASH> 100644
--- a/src/Administration/Resources/e2e/repos/administration/specs/media/folder/folder-dissolve.spec.js
+++ b/src/Administration/Resources/e2e/repos/administration/specs/media/folder/folder-dissolve.spec.js
@@ -44,7 +44,6 @@ module.exports = {
browser
.click('.sw-media-modal-folder-dissolve__confirm')
- .checkNotification('Folders have been dissolved successfully', `${page.elements.notification}--1`)
.checkNotification(`Folder "${global.MediaFixtureService.mediaFolderFixture.name}" has been dissolved successfully`);
},
'verify if folder was removed and images persisted': (browser) => {
|
Translate titles of media folder dissolve messages before modal is destroyed
|
shopware_platform
|
train
|
js
|
71e924df287c586d04f8fa9667d3df1dc0c3bef6
|
diff --git a/facade/src/main/java/com/redhat/lightblue/migrator/facade/ServiceFacade.java b/facade/src/main/java/com/redhat/lightblue/migrator/facade/ServiceFacade.java
index <HASH>..<HASH> 100644
--- a/facade/src/main/java/com/redhat/lightblue/migrator/facade/ServiceFacade.java
+++ b/facade/src/main/java/com/redhat/lightblue/migrator/facade/ServiceFacade.java
@@ -109,7 +109,7 @@ public class ServiceFacade<D extends SharedStoreSetter> implements SharedStoreSe
// create ThreadPoolExecutor for all facades
if (executor == null) {
- synchronized("executor") {
+ synchronized(CONFIG_PREFIX) {
if (executor == null) {
int threadPoolSize = Integer.parseInt(this.properties.getProperty(CONFIG_PREFIX+implementationName+".threadPool.size", "50"));
@@ -419,7 +419,7 @@ public class ServiceFacade<D extends SharedStoreSetter> implements SharedStoreSe
*/
public static void shutdown() {
if (executor != null) {
- synchronized ("executor") {
+ synchronized (CONFIG_PREFIX) {
if (executor != null) {
executor.shutdown();
executor = null;
|
Per coverity: 'Locking on an interned string can cause unexpected locking collisions with third party code.'
|
lightblue-platform_lightblue-migrator
|
train
|
java
|
bffa84c620eaaa676ebc3f14f95a0c455604adb8
|
diff --git a/modules/saml2/lib/Auth/Source/SP.php b/modules/saml2/lib/Auth/Source/SP.php
index <HASH>..<HASH> 100644
--- a/modules/saml2/lib/Auth/Source/SP.php
+++ b/modules/saml2/lib/Auth/Source/SP.php
@@ -301,6 +301,7 @@ class sspmod_saml2_Auth_Source_SP extends SimpleSAML_Auth_Source {
public function onLogout($idpEntityId) {
assert('is_string($idpEntityId)');
+ /* Call the logout callback we registered in onProcessingCompleted(). */
$this->callLogoutCallback($idpEntityId);
}
@@ -324,7 +325,9 @@ class sspmod_saml2_Auth_Source_SP extends SimpleSAML_Auth_Source {
throw new Exception('Could not find authentication source with id ' . $sourceId);
}
+ /* Register a callback that we can call if we receive a logout request from the IdP. */
$source->addLogoutCallback($idp, $state);
+
$state['Attributes'] = $authProcState['Attributes'];
SimpleSAML_Auth_Source::completeAuth($state);
}
|
saml2_Auth_Source_SP: Add two comments to logout code.
|
simplesamlphp_saml2
|
train
|
php
|
94a83e98f7888572da460a81660b6f9d4d5a3e71
|
diff --git a/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReactBatchObserver.java b/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReactBatchObserver.java
index <HASH>..<HASH> 100644
--- a/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReactBatchObserver.java
+++ b/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReactBatchObserver.java
@@ -7,7 +7,6 @@ import androidx.annotation.RequiresApi;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.UIManager;
-import com.facebook.react.bridge.UIManagerListener;
import com.facebook.react.uimanager.IllegalViewOperationException;
import com.facebook.react.uimanager.LayoutShadowNode;
import com.facebook.react.uimanager.NativeViewHierarchyManager;
|
Remove unused immport from Java - not exists in RN<I> (#<I>)
## Description
Remove unused import from Java - not exists in RN<I>
|
kmagiera_react-native-reanimated
|
train
|
java
|
49c52a2e7ef9facef215c0064ffbd8732fa6bb85
|
diff --git a/worker/diskmanager/diskmanager_unsupported.go b/worker/diskmanager/diskmanager_unsupported.go
index <HASH>..<HASH> 100644
--- a/worker/diskmanager/diskmanager_unsupported.go
+++ b/worker/diskmanager/diskmanager_unsupported.go
@@ -10,3 +10,7 @@ import "github.com/juju/juju/storage"
var blockDeviceInUse = func(storage.BlockDevice) (bool, error) {
panic("not supported")
}
+
+func listBlockDevices() ([]storage.BlockDevice, error) {
+ panic("not supported")
+}
diff --git a/worker/diskmanager/lsblk.go b/worker/diskmanager/lsblk.go
index <HASH>..<HASH> 100644
--- a/worker/diskmanager/lsblk.go
+++ b/worker/diskmanager/lsblk.go
@@ -1,6 +1,8 @@
// Copyright 2014 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
+// +build linux
+
package diskmanager
import (
diff --git a/worker/diskmanager/lsblk_test.go b/worker/diskmanager/lsblk_test.go
index <HASH>..<HASH> 100644
--- a/worker/diskmanager/lsblk_test.go
+++ b/worker/diskmanager/lsblk_test.go
@@ -1,6 +1,8 @@
// Copyright 2014 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
+// +build linux
+
package diskmanager_test
import (
|
worker/diskmanager: don't build lsblk code/tests on non-Linux
|
juju_juju
|
train
|
go,go,go
|
f52f05db54dbf31e5c20fa20571cee69e56e3046
|
diff --git a/synapse/lib/certdir.py b/synapse/lib/certdir.py
index <HASH>..<HASH> 100644
--- a/synapse/lib/certdir.py
+++ b/synapse/lib/certdir.py
@@ -13,6 +13,8 @@ def iterFqdnUp(fqdn):
for i in range(len(levs)):
yield '.'.join(levs[i:])
+TEN_YEARS = 10 * 365 * 24 * 60 * 60
+
class CertDir:
def __init__(self, path=None):
@@ -510,8 +512,9 @@ class CertDir:
cert = crypto.X509()
cert.set_pubkey(pkey)
cert.set_version(2)
+ # Certpairs are good for 10 years
cert.gmtime_adj_notBefore(0)
- cert.gmtime_adj_notAfter(10 * 365 * 24 * 60 * 60)
+ cert.gmtime_adj_notAfter(TEN_YEARS)
cert.set_serial_number(int(s_common.guid(), 16))
cert.get_subject().CN = name
|
Replace magic number with a constant.
|
vertexproject_synapse
|
train
|
py
|
abe15209e068c61532c10b422d7b601692bf572f
|
diff --git a/src/components/elements/inputs/dropdown-list.js b/src/components/elements/inputs/dropdown-list.js
index <HASH>..<HASH> 100644
--- a/src/components/elements/inputs/dropdown-list.js
+++ b/src/components/elements/inputs/dropdown-list.js
@@ -19,7 +19,7 @@ export default ({ className, errors, onCommit, property, value }) => {
return { label: title, value }
})}
title={property.title}
- value={value || ''} />
+ value={value || ''} />
</div>
)
}
|
Nonsense change to trigger new build
|
cignium_hypermedia-client
|
train
|
js
|
a52afe53662149c8bb36f750d3b0513a6380b711
|
diff --git a/admin_tools/menu/forms.py b/admin_tools/menu/forms.py
index <HASH>..<HASH> 100644
--- a/admin_tools/menu/forms.py
+++ b/admin_tools/menu/forms.py
@@ -14,7 +14,7 @@ class BookmarkForm(forms.ModelForm):
self.user = user
def save(self, *args, **kwargs):
- bookmark = super(BookmarkForm, self).save(*args, commit=False, **kwargs)
+ bookmark = super(BookmarkForm, self).save(commit=False, *args, **kwargs)
bookmark.user = self.user
bookmark.save()
return bookmark
|
Apparently keyword arguments need to come before *args or python <I> has a problem.
|
django-admin-tools_django-admin-tools
|
train
|
py
|
5b6ead3e6765cfc66980ecc2532740b1da5387ed
|
diff --git a/lib/rabl-rails/renderers/plist.rb b/lib/rabl-rails/renderers/plist.rb
index <HASH>..<HASH> 100644
--- a/lib/rabl-rails/renderers/plist.rb
+++ b/lib/rabl-rails/renderers/plist.rb
@@ -8,7 +8,7 @@ module RablRails
end
def resolve_cache_key(key, data)
- "#{super}.xml"
+ "#{super}.plist"
end
end
end
|
Use correct extension when caching Plist response
|
ccocchi_rabl-rails
|
train
|
rb
|
a6cc6d1901e73fc34ef5740f05ed8089633ed77c
|
diff --git a/nano.js b/nano.js
index <HASH>..<HASH> 100644
--- a/nano.js
+++ b/nano.js
@@ -121,11 +121,11 @@ module.exports = exports = nano = function database_module(cfg) {
delete req.headers.accept; // undo headers set
}
- // make sure that all url parameters
+ // make sure that all key-based parameters
// are properly encoded as JSON, first.
var jsonify_params = function(prms) {
for(var key in prms) {
- if(prms.hasOwnProperty(key))
+ if(prms.hasOwnProperty(key) && (/(start|end|^)key$/).test(key))
if("object" !== typeof prms[key])
prms[key] = JSON.stringify(prms[key])
else
|
jsonify_params was too aggressive, this is only necessary for key-based params, not all.
|
cloudant_nodejs-cloudant
|
train
|
js
|
fca766594944c77494defe46548c1b4ccf5b9f7b
|
diff --git a/src/Sulu/Bundle/AdminBundle/DependencyInjection/Configuration.php b/src/Sulu/Bundle/AdminBundle/DependencyInjection/Configuration.php
index <HASH>..<HASH> 100644
--- a/src/Sulu/Bundle/AdminBundle/DependencyInjection/Configuration.php
+++ b/src/Sulu/Bundle/AdminBundle/DependencyInjection/Configuration.php
@@ -30,7 +30,7 @@ class Configuration implements ConfigurationInterface
$treeBuilder->root('sulu_admin')
->children()
->scalarNode('name')->defaultValue('Sulu Admin')->end()
- ->scalarNode('email')->end()
+ ->scalarNode('email')->isRequired()->end()
->scalarNode('user_data_service')->defaultValue('sulu_security.user_manager')->end()
->arrayNode('widget_groups')
->prototype('array')
|
sulu_admin.email now required
|
sulu_sulu
|
train
|
php
|
cab46894f5d20551b260ba2865896cdd806f9608
|
diff --git a/core/server/middleware/api/spam-prevention.js b/core/server/middleware/api/spam-prevention.js
index <HASH>..<HASH> 100644
--- a/core/server/middleware/api/spam-prevention.js
+++ b/core/server/middleware/api/spam-prevention.js
@@ -23,8 +23,12 @@ var ExpressBrute = require('express-brute'),
logging = require('../../logging'),
spamConfigKeys = ['freeRetries', 'minWait', 'maxWait', 'lifetime'];
+// weird, but true
handleStoreError = function handleStoreError(err) {
- return new errors.NoPermissionError({message: 'DB error', err: err});
+ err.next(new errors.NoPermissionError({
+ message: 'Unknown error',
+ err: err.parent ? err.parent : err
+ }));
};
// This is a global endpoint protection mechanism that will lock an endpoint if there are so many
|
🐛 do not return error on handleStoreError, throw it!
- ghost hangs if handleStoreError get's called
- we have to throw the error!
|
TryGhost_Ghost
|
train
|
js
|
d068bf46a262b9b92ae3edf4e975c4ebf5fdeaa8
|
diff --git a/lib/stitch.js b/lib/stitch.js
index <HASH>..<HASH> 100644
--- a/lib/stitch.js
+++ b/lib/stitch.js
@@ -72,7 +72,7 @@
this.filename = filename;
this.parent = parent;
this.ext = npath.extname(this.filename).slice(1);
- this.id = modulerize(this.filename.replace(this.parent + '/', ''));
+ this.id = modulerize(this.filename.replace(npath.join(this.parent, '/'), ''));
}
Module.prototype.compile = function() {
|
change for lib js code
|
spine_hem
|
train
|
js
|
09295b3c6b5269aa05093083c0739ba1c5fbb8dd
|
diff --git a/store.go b/store.go
index <HASH>..<HASH> 100644
--- a/store.go
+++ b/store.go
@@ -2652,8 +2652,13 @@ func (s *store) mount(id string, options drivers.MountOpts) (string, error) {
return "", err
}
+ modified, err := s.graphLock.Modified()
+ if err != nil {
+ return "", err
+ }
+
/* We need to make sure the home mount is present when the Mount is done. */
- if s.graphLock.TouchedSince(s.lastLoaded) {
+ if modified {
s.graphDriver = nil
s.layerStore = nil
s.graphDriver, err = s.getGraphDriver()
|
store: fix graphLock reload
use s.graphLock.Modified() instead of s.graphLock.TouchedSince().
TouchedSince() seems to fail in some cases when comparing the inode
mtime with the current time.
Avoid such kind of problems in a critical code path as store.mount(),
as we must be sure there is already a driver home mount present,
otherwise it the next process may cover the container mount with the
home mount.
Closes: <URL>
|
containers_storage
|
train
|
go
|
370d92ce0e011b37fa130520b187007dbe70a2c4
|
diff --git a/src/main/java/org/softee/management/DemoPojoMBeanMain.java b/src/main/java/org/softee/management/DemoPojoMBeanMain.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/softee/management/DemoPojoMBeanMain.java
+++ b/src/main/java/org/softee/management/DemoPojoMBeanMain.java
@@ -65,8 +65,7 @@ public class DemoPojoMBeanMain implements Runnable {
}
private Throwable dummyThrowable(int count) {
- Exception e = new Exception("Wrapped failure, message #" + count);
- // return new DummyException("Failed message #" + count, e); FIXME DummyException is a test source
+ Exception e = new RuntimeException("Wrapped failure, message #" + count);
return new Exception("Failed message #" + count, e);
}
|
changed exception type in demo to make a "prettier" stacktrace
|
javabits_pojo-mbean
|
train
|
java
|
937e97e464d66e9ce560897fed76e362569a6ca4
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -5,7 +5,7 @@ var defaults = {
spinnerStart: 'creating related links from npm data',
spinnerStop: 'created related links from npm data',
template: function(pkg, options) {
- var opts = utils.extend({}, options);
+ var opts = utils.extend({description: ''}, options);
var defaultTemplate = `- [<%= name %>](https://www.npmjs.com/package/<%= name %>): <%= truncate(description, 15) %> | <%= link_github(name, obj) %>`;
var str = opts.template || defaultTemplate;
return utils.render(str, pkg, opts);
|
ensure `description` exists
since it's not always defined in package.json
|
helpers_helper-related
|
train
|
js
|
02d35227b863eb746ecaa6baddc525cef15cf9a7
|
diff --git a/cmd/magnaserv/magnaserv.go b/cmd/magnaserv/magnaserv.go
index <HASH>..<HASH> 100644
--- a/cmd/magnaserv/magnaserv.go
+++ b/cmd/magnaserv/magnaserv.go
@@ -137,7 +137,9 @@ func (s *magnaserv) render(w http.ResponseWriter, r *http.Request) {
}
}
- s.sendFeedback(wsID, err, warnings, mml, mss)
+ if err != nil || warnings != nil {
+ s.sendFeedback(wsID, err, warnings, mml, mss)
+ }
if err != nil {
s.internalError(w, r, err)
|
app: only send feedback if there are errors or warnings
|
omniscale_magnacarto
|
train
|
go
|
6a3b732c72e8c946393b511be49f2d523d84fae9
|
diff --git a/lib/solr_wrapper/instance.rb b/lib/solr_wrapper/instance.rb
index <HASH>..<HASH> 100644
--- a/lib/solr_wrapper/instance.rb
+++ b/lib/solr_wrapper/instance.rb
@@ -318,7 +318,7 @@ module SolrWrapper
exit_status = runner.run(stringio)
if exit_status != 0 && cmd != 'status'
- raise "Failed to execute solr #{cmd}: #{stringio.read}. Further information may be available in #{instance_dir}/logs"
+ raise "Failed to execute solr #{cmd}: #{stringio.read}. Further information may be available in #{instance_dir}/server/logs"
end
stringio
|
fix suggested log location for further information
I found my logs in #{instance_dir}/server/logs, not #{instance_dir}/logs. Better suggestion in error message will be less confusing and save yak shaving debugging time.
|
cbeer_solr_wrapper
|
train
|
rb
|
d25c996f6ec2cf54a8b4eedc0a9c3311d11fd9d5
|
diff --git a/packages/net/csp/client.js b/packages/net/csp/client.js
index <HASH>..<HASH> 100644
--- a/packages/net/csp/client.js
+++ b/packages/net/csp/client.js
@@ -335,6 +335,9 @@ exports.CometSession = Class(function(supr) {
// TODO: possibly catch this error in production? but not in dev
this._doOnRead(data);
}
+
+ if (this.readyState != READYSTATE.CONNECTED && this.readyState != READYSTATE.DISCONNECTING) { return; }
+
// reconnect comet last, after we process all of the packet ids
this._doConnectComet();
|
fix a bug where after a comet call the ready state might go to DISCONNECTING or DISCONNECTED (callback closes the connection), but we still try to make the next comet call with a null sessionKey
|
gameclosure_js.io
|
train
|
js
|
5a253f6c87362d3b33594fa65183c33f4bc92cc3
|
diff --git a/lib/sclang.js b/lib/sclang.js
index <HASH>..<HASH> 100644
--- a/lib/sclang.js
+++ b/lib/sclang.js
@@ -47,7 +47,7 @@ var Sclang = module.exports = function (pathSclang, handler) {
*/
Sclang.prototype.init = function (pathSclang, handler) {
var sclang = path.join(pathSclang, 'sclang');
- if (!path.existsSync(sclang)) {
+ if (!fs.existsSync(sclang)) {
throw new Error(sclang + ' not found.');
}
|
[fix] path.existsSync was moved to fs.existsSync
|
kn1kn1_sc4node
|
train
|
js
|
f6dd5ced6cbc296a3c058e43e2b4568f5ee1d994
|
diff --git a/internal/core/command/rest_device.go b/internal/core/command/rest_device.go
index <HASH>..<HASH> 100644
--- a/internal/core/command/rest_device.go
+++ b/internal/core/command/rest_device.go
@@ -255,6 +255,7 @@ func restGetCommandsByDeviceName(
return
}
+ w.Header().Set(clients.ContentType, clients.ContentTypeJSON)
w.WriteHeader(http.StatusOK)
_ = json.NewEncoder(w).Encode(&devices)
}
|
Add back in a missing line in func restGetCommandsByDeviceName() for setting the ContentType that was missed during one of the several refactorings that were done in the recent past.
|
edgexfoundry_edgex-go
|
train
|
go
|
5cc458855ccc37bb277d37743f982bde5a20bbf2
|
diff --git a/glue/pipeline.py b/glue/pipeline.py
index <HASH>..<HASH> 100644
--- a/glue/pipeline.py
+++ b/glue/pipeline.py
@@ -2069,7 +2069,7 @@ class LSCDataFindJob(CondorDAGJob, AnalysisJob):
the LSCdataFind options are read.
"""
self.__executable = config_file.get('condor','datafind')
- self.__universe = 'local'
+ self.__universe = 'scheduler'
CondorDAGJob.__init__(self,self.__universe,self.__executable)
AnalysisJob.__init__(self,config_file)
self.__cache_dir = cache_dir
|
changed LSCdataFind universe from local to scheduler until condor is fixed
|
gwastro_pycbc-glue
|
train
|
py
|
5df0ed7108374da0f126d85ebee5ba75e3721e07
|
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
@@ -43,7 +43,7 @@ end
def suppressing_stderr
original_stderr = $stderr.dup
tempfile = Tempfile.new('stderr')
- $stderr.reopen(tempfile)
+ $stderr.reopen(tempfile) rescue
yield
ensure
tempfile.close!
|
sometimes suppressing_stderr helper doesn't work in textmate for some reason
|
markevans_dragonfly
|
train
|
rb
|
c47aaba3a5bb49f503d97096dbdae8086f011bd0
|
diff --git a/lib/Doctrine/MongoDB/Query/Builder.php b/lib/Doctrine/MongoDB/Query/Builder.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/MongoDB/Query/Builder.php
+++ b/lib/Doctrine/MongoDB/Query/Builder.php
@@ -698,6 +698,7 @@ class Builder
*/
public function mapReduce($map, $reduce, array $options = array())
{
+ $this->type = self::TYPE_MAP_REDUCE;
$this->mapReduce = array(
'map' => $map,
'reduce' => $reduce,
@@ -715,6 +716,7 @@ class Builder
public function map($map)
{
$this->mapReduce['map'] = $map;
+ $this->type = self::TYPE_MAP_REDUCE;
return $this;
}
@@ -727,6 +729,9 @@ class Builder
public function reduce($reduce)
{
$this->mapReduce['reduce'] = $reduce;
+ if (isset($this->mapReduce['map']) && isset($this->mapReduce['reduce'])) {
+ $this->type = self::TYPE_MAP_REDUCE;
+ }
return $this;
}
|
Fixing issue with map reduce type.
|
doctrine_mongodb
|
train
|
php
|
c4806765ca4aa50676fe97688b2c2b4b93f93418
|
diff --git a/twarc/command.py b/twarc/command.py
index <HASH>..<HASH> 100644
--- a/twarc/command.py
+++ b/twarc/command.py
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
import os
import sys
import json
|
python2 needs new print function
|
DocNow_twarc
|
train
|
py
|
4d536ff5ec28a7cfab08f5ef2e791fbe42ef0d53
|
diff --git a/health.go b/health.go
index <HASH>..<HASH> 100644
--- a/health.go
+++ b/health.go
@@ -20,6 +20,7 @@ package marathon
type HealthCheck struct {
Command *Command `json:"command,omitempty"`
PortIndex *int `json:"portIndex,omitempty"`
+ Port *int `json:"port,omitempty"`
Path *string `json:"path,omitempty"`
MaxConsecutiveFailures *int `json:"maxConsecutiveFailures,omitempty"`
Protocol string `json:"protocol,omitempty"`
@@ -40,6 +41,12 @@ func (h HealthCheck) SetPortIndex(i int) HealthCheck {
return h
}
+// SetPort sets the given port on the health check.
+func (h HealthCheck) SetPort(i int) HealthCheck {
+ h.Port = &i
+ return h
+}
+
// SetPath sets the given path on the health check.
func (h HealthCheck) SetPath(p string) HealthCheck {
h.Path = &p
|
add port in healthcheck (#<I>)
|
gambol99_go-marathon
|
train
|
go
|
a02f0e77388ade7184ab854940f98348ba55101b
|
diff --git a/nolearn/lasagne/util.py b/nolearn/lasagne/util.py
index <HASH>..<HASH> 100644
--- a/nolearn/lasagne/util.py
+++ b/nolearn/lasagne/util.py
@@ -130,7 +130,7 @@ def get_conv_infos(net, min_capacity=100. / 6, tablefmt='pipe',
MAG = ansi.MAGENTA
RED = ansi.RED
- layers = net.layers_.values()
+ layers = list(net.layers_.values())
# assume that first layer is input layer
img_size = list(net.layers_.values())[0].get_output_shape()[2:]
|
More list wraps to satisfy py3's insatiable hunger.
|
dnouri_nolearn
|
train
|
py
|
78d2640ddb657812cc64829619be152f5c1dec0c
|
diff --git a/lib/fog/aws/models/s3/file.rb b/lib/fog/aws/models/s3/file.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/aws/models/s3/file.rb
+++ b/lib/fog/aws/models/s3/file.rb
@@ -6,7 +6,7 @@ module Fog
identity :key, 'Key'
- attribute :body
+ attr_accessor :body
attribute :content_length, 'Content-Length'
attribute :content_type, 'Content-Type'
attribute :etag, ['Etag', 'ETag']
diff --git a/lib/fog/rackspace/models/files/file.rb b/lib/fog/rackspace/models/files/file.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/rackspace/models/files/file.rb
+++ b/lib/fog/rackspace/models/files/file.rb
@@ -6,7 +6,7 @@ module Fog
identity :key, 'Key'
- attribute :body
+ attr_accessor :body
attribute :content_length, 'Content-Length'
attribute :content_type, 'Content-Type'
attribute :etag, 'Etag'
|
make body not be an attribute, preventing overly aggressive lazy_loading
|
fog_fog
|
train
|
rb,rb
|
6596e9b6907f3691d87f5a096d0ffbbb18f9a2fe
|
diff --git a/tests/features/RememberableTest.php b/tests/features/RememberableTest.php
index <HASH>..<HASH> 100644
--- a/tests/features/RememberableTest.php
+++ b/tests/features/RememberableTest.php
@@ -23,7 +23,7 @@ class RememberableTest extends TestCase
{
$rememberableModel = RememberableModel::create(['name' => $this->faker->word]);
- $this->assertEquals($rememberableModel, cache()->get('RememberableModel'.$rememberableModel->id));
+ $this->assertEquals($rememberableModel, cache()->get('RememberableModel:'.$rememberableModel->id));
}
/** @test */
@@ -34,7 +34,7 @@ class RememberableTest extends TestCase
$rememberableModel->name = 'Updated';
$rememberableModel->save();
- $this->assertTrue(cache()->get('RememberableModel'.$rememberableModel->id)->name === 'Updated');
+ $this->assertTrue(cache()->get('RememberableModel:'.$rememberableModel->id)->name === 'Updated');
}
/** @test */
|
fix tests to use the ":" separator
|
laravel-enso_Rememberable
|
train
|
php
|
a12a59bc4fb5687f52510afc7a5e5e3708e018ca
|
diff --git a/lib/util/process-browser.js b/lib/util/process-browser.js
index <HASH>..<HASH> 100644
--- a/lib/util/process-browser.js
+++ b/lib/util/process-browser.js
@@ -5,7 +5,7 @@
"use strict";
-exports.process = {
+moudle.exports = {
versions: {},
nextTick(fn) {
const args = Array.prototype.slice.call(arguments, 1);
|
fix: process-browser.js
Fix browser bundling of the `process-browser.js` since it used as `require('process').versions` so the module itself is exported and not `process` as a key
|
webpack_enhanced-resolve
|
train
|
js
|
7d34930da7bc33cda4ccb8efc20900c25bb9fe57
|
diff --git a/libkbfs/block_retrieval_queue.go b/libkbfs/block_retrieval_queue.go
index <HASH>..<HASH> 100644
--- a/libkbfs/block_retrieval_queue.go
+++ b/libkbfs/block_retrieval_queue.go
@@ -217,7 +217,8 @@ func (brq *blockRetrievalQueue) notifyWorker(priority int) {
}
func (brq *blockRetrievalQueue) initPrefetchStatusCacheLocked() {
- if !brq.config.IsTestMode() {
+ if !brq.config.IsTestMode() && brq.config.Mode().Type() != InitSingleOp {
+ // Only panic if we're not using SingleOp mode.
panic("A disk block cache is required outside of tests")
}
if brq.prefetchStatusForTest != nil {
|
if we're in singleop mode, allow the block retrieval queue to use a local prefetch status cache in lieu of the disk block cache
|
keybase_client
|
train
|
go
|
00f7b0b6b65b439da74f7ad15731ae38a6cb7932
|
diff --git a/src/jcifs/smb/SmbFileInputStream.java b/src/jcifs/smb/SmbFileInputStream.java
index <HASH>..<HASH> 100644
--- a/src/jcifs/smb/SmbFileInputStream.java
+++ b/src/jcifs/smb/SmbFileInputStream.java
@@ -36,6 +36,7 @@ public class SmbFileInputStream extends InputStream {
private long fp;
private int readSize, openFlags, access;
private byte[] tmp = new byte[1];
+ private Long timeout;
SmbFile file;
@@ -79,6 +80,13 @@ public class SmbFileInputStream extends InputStream {
file.tree.session.transport.server.maxBufferSize - 70 );
}
+ /**
+ * Sets the timeout for read.
+ */
+ public void setTimeout(long timeout) {
+ timeout = new Long(timeout);
+ }
+
protected IOException seToIoe(SmbException se) {
IOException ioe = se;
Throwable root = se.getRootCause();
@@ -178,6 +186,7 @@ SmbComReadAndX request = new SmbComReadAndX( file.fid, fp, r, null );
if( file.type == SmbFile.TYPE_NAMED_PIPE ) {
request.minCount = request.maxCount = request.remaining = 1024;
}
+ request.timeout = timeout;
file.send( request, response );
} catch( SmbException se ) {
if( file.type == SmbFile.TYPE_NAMED_PIPE &&
|
added a mechanism to override the timeout
|
kohsuke_jcifs
|
train
|
java
|
2757deba1bd2332efafb1e29cac69ec882818cff
|
diff --git a/lib/packets/packet.js b/lib/packets/packet.js
index <HASH>..<HASH> 100644
--- a/lib/packets/packet.js
+++ b/lib/packets/packet.js
@@ -94,6 +94,14 @@ Packet.prototype.isEOF = function() {
return this.buffer[this.offset] == 0xfe && this.length() < 9;
};
+Packet.prototype.eofStatusFlags = function() {
+ return this.buffer.readInt16LE(this.offset + 3);
+};
+
+Packet.prototype.eofWarningCount = function() {
+ return this.buffer.readInt16LE(this.offset + 1);
+};
+
Packet.prototype.readLengthCodedNumber = function() {
var byte1 = this.readInt8();
if (byte1 < 0xfb)
|
eofStatusFlags and eofWarningCount packet methods (isEOF friends)
|
sidorares_node-mysql2
|
train
|
js
|
5d540c7bf6592e1ba6e9b54166ceb38f662cbf79
|
diff --git a/properties/array.py b/properties/array.py
index <HASH>..<HASH> 100644
--- a/properties/array.py
+++ b/properties/array.py
@@ -34,7 +34,7 @@ class Array(Property):
else:
raise Exception('Must be a float or an int: %s'%data.dtype)
- dataFile = tempfile.NamedTemporaryFile('r+', suffix='.dat')
+ dataFile = tempfile.NamedTemporaryFile('rb+', suffix='.dat')
dataFile.write(data.astype(useDtype).tobytes())
dataFile.seek(0)
return FileProp(dataFile, useDtype)
|
Fix unicode issue
In Python 3, the binary flag in the file modestring matters.
|
seequent_properties
|
train
|
py
|
4cc6e3b6558e110de54c69722d3d8ce7b4c82c5c
|
diff --git a/webpack-plugins/final-stats-writer-plugin.js b/webpack-plugins/final-stats-writer-plugin.js
index <HASH>..<HASH> 100644
--- a/webpack-plugins/final-stats-writer-plugin.js
+++ b/webpack-plugins/final-stats-writer-plugin.js
@@ -40,10 +40,19 @@ class FinalStatsWriterPlugin {
);
}
- fs.writeFileSync(
- this.config.outputPath,
- JSON.stringify(finalStats, null, 2)
- );
+ try {
+ fs.accessSync(this.config.outputPath, fs.F_OK);
+ fs.writeFileSync(
+ this.config.outputPath,
+ JSON.stringify(finalStats, null, 2)
+ );
+ } catch (error) {
+ console.warn(
+ `[FinalStatsWriterPlugin] The dist folder could not be found at ${
+ this.config.outputPath
+ }. Check the console for errors during the webpack compilation.`
+ );
+ }
}
}
|
chore(mc-scripts): do not hide real webpack error
|
commercetools_merchant-center-application-kit
|
train
|
js
|
43e8e5694237ada3526e3e5a9304c9558bd7987d
|
diff --git a/src/angular-gridster.js b/src/angular-gridster.js
index <HASH>..<HASH> 100755
--- a/src/angular-gridster.js
+++ b/src/angular-gridster.js
@@ -1831,7 +1831,7 @@
}
- var canOccupy = row > -1 && col > -1 && item.sizeX + col <= gridster.columns && item.sizeY + row <= gridster.maxRows;
+ var canOccupy = row > -1 && col > -1 && sizeX + col <= gridster.columns && sizeY + row <= gridster.maxRows;
if (canOccupy && (gridster.pushing !== false || gridster.getItems(row, col, sizeX, sizeY, item).length === 0)) {
item.row = row;
item.col = col;
|
fix(): fixed logic to get the desired size instead of current size on resize
|
ManifestWebDesign_angular-gridster
|
train
|
js
|
139b9f6a6a3d7d9986e92258bbbe68618fa84f38
|
diff --git a/algoliasearch/index.go b/algoliasearch/index.go
index <HASH>..<HASH> 100644
--- a/algoliasearch/index.go
+++ b/algoliasearch/index.go
@@ -432,16 +432,27 @@ func (i *Index) DeleteByQuery(query string, params Params) (res BatchRes, err er
copy["attributesToRetrieve"] = []string{"objectID"}
copy["hitsPerPage"] = 1000
copy["distinct"] = false
+ copy["query"] = query
- // Find all the records that match the query
- if _, err = i.Search(query, copy); err != nil {
+ // Retrieve the iterator to browse the results
+ var it IndexIterator
+ if it, err = i.BrowseAll(copy); err != nil {
return
}
- // Extract all the object IDs from the hits
- objectIDs := make([]string, res.NbHits)
- for j, hit := range res.Hits {
- objectIDs[j] = hit["objectID"]
+ // Iterate through all the objectIDs
+ var hit map[string]interface{}
+ var objectIDs []string
+ for err != nil {
+ if hit, err = it.Next(); err != nil {
+ objectIDs = append(objectIDs, hit["objectID"].(string))
+ }
+ }
+
+ // If it errored for something else than finishing the Browse properly, an
+ // error is returned.
+ if err.Error() != "No more hits" {
+ return
}
// Delete all the objects
|
Fix `Index.DeleteByQuery` by using `Browse` instead of `Search`
|
algolia_algoliasearch-client-go
|
train
|
go
|
a54ef12eb29ddd2b8f10b59944181353913366eb
|
diff --git a/src/Picqer/Financials/Exact/StockPosition.php b/src/Picqer/Financials/Exact/StockPosition.php
index <HASH>..<HASH> 100644
--- a/src/Picqer/Financials/Exact/StockPosition.php
+++ b/src/Picqer/Financials/Exact/StockPosition.php
@@ -6,6 +6,11 @@ namespace Picqer\Financials\Exact;
*
* @package Picqer\Financials\Exact
* @see https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=ReadLogisticsStockPosition
+ *
+ * @property $InStock
+ * @property $ItemId
+ * @property $PlanningIn
+ * @property $PlanningOut
*/
class StockPosition extends Model
{
|
Added @property for consistency with other entities
|
picqer_exact-php-client
|
train
|
php
|
85d4fcb47c489a5755740e703fbb1799546c9b5f
|
diff --git a/ci/taskcluster/bin/decision.py b/ci/taskcluster/bin/decision.py
index <HASH>..<HASH> 100755
--- a/ci/taskcluster/bin/decision.py
+++ b/ci/taskcluster/bin/decision.py
@@ -100,6 +100,9 @@ def main():
'expires': fromNow('364 days'), # must expire before task
},
},
+ 'features': {
+ 'taskclusterProxy': True,
+ },
},
'dependencies': dependencies,
}))
|
Enable taskcluster proxy for build and test tasks.
|
mozilla_normandy
|
train
|
py
|
c4583034f8b4e8b5714eab59d7757e28c3a663e2
|
diff --git a/allennlp/commands/evaluate.py b/allennlp/commands/evaluate.py
index <HASH>..<HASH> 100644
--- a/allennlp/commands/evaluate.py
+++ b/allennlp/commands/evaluate.py
@@ -143,7 +143,12 @@ def evaluate_from_args(args: argparse.Namespace) -> Dict[str, Any]:
logging.getLogger("allennlp.modules.token_embedders.embedding").setLevel(logging.INFO)
# Load from archive
- archive = load_archive(args.archive_file, args.cuda_device, args.overrides, args.weights_file)
+ archive = load_archive(
+ args.archive_file,
+ weights_file=args.weights_file,
+ cuda_device=args.cuda_device,
+ overrides=args.overrides,
+ )
config = archive.config
prepare_environment(config)
model = archive.model
|
Fix Bug in evaluate script (#<I>)
|
allenai_allennlp
|
train
|
py
|
5823a994a0ad05ba90bcfa02e5747113fd26ca2e
|
diff --git a/src/Illuminate/Database/Query/Builder.php b/src/Illuminate/Database/Query/Builder.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Database/Query/Builder.php
+++ b/src/Illuminate/Database/Query/Builder.php
@@ -176,7 +176,7 @@ class Builder
* @var array
*/
public $operators = [
- '=', '<', '>', '<=', '>=', '<>', '!=',
+ '=', '<', '>', '<=', '>=', '<>', '!=', '<=>',
'like', 'like binary', 'not like', 'between', 'ilike',
'&', '|', '^', '<<', '>>',
'rlike', 'regexp', 'not regexp',
|
Adding MySQL null safe operator '<=>' in operators list (#<I>)
|
laravel_framework
|
train
|
php
|
3753464f88dd0c21aa7c6e5453c7e34214a00265
|
diff --git a/lib/Request.class.php b/lib/Request.class.php
index <HASH>..<HASH> 100644
--- a/lib/Request.class.php
+++ b/lib/Request.class.php
@@ -47,7 +47,7 @@ class Request
$this->appInstance = $appInstance;
$this->upstream = $upstream;
$this->attrs = $req->attrs;
- if (Daemon::$settings['expose']) {$this->header('X-Powered-By: phpDaemon '.Daemon::$version);}
+ if (Daemon::$settings['expose']) {$this->header('X-Powered-By: phpDaemon/'.Daemon::$version);}
$this->onWakeup();
$this->init();
$this->onSleep();
@@ -294,6 +294,7 @@ class Request
$k = strtr(strtoupper($e[0]),Request::$htr);
$this->headers[$k] = $s;
if ($k === 'CONTENT_LENGTH') {$this->contentLength = (int) $e[1];}
+ if ($k === 'LOCATION') {$this->status(301);}
if (Daemon::$compatMode) {header($s);}
return TRUE;
}
|
Minor improvements of HTTP-reply headers in Request.class.php.
|
kakserpom_phpdaemon
|
train
|
php
|
54cd210ab04e34812ecbac18fa0098f1bae9474f
|
diff --git a/invoice2data/input/tesseract.py b/invoice2data/input/tesseract.py
index <HASH>..<HASH> 100644
--- a/invoice2data/input/tesseract.py
+++ b/invoice2data/input/tesseract.py
@@ -10,6 +10,6 @@ def to_text(path):
stdin=p1.stdout, stdout=subprocess.PIPE)
out, err = p2.communicate()
- extracted_str = out.decode('utf-8')
+ extracted_str = out
return extracted_str
|
Update tesseract.py (#<I>)
Removed decode method since it seems main.py already does this, resulting in trying to do this twice when using tesseract.
|
invoice-x_invoice2data
|
train
|
py
|
47aa9c7a1e8e7145d362b2bac847f5e1e7532e00
|
diff --git a/tests/Unit/Exceptions/HandlerTest.php b/tests/Unit/Exceptions/HandlerTest.php
index <HASH>..<HASH> 100644
--- a/tests/Unit/Exceptions/HandlerTest.php
+++ b/tests/Unit/Exceptions/HandlerTest.php
@@ -32,6 +32,7 @@ class HandlerTest extends TestCase
$handler->report($exception);
}
+ /** @test */
public function blacklisted_exception_types_will_not_be_logged()
{
$app = new Application;
@@ -114,7 +115,6 @@ class HandlerTest extends TestCase
$this->assertNotContains('Test Exception', $response->getBody()->getContents());
}
-
}
class HandlerWithBlacklist extends Handler
|
Add missing @test declaration
This appears to have been lost in a recent merge. Was highlighted by Coveralls as it produced a drop in code coverage.
|
Rareloop_lumberjack-core
|
train
|
php
|
8daf65a62a1f49000b3f4f555c358351c637a61d
|
diff --git a/src/utils/TimepickerMixin.js b/src/utils/TimepickerMixin.js
index <HASH>..<HASH> 100644
--- a/src/utils/TimepickerMixin.js
+++ b/src/utils/TimepickerMixin.js
@@ -438,7 +438,8 @@ export default {
time.setHours(hours)
time.setMinutes(minutes)
time.setSeconds(seconds)
- this.computedValue = new Date(time.getTime())
+
+ if (!isNaN(time.getTime())) this.computedValue = new Date(time.getTime())
}
},
|
fix bug on datetimepicker when use granularity (#<I>)
* fix bug in granularity on datetimepicker
* remove extra spaces
* move check date to mixin
|
buefy_buefy
|
train
|
js
|
04faf3dd53c9c30541dc70b2c4eee458e99c42fd
|
diff --git a/bin/init.js b/bin/init.js
index <HASH>..<HASH> 100644
--- a/bin/init.js
+++ b/bin/init.js
@@ -57,8 +57,11 @@ module.exports = function init({ isMinimal, isOverwrite, isDryRun = false }) {
if (isMinimal) {
delete clientJson.server.tls_cert;
+ delete clientJson.server.tls_cert_self_signed;
delete clientJson.server.mux;
delete clientJson.server.mux_concurrency;
+ delete clientJson.https_key;
+ delete clientJson.https_cert;
delete clientJson.dns;
delete clientJson.dns_expire;
delete clientJson.timeout;
|
bin: should delete more items in simple mode
|
blinksocks_blinksocks
|
train
|
js
|
bcab56bf6aabeee9c1a7cd826658917af9b6d676
|
diff --git a/falafel/tests/__init__.py b/falafel/tests/__init__.py
index <HASH>..<HASH> 100644
--- a/falafel/tests/__init__.py
+++ b/falafel/tests/__init__.py
@@ -9,6 +9,7 @@ from functools import wraps
from falafel.core import mapper, reducer, marshalling, plugins
from falafel.core.context import Context, PRODUCT_NAMES
from falafel.util import make_iter
+from falafel.config.specs import static_specs
logger = logging.getLogger("test.util")
@@ -91,10 +92,27 @@ def plugin_tests(module_name):
def context_wrap(lines, path='path', hostname='hostname',
- release='release', version='-1.-1', machine_id="machine_id", **kwargs):
+ release='release', version='-1.-1', machine_id="machine_id", mapper=None, **kwargs):
+
if isinstance(lines, basestring):
lines = lines.strip().splitlines()
+ is_large_content = False
+ if mapper:
+ for name in mapper.symbolic_names:
+ if static_specs[name].large_content:
+ is_large_content = True
+ break
+
+ if is_large_content:
+ filter_lines = []
+ for line in lines:
+ for f in mapper.filters:
+ if f in line:
+ filter_lines.append(line)
+ break
+ lines = filter_lines
+
return Context(content=lines,
path=path, hostname=hostname,
release=release, version=version.split('.'),
|
Add mapper argument into context_wrap function
- when specifing mapper argument, the context line will be filtered if
the mapper is large_content. This mimics how clients collect
information for large files
|
RedHatInsights_insights-core
|
train
|
py
|
bca2f18a913976a6beeda3c509ba7470a463c300
|
diff --git a/lib/rdkafka/version.rb b/lib/rdkafka/version.rb
index <HASH>..<HASH> 100644
--- a/lib/rdkafka/version.rb
+++ b/lib/rdkafka/version.rb
@@ -1,5 +1,5 @@
module Rdkafka
VERSION = "0.12.0.beta.0"
- LIBRDKAFKA_VERSION = "1.8.2"
- LIBRDKAFKA_SOURCE_SHA256 = "6a747d293a7a4613bd2897e28e8791476fbe1ae7361f2530a876e0fd483482a6"
+ LIBRDKAFKA_VERSION = "1.9.0-RC1"
+ LIBRDKAFKA_SOURCE_SHA256 = "c6aefe22ee14e8d036304bd61a5e5a61e100f0554df911fe107af1375c9f01f5"
end
|
Bump librdkafka to <I>-RC1
|
appsignal_rdkafka-ruby
|
train
|
rb
|
23964750a9621b78fd953a07478d0f184019a28d
|
diff --git a/core/server/services/members/api.js b/core/server/services/members/api.js
index <HASH>..<HASH> 100644
--- a/core/server/services/members/api.js
+++ b/core/server/services/members/api.js
@@ -22,7 +22,7 @@ async function createMember({email, name, note}, options = {}) {
}
async function getMember(data, options = {}) {
- if (!data.email && !data.id) {
+ if (!data.email && !data.id && !data.uuid) {
return Promise.resolve(null);
}
const model = await models.Member.findOne(data, options);
|
Allowed getting member by uuid
no-issue
|
TryGhost_Ghost
|
train
|
js
|
79928284439f43236ae4ba21d89aa48994b6fe0c
|
diff --git a/lib/multirepo/commands/clone-command.rb b/lib/multirepo/commands/clone-command.rb
index <HASH>..<HASH> 100644
--- a/lib/multirepo/commands/clone-command.rb
+++ b/lib/multirepo/commands/clone-command.rb
@@ -42,7 +42,7 @@ module MultiRepo
original_path = Dir.pwd
Dir.chdir(main_repo_path)
- InstallCommand.new(CLAide::ARGV.new([])).install_internal
+ InstallCommand.new(CLAide::ARGV.new([])).install_core
Dir.chdir(original_path)
diff --git a/lib/multirepo/commands/install-command.rb b/lib/multirepo/commands/install-command.rb
index <HASH>..<HASH> 100644
--- a/lib/multirepo/commands/install-command.rb
+++ b/lib/multirepo/commands/install-command.rb
@@ -13,14 +13,14 @@ module MultiRepo
Console.log_step("Cloning dependencies and installing hook...")
- install_internal
+ install_core
Console.log_step("Done!")
rescue MultiRepoException => e
Console.log_error(e.message)
end
- def install_internal
+ def install_core
config_entries = ConfigFile.load
Console.log_substep("Installing #{config_entries.count} dependencies...");
|
Renamed InstallCommand.install_internal -> install_core.
|
fortinmike_git-multirepo
|
train
|
rb,rb
|
9b184a3b143cc401360fb7cc34759b2fbf0975e2
|
diff --git a/docs-source/examples/src/main/java/com/axellience/vuegwtexamples/client/examples/melisandre/MelisandreComponentStyle.java b/docs-source/examples/src/main/java/com/axellience/vuegwtexamples/client/examples/melisandre/MelisandreComponentStyle.java
index <HASH>..<HASH> 100644
--- a/docs-source/examples/src/main/java/com/axellience/vuegwtexamples/client/examples/melisandre/MelisandreComponentStyle.java
+++ b/docs-source/examples/src/main/java/com/axellience/vuegwtexamples/client/examples/melisandre/MelisandreComponentStyle.java
@@ -1,12 +1,10 @@
package com.axellience.vuegwtexamples.client.examples.melisandre;
-import com.axellience.vuegwt.core.annotations.style.Style;
import com.google.gwt.resources.client.CssResource;
/**
* @author Adrien Baron
*/
-@Style
public interface MelisandreComponentStyle extends CssResource
{
String red();
|
Remove @Style annotation from Melisandre example style
|
VueGWT_vue-gwt
|
train
|
java
|
8d834fd9bb5703e3b72cd7141bda3fba5eccb767
|
diff --git a/doc/sphinxext/ipython_directive.py b/doc/sphinxext/ipython_directive.py
index <HASH>..<HASH> 100644
--- a/doc/sphinxext/ipython_directive.py
+++ b/doc/sphinxext/ipython_directive.py
@@ -621,6 +621,8 @@ class IpythonDirective(Directive):
shell = EmbeddedSphinxShell()
+ seen_docs = set()
+
def get_config_options(self):
# contains sphinx configuration variables
config = self.state.document.settings.env.config
@@ -644,6 +646,12 @@ class IpythonDirective(Directive):
return savefig_dir, source_dir, rgxin, rgxout, promptin, promptout
def setup(self):
+
+ if not self.state.document.current_source in self.seen_docs:
+ self.shell.IP.history_manager.reset()
+ self.shell.IP.execution_count = 1
+ self.seen_docs.add(self.state.document.current_source)
+
# get config values
(savefig_dir, source_dir, rgxin,
rgxout, promptin, promptout) = self.get_config_options()
|
DOC: update ipython_directive with changes from ipython to restart prompt number at 1 each page
|
pandas-dev_pandas
|
train
|
py
|
e109f7cbc19712bcc6ff76f374e48a35dca39195
|
diff --git a/jsonschema/tests/test_validators.py b/jsonschema/tests/test_validators.py
index <HASH>..<HASH> 100644
--- a/jsonschema/tests/test_validators.py
+++ b/jsonschema/tests/test_validators.py
@@ -1000,6 +1000,35 @@ class TestValidationErrorDetails(TestCase):
),
)
+ def test_ref(self):
+ ref, schema = "someRef", {"additionalProperties": {"type": "integer"}}
+ validator = validators.Draft7Validator(
+ {"$ref": ref},
+ resolver=validators.RefResolver("", {}, store={ref: schema}),
+ )
+ error, = validator.iter_errors({"foo": "notAnInteger"})
+
+ self.assertEqual(
+ (
+ error.message,
+ error.validator,
+ error.validator_value,
+ error.instance,
+ error.absolute_path,
+ error.schema,
+ error.schema_path,
+ ),
+ (
+ "'notAnInteger' is not of type 'integer'",
+ "type",
+ "integer",
+ "notAnInteger",
+ deque(["foo"]),
+ {"type": "integer"},
+ deque(["additionalProperties", "type"]),
+ ),
+ )
+
class MetaSchemaTestsMixin(object):
# TODO: These all belong upstream
|
Add a test for $ref's validation details.
|
Julian_jsonschema
|
train
|
py
|
eff446dbde386df25fac6c456c5c69c514251819
|
diff --git a/resources/assets/js/files.app.js b/resources/assets/js/files.app.js
index <HASH>..<HASH> 100644
--- a/resources/assets/js/files.app.js
+++ b/resources/assets/js/files.app.js
@@ -908,18 +908,5 @@ Files.App = new Class({
}).toQueryString();
return this.options.base_url ? this.options.base_url+route : route;
- },
- encodePath: function(path) {
-
- path = encodeURI(path);
-
- var replacements = {'\\?': '%3F', '#': '%23'}
-
- for(var key in replacements)
- { var regexp = new RegExp(key, 'g');
- path = path.replace(regexp, replacements[key]);
- }
-
- return path;
}
});
|
#<I> Cleanup
Method already available in Files.Row
|
joomlatools_joomlatools-framework
|
train
|
js
|
a46f9fd0fd34d2e537a057398eeccd1ce92e516a
|
diff --git a/datatables/__init__.py b/datatables/__init__.py
index <HASH>..<HASH> 100644
--- a/datatables/__init__.py
+++ b/datatables/__init__.py
@@ -170,7 +170,7 @@ class DataTables:
if col.filter:
if sys.version_info < (3, 0) \
and hasattr(tmp_row, 'encode'):
- tmp_row = col.filter(tmp_row.encode('utf-8'))
+ tmp_row = tmp_row.encode('utf-8')
tmp_row = col.filter(tmp_row)
row[col.mData if col.mData else str(j)] = tmp_row
formatted_results.append(row)
|
Fix cell's filter function to run only once.
Fixes #<I>
|
Pegase745_sqlalchemy-datatables
|
train
|
py
|
ca72a4816cf94a6c5a8b0667633a86f3a41738ce
|
diff --git a/doc/validate.js b/doc/validate.js
index <HASH>..<HASH> 100644
--- a/doc/validate.js
+++ b/doc/validate.js
@@ -35,6 +35,7 @@ const
return gpf.http[method.toLowerCase()](url).then(response => {
processed[url] = response;
if (-1 === [200, 301, 302].indexOf(response.status)) {
+ ++errors;
console.error(method.magenta, url.magenta, response.status.toString().red);
return;
} else {
|
Fails if errors found (#<I>)
|
ArnaudBuchholz_gpf-js
|
train
|
js
|
e095411f3f7684b2ad96f31abb5eba3cd7fd54da
|
diff --git a/client/karma.js b/client/karma.js
index <HASH>..<HASH> 100644
--- a/client/karma.js
+++ b/client/karma.js
@@ -118,17 +118,32 @@ var Karma = function (socket, iframe, opener, navigator, location) {
return false
}
- this.result = function (result) {
+ this.result = function (originalResult) {
+ var convertedResult = {}
+
+ // Convert all array-like objects to real arrays.
+ for (var propertyName in originalResult) {
+ if (originalResult.hasOwnProperty(propertyName)) {
+ var propertyValue = originalResult[propertyName]
+
+ if (Object.prototype.toString.call(propertyValue) === '[object Array]') {
+ convertedResult[propertyName] = Array.prototype.slice.call(propertyValue)
+ } else {
+ convertedResult[propertyName] = propertyValue
+ }
+ }
+ }
+
if (!startEmitted) {
socket.emit('start', {total: null})
startEmitted = true
}
if (resultsBufferLimit === 1) {
- return socket.emit('result', result)
+ return socket.emit('result', convertedResult)
}
- resultsBuffer.push(result)
+ resultsBuffer.push(convertedResult)
if (resultsBuffer.length === resultsBufferLimit) {
socket.emit('result', resultsBuffer)
|
fix(client): don't crash if receive array-like results
fixes #<I>
|
karma-runner_karma
|
train
|
js
|
f2265fe59d1b80bdae15831c1a1ef5a715e67de7
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@ from util.cyutil import cythonize # my version of Cython.Build.cythonize
# NOTE: distutils makes no sense
extra_link_args = []
-extra_compile_args = ['-DHMM_TEMPS_ON_HEAP']
+extra_compile_args = ['-DHMM_TEMPS_ON_HEAP','-DTEMPS_ON_STACK']
if '--with-old-clang' in sys.argv:
sys.argv.remove('--with-old-clang')
|
update setup.py to put openmp temps on stack
|
mattjj_pyhsmm
|
train
|
py
|
54d36b88f0beb2f6072cfa7f2cffa2d28850ac1c
|
diff --git a/cyphi/compute.py b/cyphi/compute.py
index <HASH>..<HASH> 100644
--- a/cyphi/compute.py
+++ b/cyphi/compute.py
@@ -268,8 +268,7 @@ def _big_mip(cache_key, subsystem):
return _null_mip(subsystem)
# Get the connectivity of just the subsystem nodes.
- submatrix_indices = np.ix_([node.index for node in subsystem.nodes],
- [node.index for node in subsystem.nodes])
+ submatrix_indices = np.ix_(subsystem.node_indices, subsystem.node_indices)
cm = subsystem.network.connectivity_matrix[submatrix_indices]
# Get the number of strongly connected components.
num_components, _ = connected_components(csr_matrix(cm))
|
Use new, simpler syntax to get subsystem indices
|
wmayner_pyphi
|
train
|
py
|
f51cfb294c060e90961e1edeb198dc9d0c6779db
|
diff --git a/api.py b/api.py
index <HASH>..<HASH> 100644
--- a/api.py
+++ b/api.py
@@ -30,7 +30,7 @@ r"""User API for the pyemma.msm package
__docformat__ = "restructuredtext en"
from pyemma.msm.estimators.maximum_likelihood_hmsm import MaximumLikelihoodHMSM as _HMSMEstimator
-from pyemma.msm.estimators.msm_bayesian_estimator import BayesianMSM as _BayesianMSMEstimator
+from pyemma.msm.estimators.bayesian_msm import BayesianMSM as _BayesianMSMEstimator
from pyemma.msm.estimators.bayesian_hmsm import BayesianHMSM as _BayesianHMSMEstimator
from flux import tpt as tpt_factory
|
[msm.api]: dragging refactor along
|
markovmodel_msmtools
|
train
|
py
|
accaa2159bf2329002040087f3ba417366ae6939
|
diff --git a/gns3server/server.py b/gns3server/server.py
index <HASH>..<HASH> 100644
--- a/gns3server/server.py
+++ b/gns3server/server.py
@@ -85,7 +85,7 @@ class Server:
"""
if self._handler:
- yield from self._handler.finish_connections(1.0)
+ yield from self._handler.finish_connections()
self._handler = None
for module in MODULES:
@@ -253,6 +253,6 @@ class Server:
log.warning("TypeError exception in the loop {}".format(e))
finally:
if self._handler:
- self._loop.run_until_complete(self._handler.finish_connections(1.0))
+ self._loop.run_until_complete(self._handler.finish_connections())
server.close()
self._loop.run_until_complete(app.finish())
|
Remove timeout to wait for connections to finish.
|
GNS3_gns3-server
|
train
|
py
|
04f3e4ae946a88714136c780ad3d85c7392a4490
|
diff --git a/lib/Sabre/DAV/Version.php b/lib/Sabre/DAV/Version.php
index <HASH>..<HASH> 100644
--- a/lib/Sabre/DAV/Version.php
+++ b/lib/Sabre/DAV/Version.php
@@ -14,7 +14,7 @@ class Sabre_DAV_Version {
/**
* Full version number
*/
- const VERSION = '1.5.7';
+ const VERSION = '1.5.8';
/**
* Stability : alpha, beta, stable
|
Making sure the main package gets the correct version too
|
sabre-io_dav
|
train
|
php
|
02b2a168651c08f14011ea1582d8d05f8bcd4716
|
diff --git a/src/test/org/openscience/cdk/ElementTest.java b/src/test/org/openscience/cdk/ElementTest.java
index <HASH>..<HASH> 100644
--- a/src/test/org/openscience/cdk/ElementTest.java
+++ b/src/test/org/openscience/cdk/ElementTest.java
@@ -27,6 +27,7 @@ import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.interfaces.IChemObject;
import org.openscience.cdk.interfaces.IChemObjectBuilder;
import org.openscience.cdk.interfaces.IElement;
+import org.openscience.cdk.tools.diff.ElementDiff;
/**
* Checks the functionality of the Element class.
@@ -97,6 +98,12 @@ public class ElementTest extends NewCDKTestCase {
Assert.assertTrue(clone instanceof IElement);
}
+ @Test public void testCloneDiff() throws Exception {
+ IElement elem = builder.newElement();
+ IElement clone = (IElement)elem.clone();
+ Assert.assertEquals("", ElementDiff.diff(elem, clone));
+ }
+
@Test public void testClone_Symbol() throws Exception {
IElement elem = builder.newElement("C");
IElement clone = (IElement)elem.clone();
|
Added clone test using the new diff tools
git-svn-id: <URL>
|
cdk_cdk
|
train
|
java
|
f6a3e506e408518da07a50f1749743416d5ea512
|
diff --git a/pkg/maps/lbmap/types.go b/pkg/maps/lbmap/types.go
index <HASH>..<HASH> 100644
--- a/pkg/maps/lbmap/types.go
+++ b/pkg/maps/lbmap/types.go
@@ -17,6 +17,7 @@ package lbmap
import (
"fmt"
"net"
+ "strings"
"unsafe"
"github.com/cilium/cilium/pkg/bpf"
@@ -31,6 +32,12 @@ import (
// consists of "IP:PORT"
type BackendAddrID string
+// IsIPv6 detects in a dirty way whether the given backend addr ID belongs to
+// the ipv6 backend.
+func (b BackendAddrID) IsIPv6() bool {
+ return strings.HasPrefix(string(b), "[")
+}
+
// ServiceKey is the interface describing protocol independent key for services map.
type ServiceKey interface {
bpf.MapKey
|
lbmap: Add BackendAddrID.IsIPv6 method
This method detects (in a dirty way) whether a backend identified with
the given addrID is of the ipv6 type.
It will be used when removing orphan backends from the BPF maps.
|
cilium_cilium
|
train
|
go
|
44c2edd0300a1e3fe6e31143d8373f65be41b2dd
|
diff --git a/packages/gluestick/src/commands/start.js b/packages/gluestick/src/commands/start.js
index <HASH>..<HASH> 100644
--- a/packages/gluestick/src/commands/start.js
+++ b/packages/gluestick/src/commands/start.js
@@ -108,7 +108,8 @@ module.exports = (commandApi: CommandAPI, commandArguments: any[]) => {
});
}
})
- .catch(() => {
+ .catch(e => {
+ logger.error(e);
logger.fatal(
"Some tests have failed, client and server won't be compiled and executed",
);
|
Log error on development start failure. (#<I>)
* Log error on development start failure.
Log error object from promise rejection instead of logging a generic error.
* fix lint issues, match pattern in file
|
TrueCar_gluestick
|
train
|
js
|
6b2a275d3cdd7e8e57edec116787ffca4de7dd2b
|
diff --git a/lzwCompress.js b/lzwCompress.js
index <HASH>..<HASH> 100644
--- a/lzwCompress.js
+++ b/lzwCompress.js
@@ -76,7 +76,7 @@
}
for (var prop in obj) {
if (!Array.isArray(obj)) {
- if (obj.hasOwnProperty(prop)) {
+ if (obj.hasOwnProperty(prop) && _keys[prop]) {
obj[_keys[prop]] = _decode(obj[prop]);
delete obj[prop];
}
|
fixes #5 - guard against spurious property enumeration in IE 8
|
floydpink_lzwCompress.js
|
train
|
js
|
4f1c292fa144866b0377b4b581516d395e5be1df
|
diff --git a/src/js/components/Select/stories/ManyOptions.js b/src/js/components/Select/stories/ManyOptions.js
index <HASH>..<HASH> 100644
--- a/src/js/components/Select/stories/ManyOptions.js
+++ b/src/js/components/Select/stories/ManyOptions.js
@@ -1,20 +1,15 @@
-import React, { PureComponent } from 'react';
+import React from 'react';
import { storiesOf } from '@storybook/react';
import { Box, CheckBox, Grommet, Select } from 'grommet';
import { grommet } from 'grommet/themes';
-class Option extends PureComponent {
- render() {
- const { value, selected } = this.props;
- return (
- <Box direction="row" gap="small" align="center" pad="xsmall">
- <CheckBox tabIndex="-1" checked={selected} onChange={() => {}} />
- {value}
- </Box>
- );
- }
-}
+const Option = React.memo(({ value, selected }) => (
+ <Box direction="row" gap="small" align="center" pad="xsmall">
+ <CheckBox tabIndex="-1" checked={selected} onChange={() => {}} />
+ {value}
+ </Box>
+));
const dummyOptions = Array(2000)
.fill()
|
"chore: refactor Option class to functional comp" (#<I>)
* "chore: refactor Option class to functional comp"
|
grommet_grommet
|
train
|
js
|
d523ad2f0bee7a1b743e7c2cbdea953c123713d2
|
diff --git a/moderngl/texture_3d.py b/moderngl/texture_3d.py
index <HASH>..<HASH> 100644
--- a/moderngl/texture_3d.py
+++ b/moderngl/texture_3d.py
@@ -223,7 +223,7 @@ class Texture3D:
# Reading pixel data into a buffer
data = ctx.buffer(reserve=8)
- texture = ctx.texture3d((2, 2), 1)
+ texture = ctx.texture3d((2, 2, 2), 1)
texture.read_into(data)
Args:
|
fix texture3d write example (#<I>)
|
moderngl_moderngl
|
train
|
py
|
3a7b841db662a443d4eabc3859972bd39bc03bbf
|
diff --git a/src/Application.php b/src/Application.php
index <HASH>..<HASH> 100644
--- a/src/Application.php
+++ b/src/Application.php
@@ -119,15 +119,15 @@ class Application extends Silex\Application
// Initialize Twig and our rendering Provider.
$this->initRendering();
- // Initialize debugging
- $this->initDebugging();
-
// Initialize the Database Providers.
$this->initDatabase();
// Initialize the rest of the Providers.
$this->initProviders();
+ // Initialize debugging
+ $this->initDebugging();
+
// Do a version check
$this['config.environment']->checkVersion();
@@ -264,9 +264,6 @@ class Application extends Silex\Application
);
}
- /**
- * @deprecated Deprecated since 3.0, to be removed in 4.0. Use {@see ControllerEvents::MOUNT} instead.
- */
public function initExtensions()
{
$this['extensions']->addManagedExtensions();
|
Move initDebugging to after most providers
|
bolt_bolt
|
train
|
php
|
4e1e450cd71801946bc692469bd0391103ce47d0
|
diff --git a/openquake/engine/engine.py b/openquake/engine/engine.py
index <HASH>..<HASH> 100644
--- a/openquake/engine/engine.py
+++ b/openquake/engine/engine.py
@@ -94,8 +94,10 @@ def job_stats(job):
job.is_running = True
job.save()
try:
- with django_db.transaction.commit_on_success('job_init'):
- yield
+ yield
+ except:
+ django_db.connections['job_init'].rollback()
+ raise
finally:
job.is_running = False
job.save()
|
Removed a transaction and added a rollback instead
|
gem_oq-engine
|
train
|
py
|
206e8a5ac7fc6870cb1b1d2e293f163fc7ca1e9b
|
diff --git a/spacy/lang/uk/lemmatizer.py b/spacy/lang/uk/lemmatizer.py
index <HASH>..<HASH> 100644
--- a/spacy/lang/uk/lemmatizer.py
+++ b/spacy/lang/uk/lemmatizer.py
@@ -70,7 +70,7 @@ class UkrainianLemmatizer(Lemmatizer):
if (
feature in morphology
and feature in analysis_morph
- and morphology[feature] != analysis_morph[feature]
+ and morphology[feature].lower() != analysis_morph[feature].lower()
):
break
else:
|
Also apply hotfix to Ukrainian lemmaitzer
|
explosion_spaCy
|
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.