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
7015ef60cd0315a17473e6791a4376f9a69bc110
diff --git a/src/utils/ViewUtils.js b/src/utils/ViewUtils.js index <HASH>..<HASH> 100644 --- a/src/utils/ViewUtils.js +++ b/src/utils/ViewUtils.js @@ -398,6 +398,8 @@ define(function (require, exports, module) { if (i >= 0) { // Escape all HTML-sensitive characters in filename. name = _.escape(name.substring(0, i)) + "<span class='extension'>" + _.escape(name.substring(i)) + "</span>"; + } else { + name = _.escape(name); } return name;
Escape html-sensitive characters for any file/folder without the extension.
adobe_brackets
train
js
a92b6804054ae7c78a9ef405f2bb41d2d552f710
diff --git a/templates/refinery/edge.rb b/templates/refinery/edge.rb index <HASH>..<HASH> 100644 --- a/templates/refinery/edge.rb +++ b/templates/refinery/edge.rb @@ -1,6 +1,7 @@ gem 'refinerycms', :git => 'git://github.com/resolve/refinerycms.git' run 'bundle install' generate 'refinery:cms' +rake 'railties:install:migrations' rake 'db:migrate' append_file 'Gemfile' do
When installing from edge, ensure we install the railties migrations using the appropriate task.
refinery_refinerycms
train
rb
ec53800657dc6b151e9459dd2c0a291a14b9d4e5
diff --git a/lib/hetchy/reservoir.rb b/lib/hetchy/reservoir.rb index <HASH>..<HASH> 100644 --- a/lib/hetchy/reservoir.rb +++ b/lib/hetchy/reservoir.rb @@ -46,9 +46,9 @@ module Hetchy # with data from our intended period. # def snapshot - @lock.synchronize do - Dataset.new(@pool.dup) - end + data = nil + @lock.synchronize { data = @pool.dup } + Dataset.new(data) end private
Only block mutex for duplication of pool data Dataset initialization is getting a bit more complex, no need to block threads on that work since we really only need it for duplicating the pool
nextmat_hetchy
train
rb
fc4906789c37c3879967c0014bce8a244ce79e89
diff --git a/spotify/models/base.py b/spotify/models/base.py index <HASH>..<HASH> 100644 --- a/spotify/models/base.py +++ b/spotify/models/base.py @@ -85,6 +85,9 @@ class URIBase(SpotifyBase): - Casting to a string will return the uri of the object. """ + def __hash__(self): + return hash(self.uri) # pylint: disable=no-member + def __eq__(self, other): return ( type(self) is type(other) and self.uri == other.uri
Make `URIBase` derived classes hashable
mental32_spotify.py
train
py
7f05967cf5e271b57d848cb985cba4ad747a9d77
diff --git a/config/web.php b/config/web.php index <HASH>..<HASH> 100644 --- a/config/web.php +++ b/config/web.php @@ -7,7 +7,7 @@ return array( 'modules' => array( 'debug' => array( 'class' => 'yii\debug\Module', - 'enabled' => YII_DEBUG && YII_ENV === 'dev', + 'enabled' => YII_DEBUG && YII_ENV_DEV, ), ), 'components' => array( diff --git a/controllers/SiteController.php b/controllers/SiteController.php index <HASH>..<HASH> 100644 --- a/controllers/SiteController.php +++ b/controllers/SiteController.php @@ -14,7 +14,7 @@ class SiteController extends Controller return array( 'captcha' => array( 'class' => 'yii\web\CaptchaAction', - 'fixedVerifyCode' => YII_ENV === 'test' ? 'testme' : null, + 'fixedVerifyCode' => YII_ENV_DEV ? 'testme' : null, ), ); }
Added more YII_ENV constants.
yiisoft_yii2-app-basic
train
php,php
a8f470a1b50feee2bea956c1a58e6b2337647065
diff --git a/lib/biopsy.rb b/lib/biopsy.rb index <HASH>..<HASH> 100644 --- a/lib/biopsy.rb +++ b/lib/biopsy.rb @@ -1,5 +1,21 @@ require "biopsy/version" module Biopsy - # Your code goes here... + + class File + + # extend the File class to add File::which method. + # returns the full path to the supplied cmd, + # if it exists in any location in PATH + def self.which(cmd) + exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : [''] + ENV['PATH'].split(File::PATH_SEPARATOR).each do |path| + exts.each { |ext| + exe = File.join(path, "#{cmd}#{ext}") + return exe if File.executable? exe + } + end + return nil + end + end
add which method to File Former-commit-id: edd7e8fcc<I>fdb<I>f1c<I>bb6f<I>
blahah_biopsy
train
rb
e6dd3f2a9dbddf4019a3b1f01f97e6b498c803fe
diff --git a/test/basic.js b/test/basic.js index <HASH>..<HASH> 100644 --- a/test/basic.js +++ b/test/basic.js @@ -123,7 +123,7 @@ test('sdpTransform function is called', function (t) { }) test('old constraint formats are used', function (t) { - t.plan(1) + t.plan(3) var constraints = { mandatory: { @@ -145,11 +145,13 @@ test('old constraint formats are used', function (t) { peer1.on('connect', function () { t.pass('peers connected') + peer1.destroy(function () { t.pass('peer1 destroyed') }) + peer2.destroy(function () { t.pass('peer2 destroyed') }) }) }) test('new constraint formats are used', function (t) { - t.plan(1) + t.plan(3) var constraints = { offerToReceiveAudio: true, @@ -169,5 +171,7 @@ test('new constraint formats are used', function (t) { peer1.on('connect', function () { t.pass('peers connected') + peer1.destroy(function () { t.pass('peer1 destroyed') }) + peer2.destroy(function () { t.pass('peer2 destroyed') }) }) })
fix stalled tests cc @RationalCoding
feross_simple-peer
train
js
48da6559fb64e4d19eb71f6c896b78835118fe1a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -72,11 +72,7 @@ setup( # You can just specify the packages manually here if your project is # simple. Or you can use find_packages(). - packages=find_packages(exclude=['contrib', 'docs', 'tests', - 'multinomial_asym_logit_3', - 'multinomial_uneven_logit_2', - 'multinomial_scobit_2', - 'multinomial_clog_log_2']), + packages=find_packages(exclude=['contrib', 'docs', 'tests']), # Alternatively, if you want to distribute just a my_module.py, uncomment # this: @@ -120,4 +116,4 @@ setup( # 'sample=sample:main', # ], # }, -) \ No newline at end of file +)
Update setup.py to include all models
timothyb0912_pylogit
train
py
456d7c98c045e1e5cf5320592e5395d683db16a4
diff --git a/src/define/class/check.js b/src/define/class/check.js index <HASH>..<HASH> 100644 --- a/src/define/class/check.js +++ b/src/define/class/check.js @@ -90,7 +90,7 @@ function _gpfDefineClassDecontextifyExtend (extend) { return extend; } -Object.assign(_GpfClassDefinition.prototype, /** @lends _gpfClassDefinition.prototype */ { +Object.assign(_GpfClassDefinition.prototype, { /** * @inheritdoc
Removes @lends that is automated (#<I>)
ArnaudBuchholz_gpf-js
train
js
3aac5a8b501797f8c0e2f39e8be8911aca03f62b
diff --git a/lib/path.js b/lib/path.js index <HASH>..<HASH> 100644 --- a/lib/path.js +++ b/lib/path.js @@ -15,7 +15,7 @@ module.exports = function (to, options, callback) { loadPaths: [] }, options); - var filePaths = options.loadPaths.map(function (loadPath) { + var filePaths = [].concat(options.loadPaths).map(function (loadPath) { return path.resolve(options.basePath, loadPath, to); }); diff --git a/test/path.js b/test/path.js index <HASH>..<HASH> 100644 --- a/test/path.js +++ b/test/path.js @@ -27,6 +27,15 @@ test('loadPaths', function (t) { }, t.fail); }); +test('loadPaths string', function (t) { + return resolvePath('picture.png', { + loadPaths: 'fixtures/images' + }) + .then(function (resolvedPath) { + t.is(resolvedPath, path.resolve('fixtures/images/picture.png')); + }, t.fail); +}); + test('basePath + loadPaths', function (t) { return resolvePath('picture.png', { basePath: 'fixtures',
Allow string to be passed as loadPaths
borodean_assets
train
js,js
4531955fb8b68bb37dfa5c0bd41a2c8324476956
diff --git a/extension/phantom-pdf/lib/phantom.js b/extension/phantom-pdf/lib/phantom.js index <HASH>..<HASH> 100644 --- a/extension/phantom-pdf/lib/phantom.js +++ b/extension/phantom-pdf/lib/phantom.js @@ -79,7 +79,7 @@ Phantom.prototype.execute = function (request, response) { return q.nfcall(conversion, phantomOptions); }).then(function (res) { - request.options.isRootRequest = true; + request.options.isChildRequest = false; response.result = res.stream; response.headers["Content-Type"] = "application/pdf"; response.headers["Content-Disposition"] = "inline; filename=\"report.pdf\""; @@ -100,7 +100,7 @@ Phantom.prototype._processHeaderFooter = function (phantomOptions, request, type var req = extend(true, {}, request); req.template = {content: phantomOptions[type], recipe: "html", helpers: request.template.helpers, engine: request.template.engine}; req.data = extend(true, {}, request.data); - req.options.isRootRequest = false; + req.options.isChildRequest = true; return this.reporter.render(req).then(function (resp) { phantomOptions[type] = resp.result;
change isRootRequest into isChildRequest
jsreport_jsreport-phantom-pdf
train
js
865135848299ef91e25443a05f833831eb959c20
diff --git a/hazelcast-client/src/main/java/com/hazelcast/client/cache/impl/AbstractClientCacheProxy.java b/hazelcast-client/src/main/java/com/hazelcast/client/cache/impl/AbstractClientCacheProxy.java index <HASH>..<HASH> 100644 --- a/hazelcast-client/src/main/java/com/hazelcast/client/cache/impl/AbstractClientCacheProxy.java +++ b/hazelcast-client/src/main/java/com/hazelcast/client/cache/impl/AbstractClientCacheProxy.java @@ -115,7 +115,7 @@ abstract class AbstractClientCacheProxy<K, V> extends AbstractClientInternalCach ClientMessage request = CacheGetCodec.encodeRequest(nameWithPrefix, keyData, expiryPolicyData); ClientInvocationFuture future; try { - final int partitionId = clientContext.getPartitionService().getPartitionId(key); + final int partitionId = clientContext.getPartitionService().getPartitionId(keyData); final HazelcastClientInstanceImpl client = (HazelcastClientInstanceImpl) clientContext.getHazelcastInstance(); final ClientInvocation clientInvocation = new ClientInvocation(client, request, partitionId); future = clientInvocation.invoke();
Used binary key to find partition id
hazelcast_hazelcast
train
java
8f11bfd932d9cfb6c8466ad9299f02c73066034f
diff --git a/src/pipeline-provider.js b/src/pipeline-provider.js index <HASH>..<HASH> 100644 --- a/src/pipeline-provider.js +++ b/src/pipeline-provider.js @@ -26,6 +26,7 @@ export class PipelineProvider { //NOTE: app state changes start below - point of no return DeactivatePreviousStep, //optional ActivateNextStep, //optional + createRouteFilterStep('precommit'), CommitChangesStep ]; } @@ -35,4 +36,4 @@ export class PipelineProvider { this.steps.forEach(step => pipeline.withStep(this.container.get(step))); return pipeline; } -} \ No newline at end of file +}
feat(router): Add a precommit extension point to the pipeline
aurelia_router
train
js
102f2dac8f81316bfb8ee8e70e3207f5f03e831d
diff --git a/client/lib/site-specific-plans-details-list/index.js b/client/lib/site-specific-plans-details-list/index.js index <HASH>..<HASH> 100644 --- a/client/lib/site-specific-plans-details-list/index.js +++ b/client/lib/site-specific-plans-details-list/index.js @@ -2,6 +2,7 @@ * External dependencies */ var debug = require( 'debug' )( 'calypso:site-specific-plans-details-list' ), + find = require( 'lodash/collection/find' ), store = require( 'store' ); /** @@ -57,6 +58,10 @@ SiteSpecificPlansDetailsList.prototype.hasJpphpBundle = function( siteDomain ) { return this.get( siteDomain, 'host-bundle' ).current_plan; }; +SiteSpecificPlansDetailsList.prototype.getCurrentPlan = function( siteDomain ) { + return find( this.data[ siteDomain ], { current_plan: true } ); +}; + /** * Fetch the site specific plan data from WordPress.com via the REST API. *
Plans: Add method to retrieve the current plan from the Site Specific Plans Details List component
Automattic_wp-calypso
train
js
07371d80e23a4c1a4928f2e235802282a7de5339
diff --git a/src/kit/ui/CollectionComponent.js b/src/kit/ui/CollectionComponent.js index <HASH>..<HASH> 100644 --- a/src/kit/ui/CollectionComponent.js +++ b/src/kit/ui/CollectionComponent.js @@ -46,8 +46,4 @@ class EditableCollection extends ContainerEditor { _getClassNames () { return 'sc-collection sc-container-editor sc-surface' } - - isDisabled () { - return this.props.disabled || this.props.readOnly - } }
Remove wrong implementation from CollectionComponent.
substance_texture
train
js
e506e75f8d135cf03fa2104beca5c5d4ae9e1f2e
diff --git a/uilib-docs/src/templates/component.js b/uilib-docs/src/templates/component.js index <HASH>..<HASH> 100644 --- a/uilib-docs/src/templates/component.js +++ b/uilib-docs/src/templates/component.js @@ -152,25 +152,26 @@ export default class ComponentTemplate extends Component { const notes = componentInfo.notes ? componentInfo.notes.split(';') : undefined; - + + const examples = _.split(componentInfo.example, ','); return ( <div className="docs-page"> <div className="docs-page__content"> <h1 className="title inline">{selectedComponent.displayName}</h1> - {componentInfo.example && ( - <span className="code-example"> - ( - <a - className="inline" - target="_blank" - rel="noopener noreferrer" - href={componentInfo.example} - > - code example - </a> - ) - </span> - )} + {_.map(examples, example => { + return <span className="code-example"> + ( + <a + className="inline" + target="_blank" + rel="noopener noreferrer" + href={example} + > + code example + </a> + ) + </span> + })} <h3>{componentInfo.description}</h3> {componentInfo.extends && (
update component page template to support multiple example links
wix_react-native-ui-lib
train
js
74dcffebe26586c193e872cce10648869e3e7300
diff --git a/johnny/transaction.py b/johnny/transaction.py index <HASH>..<HASH> 100644 --- a/johnny/transaction.py +++ b/johnny/transaction.py @@ -18,6 +18,7 @@ class TransactionManager(object): On rollback, it will flush all local caches On commit, it will push them up to the cache backend """ + _patched = False def __init__(self, cache_backend): self.cache_backend = cache_backend @@ -82,10 +83,8 @@ class TransactionManager(object): def patch(self): """ - This function monkey patches enter_transaction_management, - leave_transaction_management, set_clean, and set_dirty - to track the entering and leaving of transactions. If we're in transactions, - writes to the cache should not happen until commit. + This function monkey patches commit and rollback + writes to the cache should not happen until commit (unless our state isn't managed). It does not yet support savepoints. """ if not self._patched:
Change _patched to a global variable in TransactionManager
jmoiron_johnny-cache
train
py
f14bd552700a888b9af757d7a25ed487f24a0a19
diff --git a/src/com/radiusnetworks/ibeacon/service/IBeaconService.java b/src/com/radiusnetworks/ibeacon/service/IBeaconService.java index <HASH>..<HASH> 100644 --- a/src/com/radiusnetworks/ibeacon/service/IBeaconService.java +++ b/src/com/radiusnetworks/ibeacon/service/IBeaconService.java @@ -312,7 +312,14 @@ public class IBeaconService extends Service { scanning = true; scanningPaused = false; try { - bluetoothAdapter.startLeScan(leScanCallback); + if (bluetoothAdapter != null) { + if (bluetoothAdapter.isEnabled()) { + bluetoothAdapter.startLeScan(leScanCallback); + } + else { + Log.w(TAG, "Bluetooth is disabled. Cannot scan for iBeacons."); + } + } } catch (Exception e) { Log.e("TAG", "Exception starting bluetooth scan. Perhaps bluetooth is disabled or unavailable?"); @@ -325,7 +332,14 @@ public class IBeaconService extends Service { } else { Log.d(TAG, "disabling scan"); scanning = false; - bluetoothAdapter.stopLeScan(leScanCallback); + if (bluetoothAdapter != null) { + if (bluetoothAdapter.isEnabled()) { + bluetoothAdapter.stopLeScan(leScanCallback); + } + else { + Log.w(TAG, "Bluetooth is disabled. Cannot scan for iBeacons."); + } + } } processExpiredMonitors(); }
check if bluetooth is disabled before starting/stopping scan to prevent application not responding
AltBeacon_android-beacon-library
train
java
6fae1db99d6e47be98321b23d120abe0376bbf3b
diff --git a/bcbio/graph/graph.py b/bcbio/graph/graph.py index <HASH>..<HASH> 100644 --- a/bcbio/graph/graph.py +++ b/bcbio/graph/graph.py @@ -293,7 +293,7 @@ def rawfile_within_timeframe(rawfile, timeframe): ftime = datetime.strptime(matches.group(1), "%Y%m%d") ftime = pytz.utc.localize(ftime) - return ftime > timeframe[0] and ftime <= timeframe[1] + return ftime.date() >= timeframe[0].date() and ftime.date() <= timeframe[1].date() def resource_usage(bcbio_log, cluster, rawdir, verbose): @@ -399,9 +399,9 @@ def generate_graphs(data_frames, hardware_info, steps, outdir, print('Serializing output to pickle object for node {}...'.format(host)) # "Clean" dataframes ready to be plotted - collectl_info[host] = { "hardware": hardware_info, - "steps": steps, "cpu": data_cpu, "mem": data_mem, - "disk": data_disk, "net_bytes": data_net_bytes, + collectl_info[host] = { "hardware": hardware_info, + "steps": steps, "cpu": data_cpu, "mem": data_mem, + "disk": data_disk, "net_bytes": data_net_bytes, "net_pkts": data_net_pkts } return collectl_info
Normalize dates to YY:MM:DD for comparison
bcbio_bcbio-nextgen
train
py
5b7380a710d15713a8c9f0bd9b859440e5b2fa22
diff --git a/tests/framework/test/ActiveFixtureTest.php b/tests/framework/test/ActiveFixtureTest.php index <HASH>..<HASH> 100644 --- a/tests/framework/test/ActiveFixtureTest.php +++ b/tests/framework/test/ActiveFixtureTest.php @@ -48,8 +48,9 @@ abstract class ActiveFixtureTest extends DatabaseTestCase public function setUp() { parent::setUp(); - \Yii::$app->set('db', $this->getConnection()); - ActiveRecord::$db = $this->getConnection(); + $db = $this->getConnection(); + \Yii::$app->set('db', $db); + ActiveRecord::$db = $db; } public function tearDown()
use the same db connection for reading and writing data obviously the test should use the same db in both cases :-D
yiisoft_yii-core
train
php
bc79d701cd480e74f899834f0b87180cfa6b60a5
diff --git a/models/classes/class.ResultsService.php b/models/classes/class.ResultsService.php index <HASH>..<HASH> 100755 --- a/models/classes/class.ResultsService.php +++ b/models/classes/class.ResultsService.php @@ -702,7 +702,7 @@ class taoResults_models_classes_ResultsService case "file": { $value = (base64_decode($this->getVariableValue($variableUri))); - common_Logger::i(var_export(strlen($value))); + common_Logger::i(var_export(strlen($value), true)); $decodedFile = taoResults_helpers_Datatypes::decodeFile($value); common_Logger::i("FileName:"); common_Logger::i(var_export($decodedFile["name"], true));
file size was added to the returned content typo fixed git-svn-id: <URL>
oat-sa_extension-tao-outcomeui
train
php
cca4bc94e0d34b60aa8490d29b6310809fe1154c
diff --git a/ui/app/utils/classes/log.js b/ui/app/utils/classes/log.js index <HASH>..<HASH> 100644 --- a/ui/app/utils/classes/log.js +++ b/ui/app/utils/classes/log.js @@ -48,7 +48,7 @@ const Log = EmberObject.extend(Evented, { this.trigger('tick', chunk); }; - if (window.ReadableStream) { + if (StreamLogger.isSupported) { this.set('logStreamer', StreamLogger.create(args)); } else { this.set('logStreamer', PollLogger.create(args)); diff --git a/ui/app/utils/classes/stream-logger.js b/ui/app/utils/classes/stream-logger.js index <HASH>..<HASH> 100644 --- a/ui/app/utils/classes/stream-logger.js +++ b/ui/app/utils/classes/stream-logger.js @@ -69,4 +69,6 @@ export default EmberObject.extend(AbstractLogger, { }); } }), +}).reopenClass({ + isSupported: !!window.ReadableStream, });
Move the stream support check to the stream logger
hashicorp_nomad
train
js,js
95a26db1a7219d6b76f6b5e0fd84d3bbcabd5587
diff --git a/lib/github_cli.rb b/lib/github_cli.rb index <HASH>..<HASH> 100644 --- a/lib/github_cli.rb +++ b/lib/github_cli.rb @@ -19,6 +19,7 @@ module GithubCLI autoload :Terminal, 'github_cli/terminal' autoload :System, 'github_cli/system' autoload :Pager, 'github_cli/pager' + autoload :Editor, 'github_cli/editor' autoload :Commands, 'github_cli/commands' autoload :Helpers, 'github_cli/helpers' autoload :Formatter, 'github_cli/formatter' @@ -42,6 +43,10 @@ module GithubCLI @ui ||= UI.new end + def executable_name + File.basename($PROGRAM_NAME) + end + def default_configfile Helpers.default_configfile end
Add editor to load path and executable name.
piotrmurach_github_cli
train
rb
b0277df1566cec72ec3be3a7203872597695197d
diff --git a/tests/test_ddg.py b/tests/test_ddg.py index <HASH>..<HASH> 100644 --- a/tests/test_ddg.py +++ b/tests/test_ddg.py @@ -11,7 +11,7 @@ import nose import angr # Load the tests -test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../binaries/tests")) +test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests')) def perform_one(binary_path): proj = angr.Project(binary_path,
test_ddg: Use the correct path separator when building path.
angr_angr
train
py
51a883fc34879a49d05098801e10ddb9b4d9919d
diff --git a/src/java/com/threerings/presents/dobj/DObject.java b/src/java/com/threerings/presents/dobj/DObject.java index <HASH>..<HASH> 100644 --- a/src/java/com/threerings/presents/dobj/DObject.java +++ b/src/java/com/threerings/presents/dobj/DObject.java @@ -1,5 +1,5 @@ // -// $Id: DObject.java,v 1.57 2003/01/13 18:38:05 mdb Exp $ +// $Id: DObject.java,v 1.58 2003/02/18 18:59:08 mdb Exp $ package com.threerings.presents.dobj; @@ -536,13 +536,21 @@ public class DObject implements Streamable public String toString () { StringBuffer buf = new StringBuffer(); + toString(buf); + return buf.append("]").toString(); + } + + /** + * Generates a string representation of this object. + */ + protected void toString (StringBuffer buf) + { StringUtil.fieldsToString(buf, this, "\n"); if (buf.length() > 0) { buf.insert(0, "\n"); } buf.insert(0, _oid); buf.insert(0, "[oid="); - return buf.append("]").toString(); } /**
Factored toString() into two methods for easier customization by derived classes. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1
threerings_narya
train
java
ded4a85dfaf81b892dc44071f5e30586f409f411
diff --git a/tests/Doctrine/Tests/DBAL/Functional/Driver/SQLSrv/StatementTest.php b/tests/Doctrine/Tests/DBAL/Functional/Driver/SQLSrv/StatementTest.php index <HASH>..<HASH> 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/Driver/SQLSrv/StatementTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/Driver/SQLSrv/StatementTest.php @@ -28,7 +28,7 @@ class StatementTest extends DbalFunctionalTestCase // it's impossible to prepare the statement without bound variables for SQL Server, // so the preparation happens before the first execution when variables are already in place - $this->expectException('Doctrine\\DBAL\\Driver\\SQLSrv\\SQLSrvException'); + $this->expectException(SQLSrvException::class); $stmt->execute(); } }
#<I> replacing string with class reference
doctrine_dbal
train
php
5219843c9b5e57361611cf279315ed942b2afbae
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ import os import sys import warnings -from distutils.command import build_ext +from distutils.command.build_ext import build_ext from distutils.core import setup from distutils.extension import Extension from distutils.version import StrictVersion
Gotta go deeper, distutils.
coleifer_peewee
train
py
ced26262d710abe462ecc8a8a9ea97aff825e026
diff --git a/lib/vimeo.js b/lib/vimeo.js index <HASH>..<HASH> 100644 --- a/lib/vimeo.js +++ b/lib/vimeo.js @@ -45,10 +45,15 @@ var auth_endpoints = module.exports.auth_endpoints = { * * @param {string} client_id OAuth 2 Client Identifier * @param {string} client_secret OAuth 2 Client Secret + * @param (string) access_token OAuth 2 Optional pre-authorized access token */ -var Vimeo = module.exports.Vimeo = function Vimeo (client_id, client_secret) { +var Vimeo = module.exports.Vimeo = function Vimeo (client_id, client_secret, access_token) { this._client_id = client_id; this._client_secret = client_secret; + + if (access_token) { + this.access_token = access_token; + } }; Vimeo.prototype._client_id = null;
Added optional Access Token as third parameter during initialisation
vimeo_vimeo.js
train
js
250ef40faad402bd61fb4828c8992819ef6f310f
diff --git a/views/js/ui/mediaplayer.js b/views/js/ui/mediaplayer.js index <HASH>..<HASH> 100644 --- a/views/js/ui/mediaplayer.js +++ b/views/js/ui/mediaplayer.js @@ -1406,6 +1406,10 @@ define([ _bindEvents : function _bindEvents() { var self = this; + this.$component.on('contextmenu' + _ns, function(event) { + event.preventDefault(); + }); + this.$controls.on('click' + _ns, '.action', function(event) { var $target = $(event.target); var $action = $target.closest('.action'); @@ -1439,6 +1443,7 @@ define([ * @private */ _unbindEvents : function _unbindEvents() { + this.$component.off(_ns); this.$player.off(_ns); this.$controls.off(_ns); this.$seek.off(_ns);
mediaplayer: prevent display of context menu on the player
oat-sa_tao-core
train
js
f3f69b694f2f8ee669719b0d831e75daf368e454
diff --git a/xhtml2pdf/xhtml2pdf_reportlab.py b/xhtml2pdf/xhtml2pdf_reportlab.py index <HASH>..<HASH> 100644 --- a/xhtml2pdf/xhtml2pdf_reportlab.py +++ b/xhtml2pdf/xhtml2pdf_reportlab.py @@ -519,7 +519,9 @@ class PmlParagraph(Paragraph, PmlMaxHeightMixIn): self.hasImages = True img = frag.cbDefn width = min(img.width, availWidth) - wfactor = float(width) / img.width + wfactor = 0 + if img.width != 0: + wfactor = float(width) / img.width height = min(img.height, availHeight * MAX_IMAGE_RATIO) # XXX 99% because 100% do not work... hfactor = float(height) / img.height factor = min(wfactor, hfactor)
Avoid division by 0 on width calc. JN
xhtml2pdf_xhtml2pdf
train
py
f3d09cf537adcf557a0918214e522b25482e8bc3
diff --git a/testing/cucumber/step_definitions/verification_steps.rb b/testing/cucumber/step_definitions/verification_steps.rb index <HASH>..<HASH> 100644 --- a/testing/cucumber/step_definitions/verification_steps.rb +++ b/testing/cucumber/step_definitions/verification_steps.rb @@ -2,16 +2,14 @@ Then(/^the following values are returned:$/) do |values| expected_keys = values.raw.first expected_results = values.hashes + # Protecting against false positives + raise('Invalid result set. Attribute names cannot be repeated.') unless expected_keys == expected_results.first.keys + expected_results.each do |result| result.each_pair { |key, value| result[key] = value.to_i if value =~ /^\d+$/ } end - - @query_results.each_with_index do |result, index| - # Key order doesn't matter and Ruby 1.8.7 does not retain hash key ordering, so sorting them for consistency - expect(result.keys.sort).to eq(expected_keys.sort) - expect(result).to eq(expected_results[index]) - end + expect(@query_results).to match_array(expected_results) end # Then(/^all of them can be queried for additional information$/) do
Refactor assertion step Found a better way to protect against false positives without loosing helpful error feedback in tests.
enkessler_cql
train
rb
bea7319e21609210b4da4c156ce3485be08f8e7c
diff --git a/library/src/com/nostra13/universalimageloader/cache/disc/impl/ext/LruDiscCache.java b/library/src/com/nostra13/universalimageloader/cache/disc/impl/ext/LruDiscCache.java index <HASH>..<HASH> 100644 --- a/library/src/com/nostra13/universalimageloader/cache/disc/impl/ext/LruDiscCache.java +++ b/library/src/com/nostra13/universalimageloader/cache/disc/impl/ext/LruDiscCache.java @@ -119,12 +119,17 @@ public class LruDiscCache implements DiskCache { @Override public File get(String imageUri) { + DiskLruCache.Snapshot snapshot = null; try { - DiskLruCache.Snapshot snapshot = cache.get(getKey(imageUri)); + snapshot = cache.get(getKey(imageUri)); return snapshot == null ? null : snapshot.getFile(0); } catch (IOException e) { L.e(e); return null; + } finally { + if (snapshot != null) { + snapshot.close(); + } } }
Issue #<I>: Close DiskLruCache.Snapshot after usage
nostra13_Android-Universal-Image-Loader
train
java
f6f1529863b2525cc668916df14e6deb8ab577ba
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ long_description = ('Ariane CLIP3 (client python 3) is the python implementation ' + IRC on freenode #ariane.echinopsii') setup(name='ariane_clip3', - version='0.1.0-b02', + version='0.1.0-b03', description='Ariane Python API Library', long_description=long_description, author='Mathilde Ffrench', @@ -28,7 +28,7 @@ setup(name='ariane_clip3', maintainer='Mathilde Ffrench', maintainer_email='mathilde.ffrench@echinopsii.net', url='https://github.com/echinopsii/net.echinopsii.ariane.community.cli.python3.git', - download_url='https://github.com/echinopsii/net.echinopsii.ariane.community.cli.python3.git/tarball/0.1.0-b02', + download_url='https://github.com/echinopsii/net.echinopsii.ariane.community.cli.python3.git/tarball/0.1.0-b03', packages=['ariane_clip3'], license='AGPLv3', install_requires=requirements,
[ACC-<I>] update some PyPi setup and readme
echinopsii_net.echinopsii.ariane.community.cli.python3
train
py
1bece67b4922e74258d03d1b5834057f9b166d88
diff --git a/src/config/hidev.php b/src/config/hidev.php index <HASH>..<HASH> 100644 --- a/src/config/hidev.php +++ b/src/config/hidev.php @@ -40,4 +40,7 @@ return [ ], ], ], + 'aliases' => [ + '@hidev/composer' => dirname(__DIR__), + ], ];
Added aliases forcibly
hiqdev_hidev-composer
train
php
d90976786d1734b3f1d157a52e2af225d5d3c8e7
diff --git a/core/src/main/java/hudson/model/Queue.java b/core/src/main/java/hudson/model/Queue.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/model/Queue.java +++ b/core/src/main/java/hudson/model/Queue.java @@ -255,7 +255,7 @@ public class Queue extends ResourceController implements Saveable { public void setLoadBalancer(LoadBalancer loadBalancer) { if(loadBalancer==null) throw new IllegalArgumentException(); - this.loadBalancer = loadBalancer; + this.loadBalancer = loadBalancer.sanitize(); } public QueueSorter getSorter() {
LoadBalancer we put needs to be sanitized
jenkinsci_jenkins
train
java
e403676c4d7dfa9c1ed8bb0dfd8c76e6a780bda8
diff --git a/wpull/version.py b/wpull/version.py index <HASH>..<HASH> 100644 --- a/wpull/version.py +++ b/wpull/version.py @@ -1,2 +1,2 @@ # encoding=utf-8 -__version__ = '0.3a1' +__version__ = '0.4a1'
Bumps version to <I>a1.
ArchiveTeam_wpull
train
py
e7fb2dd4ff04ea22df0accd4c88422f9d05e7d1c
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -34,7 +34,7 @@ function Plugin(inputNodes, options) { prelude: '', moduleType: 'es6', wrapEntry: function(data) { - let prefix = 'export default'; + var prefix = 'export default'; if (this.moduleType === 'commonjs') { prefix = 'module.exports =';
Removing use of let for Node <I> support
ember-intl_broccoli-cldr-data
train
js
46b1aea9911cfddf7cab21caa77aa9c4ed20a88b
diff --git a/lib/formalist/rich_text/rendering/html_renderer.rb b/lib/formalist/rich_text/rendering/html_renderer.rb index <HASH>..<HASH> 100644 --- a/lib/formalist/rich_text/rendering/html_renderer.rb +++ b/lib/formalist/rich_text/rendering/html_renderer.rb @@ -158,7 +158,7 @@ module Formalist if content.nil? || content.empty? out << "/>" else - out << ">#{content}</#{tag}>" + out << ">#{replace_soft_newlines(content)}</#{tag}>" end end @@ -168,6 +168,10 @@ module Formalist end opts.join(" ") end + + def replace_soft_newlines(content) + content.gsub(/\n/, '<br/>') + end end end end
Render soft-newlines `\n` as `<br>` in output.
team-formalist_formalist-rb
train
rb
edff70c6e5ab287618a13b25e34039b9e26983a3
diff --git a/events/start_handler.go b/events/start_handler.go index <HASH>..<HASH> 100644 --- a/events/start_handler.go +++ b/events/start_handler.go @@ -38,11 +38,8 @@ func getDnsSearch(container *docker.Container) []string { if container.Config.Labels != nil { if value, ok := container.Config.Labels["io.rancher.stack_service.name"]; ok { splitted := strings.Split(value, "/") - svc := strings.ToLower(splitted[1]) stack := strings.ToLower(splitted[0]) - svcNameSpace = svc + "." + stack + "." + RancherDomain stackNameSpace = stack + "." + RancherDomain - defaultDomains = append(defaultDomains, svcNameSpace) defaultDomains = append(defaultDomains, stackNameSpace) } }
Removed service name space from search domain
rancher_host-api
train
go
27765d24d0859f183ae3057bd4ca46401ee911c2
diff --git a/acceptance/tests/ssl/certificate_extensions.rb b/acceptance/tests/ssl/certificate_extensions.rb index <HASH>..<HASH> 100644 --- a/acceptance/tests/ssl/certificate_extensions.rb +++ b/acceptance/tests/ssl/certificate_extensions.rb @@ -111,7 +111,7 @@ test_name "certificate extensions available as trusted data" do }, 'hostname' => agent_hostname, 'domain' => agent_domain, - 'externa' => {} + 'external' => {} }, trusted_data) end
(PUP-<I>) fixed typo in test
puppetlabs_puppet
train
rb
d18988827f96847d831d6bad28918adc17720ab5
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -30,6 +30,7 @@ MOCK_MODULES = [ "i3pystatus.pulseaudio.pulse", "notmuch", "requests", + "beautifulsoup4" ] for mod_name in MOCK_MODULES: diff --git a/i3pystatus/whosonlocation.py b/i3pystatus/whosonlocation.py index <HASH>..<HASH> 100644 --- a/i3pystatus/whosonlocation.py +++ b/i3pystatus/whosonlocation.py @@ -58,6 +58,11 @@ class WhosOnLocation(): class WOL(IntervalModule): + """ + Change your whosonlocation.com status. + + Requires the PyPi module `beautifulsoup4` + """ location = None email = None password = None
Documented dependency on beautifulsoup4.
enkore_i3pystatus
train
py,py
08d8f5a2dee0754201b11febbb94db5caf9a2913
diff --git a/components/prism-php.js b/components/prism-php.js index <HASH>..<HASH> 100644 --- a/components/prism-php.js +++ b/components/prism-php.js @@ -18,16 +18,16 @@ Prism.languages.php = Prism.languages.extend('clike', { Prism.languages.insertBefore('php', 'keyword', { 'deliminator': /(\?>|\?&gt;|&lt;\?php|<\?php|&lt;\?|<\?)/ig, - 'this': /\$this/g, + //'this': /\$this/g, //'global': /\$_?(GLOBALS|SERVER|GET|POST|FILES|REQUEST|SESSION|ENV|COOKIE|HTTP_RAW_POST_DATA|argc|argv|php_errormsg|http_response_header)/g, 'variable': /(\$\w+)\b/ig, - 'scope': { + /*'scope': { pattern: /\b[\w\\]+::/g, inside: { keyword: /(static|self|parent)/, punctuation: /(::|\\)/ } - }, + },*/ 'package': { pattern: /(\\|namespace\s+|use\s+)[\w\\]+/g, lookbehind: true,
Comment out patterns to move to php-extras
PrismJS_prism
train
js
cfdf2150b069549b86568c91875d16d4f751fd45
diff --git a/core/ClientController.js b/core/ClientController.js index <HASH>..<HASH> 100644 --- a/core/ClientController.js +++ b/core/ClientController.js @@ -526,6 +526,11 @@ class ClientController extends EventEmitter { } nodeArrival (index) { + + // The server has just let us know that a pre-rendered root + // element has arrived. We'll grab a reference to its DOM + // node and un-block client-side rendering of the element that + // we're going to mount into it. this._ensureRootNodeDfd(index).resolve( this.mountNode.querySelector( `div[${TRITON_DATA_ATTRIBUTE}="${index}"]`
PLAT-<I>: Commentary in `nodeArrival`
redfin_react-server
train
js
000423da83f9c4756c8ba74d66b6679286e707b9
diff --git a/reset_migrations/management/commands/reset_migrations.py b/reset_migrations/management/commands/reset_migrations.py index <HASH>..<HASH> 100644 --- a/reset_migrations/management/commands/reset_migrations.py +++ b/reset_migrations/management/commands/reset_migrations.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from django.core.management import BaseCommand from django.core.management import call_command from django.db import connection @@ -5,7 +7,6 @@ import os import shutil import re import tempfile -from __future__ import print_function def delete_line(filename, pattern): pattern_compiled = re.compile(pattern)
Update reset_migrations.py
valdergallo_django-reset-migrations
train
py
5c2d2d4692691a41483dce7547395fc5a7b4dfad
diff --git a/core/app/models/comable/order.rb b/core/app/models/comable/order.rb index <HASH>..<HASH> 100644 --- a/core/app/models/comable/order.rb +++ b/core/app/models/comable/order.rb @@ -91,7 +91,6 @@ module Comable order_details.each(&:complete) - mark_for_validation_to_order_details save end @@ -122,10 +121,5 @@ module Comable customer.update_bill_address_by bill_address if bill_address customer.update_ship_address_by ship_address if ship_address end - - # HACK: to validate forced for nested attributes - def mark_for_validation_to_order_details - order_details.each(&:id_will_change!) - end end end
core: Remove the code that is no longer needed
appirits_comable
train
rb
cd4e8ba4485ba84876f30be4189019a527e8ea88
diff --git a/container.go b/container.go index <HASH>..<HASH> 100644 --- a/container.go +++ b/container.go @@ -23,6 +23,7 @@ var ( ErrNoRunningTask = errors.New("no running task") ErrDeleteRunningTask = errors.New("cannot delete container with running task") ErrProcessExited = errors.New("process already exited") + ErrNoExecID = errors.New("exec id must be provided") ) type DeleteOpts func(context.Context, *Client, containers.Container) error diff --git a/task.go b/task.go index <HASH>..<HASH> 100644 --- a/task.go +++ b/task.go @@ -191,6 +191,9 @@ func (t *task) Delete(ctx context.Context) (uint32, error) { } func (t *task) Exec(ctx context.Context, id string, spec *specs.Process, ioCreate IOCreation) (Process, error) { + if id == "" { + return nil, ErrNoExecID + } i, err := ioCreate() if err != nil { return nil, err
Add exec id check on client
containerd_containerd
train
go,go
b4d8f2b66e40b9ce2c68a127d0924d44c17aa056
diff --git a/lib/foreman_discovery/version.rb b/lib/foreman_discovery/version.rb index <HASH>..<HASH> 100644 --- a/lib/foreman_discovery/version.rb +++ b/lib/foreman_discovery/version.rb @@ -1,3 +1,3 @@ module ForemanDiscovery - VERSION = "1.3.0" + VERSION = "1.4.0.rc1" end
Bump to <I>.rc1
theforeman_foreman_discovery
train
rb
0c7e02b09ab0ee2e2fd5aa5d0c1267b03600f510
diff --git a/src/LdapTools/Connection/LdapConnectionInterface.php b/src/LdapTools/Connection/LdapConnectionInterface.php index <HASH>..<HASH> 100644 --- a/src/LdapTools/Connection/LdapConnectionInterface.php +++ b/src/LdapTools/Connection/LdapConnectionInterface.php @@ -38,8 +38,8 @@ interface LdapConnectionInterface /** * Connect and bind to LDAP. * - * @param null $username The username to connect with. If not specified, the one in the config is used. - * @param null $password The password for the username. + * @param string|null $username The username to connect with. If not specified, the one in the config is used. + * @param string|null $password The password for the username. * @param bool $anonymous Whether this is an attempt to bind anonymously, ignoring the username and password. * @return $this */ @@ -48,8 +48,8 @@ interface LdapConnectionInterface /** * Try to connect and bind to LDAP as a user account. * - * @param $username - * @param $password + * @param string $username + * @param string $password * @return bool * @throws \LdapTools\Exception\LdapBindException If re-binding fails after authentication. * @throws \LdapTools\Exception\LdapConnectionException If re-connecting fails after authentication.
Correct argument types in the docs.
ldaptools_ldaptools
train
php
86225894e8deba98295d9d8093e7f1c20b3d2d76
diff --git a/digitalocean/Record.py b/digitalocean/Record.py index <HASH>..<HASH> 100644 --- a/digitalocean/Record.py +++ b/digitalocean/Record.py @@ -1,11 +1,11 @@ import requests class Record(object): - def __init__(self, domain_id, id=""): + def __init__(self, domain_id, id="", client_id="", api_key=""): self.domain_id = domain_id self.id = id - self.client_id = None - self.api_key = None + self.client_id = client_id + self.api_key = api_key self.record_type = None self.name = None self.data = None
Accept client_id and api_key on initialization
koalalorenzo_python-digitalocean
train
py
1f3e1a0e9fe7c1d93cb741ddd7e02d30ffc7fc1a
diff --git a/src/tcp-connection-endpoint.js b/src/tcp-connection-endpoint.js index <HASH>..<HASH> 100644 --- a/src/tcp-connection-endpoint.js +++ b/src/tcp-connection-endpoint.js @@ -10,7 +10,7 @@ var _ = require('lodash'); var Q = require('q'); -var Connection = require('./Connection'); +var Connection = require('./connection');
Fix typo in TcpConnectionEndpoint. Does not work on filesystems that are case-sensitive...
danielwippermann_resol-vbus
train
js
5b4788825d0e751a090546da266131bf543ca9e7
diff --git a/client/src/views/list.js b/client/src/views/list.js index <HASH>..<HASH> 100644 --- a/client/src/views/list.js +++ b/client/src/views/list.js @@ -407,7 +407,7 @@ define('views/list', ['views/main', 'search-manager'], function (Dep, SearchMana returnDispatchParams: returnDispatchParams }); - this.createView('quickCreate', 'views/modals/edit', options, function (view) { + this.createView('quickCreate', viewName, options, function (view) { view.render(); view.notify(false); this.listenToOnce(view, 'after:save', function () {
Fixes for actionQuickCreate in list view
espocrm_espocrm
train
js
ef22dd39f57382ae3f084640e373434d36a9684e
diff --git a/src/main/java/com/github/skjolberg/packing/Dimension.java b/src/main/java/com/github/skjolberg/packing/Dimension.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/skjolberg/packing/Dimension.java +++ b/src/main/java/com/github/skjolberg/packing/Dimension.java @@ -130,12 +130,7 @@ public class Dimension { } public boolean fitsInside3D(int w, int d, int h) { - - if(w >= width && h >= height && d >= depth) { - return true; - } - - return false; + return w >= width && h >= height && d >= depth; }
Simplify `fitsInside3D` code
skjolber_3d-bin-container-packing
train
java
9cbfeb167a39fcbb41e89ab798d84a6e440ac524
diff --git a/src/Exception/DeletingFailed.php b/src/Exception/DeletingFailed.php index <HASH>..<HASH> 100644 --- a/src/Exception/DeletingFailed.php +++ b/src/Exception/DeletingFailed.php @@ -25,8 +25,8 @@ class DeletingFailed extends Exception /** * Create a new instance. * - * @param \Exception[] $exceptions - * @param string $message + * @param \Exception[] $exceptions + * @param string $message * * @return void */
Corrected a docblock's indentation
thephpleague_factory-muffin
train
php
85fa0e6e908523a3510ece0483ff7ff79018c5ae
diff --git a/pytestsalt/utils.py b/pytestsalt/utils.py index <HASH>..<HASH> 100644 --- a/pytestsalt/utils.py +++ b/pytestsalt/utils.py @@ -31,6 +31,11 @@ from collections import namedtuple # Import 3rd party libs import pytest import psutil +try: + import setproctitle + HAS_SETPROCTITLE = True +except ImportError: + HAS_SETPROCTITLE = False # Import salt libs import salt.ext.six as six @@ -48,6 +53,12 @@ else: SIGTERM = signal.SIGTERM +def set_proc_title(title): + if HAS_SETPROCTITLE is False: + return + setproctitle.setproctitle('[{0}] - {1}'.format(title, setproctitle.getproctitle())) + + def get_unused_localhost_port(): ''' Return a random unused port on localhost @@ -412,6 +423,7 @@ class SaltDaemonScriptBase(SaltScriptBase): ''' The actual, coroutine aware, start method ''' + set_proc_title(self.cli_display_name) log.info('[%s][%s] Starting DAEMON in CWD: %s', self.log_prefix, self.cli_display_name, self.cwd) proc_args = [ self.get_script_path(self.cli_script_name)
Set a more meaning full process name if possible
saltstack_pytest-salt
train
py
01ebd98c71e41b9af5c4aeafe07e5694ae3c0976
diff --git a/docs/src/modules/components/Demo.js b/docs/src/modules/components/Demo.js index <HASH>..<HASH> 100644 --- a/docs/src/modules/components/Demo.js +++ b/docs/src/modules/components/Demo.js @@ -9,8 +9,8 @@ import IconButton from '@material-ui/core/IconButton'; import useMediaQuery from '@material-ui/core/useMediaQuery'; import Collapse from '@material-ui/core/Collapse'; import Fade from '@material-ui/core/Fade'; -import ToggleButton from '@material-ui/lab/ToggleButton'; -import ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup'; +import ToggleButton from '@material-ui/core/ToggleButton'; +import ToggleButtonGroup from '@material-ui/core/ToggleButtonGroup'; import { JavaScript as JavaScriptIcon, TypeScript as TypeScriptIcon } from '@material-ui/docs'; import NoSsr from '@material-ui/core/NoSsr'; import EditIcon from '@material-ui/icons/Edit';
[docs] Update ToggleButton import (#<I>)
mui-org_material-ui
train
js
a780036daff78f226502a8d7a329bc3761a300dd
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -42,8 +42,8 @@ if 'bsd' in sys.platform: ext_modules = [ Extension( 'pikepdf._qpdf', - glob('src/qpdf/*.cpp'), - depends=glob('src/qpdf/*.h'), + sorted(glob('src/qpdf/*.cpp')), + depends=sorted(glob('src/qpdf/*.h')), include_dirs=[ # Path to pybind11 headers get_pybind_include(),
Sort .cpp build inputs to ensure a reproducible build Whilst working on the Reproducible Builds effort [0] we noticed that pikepdf could not be built reproducibly. This is due to the .cpp input files were compiled/linked in an order that was determined by their layout on the filesystem which is, alas, non-deterministic. This was originally filed in Debian as #<I> [1]. [0] <URL>
pikepdf_pikepdf
train
py
c98090b9729adf5d2dda05514555c664dc09e850
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -13,6 +13,8 @@ if 'sdist' in sys.argv or 'develop' in sys.argv: os.chdir('parler') from django.core.management.commands.compilemessages import compile_messages compile_messages(sys.stderr) + except ImportError as e: + print e finally: os.chdir('..')
do not abort on missing dependency
django-parler_django-parler
train
py
9f0aa7ae65bfad356bc14d214dc271ab8afd4d87
diff --git a/anoncreds/__metadata__.py b/anoncreds/__metadata__.py index <HASH>..<HASH> 100644 --- a/anoncreds/__metadata__.py +++ b/anoncreds/__metadata__.py @@ -1,7 +1,7 @@ """ Package metadata """ -__version_info__ = (0, 1, 2) +__version_info__ = (0, 1, 3) __version__ = '{}.{}.{}'.format(*__version_info__) __author__ = "Evernym, Inc." __license__ = "Apache 2.0"
advanced version to push to pypi
hyperledger-archives_indy-anoncreds
train
py
98d75c3768e4038e8b0bbfc01f01adc58d28eff6
diff --git a/discovery/docker_discovery.go b/discovery/docker_discovery.go index <HASH>..<HASH> 100644 --- a/discovery/docker_discovery.go +++ b/discovery/docker_discovery.go @@ -98,6 +98,9 @@ func (d *DockerDiscovery) inspectContainer(svc *service.Service) (*docker.Contai return nil, err } + d.Lock() + defer d.Unlock() + // Cache it for next time d.containerCache[svc.ID] = container
Fix concurrent map writes in DockerDiscovery
newrelic_sidecar
train
go
7213a95d7e8996e741d7fc0052ca3b551647eb9e
diff --git a/src/swarm.js b/src/swarm.js index <HASH>..<HASH> 100644 --- a/src/swarm.js +++ b/src/swarm.js @@ -117,6 +117,12 @@ module.exports = (common) => { Swarm: addrs, API: '/ip4/127.0.0.1/tcp/0', Gateway: '/ip4/127.0.0.1/tcp/0' + }, + Bootstrap: [], + Discovery: { + MDNS: { + Enabled: false + } } } } @@ -213,6 +219,7 @@ module.exports = (common) => { (cb) => { nodeA.swarm.peers((err, peers) => { expect(err).to.not.exist() + peers.forEach((peer) => console.log(peer.addr.toString())) expect(peers).to.have.length(1) cb() })
fix: swarm test - disable bootstrap and multicastdns
ipfs_interface-js-ipfs-core
train
js
689456ff86214da22cdbc01cd7c26532af149013
diff --git a/tests/src/test/java/alluxio/client/BufferedBlockInStreamIntegrationTest.java b/tests/src/test/java/alluxio/client/BufferedBlockInStreamIntegrationTest.java index <HASH>..<HASH> 100644 --- a/tests/src/test/java/alluxio/client/BufferedBlockInStreamIntegrationTest.java +++ b/tests/src/test/java/alluxio/client/BufferedBlockInStreamIntegrationTest.java @@ -64,7 +64,7 @@ public final class BufferedBlockInStreamIntegrationTest { } private static List<CreateFileOptions> getOptionSet() { - List<CreateFileOptions> ret = new ArrayList<CreateFileOptions>(3); + List<CreateFileOptions> ret = new ArrayList<>(3); ret.add(sWriteBoth); ret.add(sWriteAlluxio); ret.add(sWriteUnderStore);
[SMALLFIX] Removed explicit argument type in BufferedBlockInStreamIntegrationTest
Alluxio_alluxio
train
java
75982560e7d15af064d158dd5c64618dbcd94093
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/defaults.rb +++ b/lib/puppet/defaults.rb @@ -241,13 +241,6 @@ module Puppet :type => :boolean, :desc => "Whether to enable experimental performance profiling", }, - :future_features => { - :default => false, - :type => :boolean, - :desc => "Whether or not to enable all features currently being developed for future - major releases of Puppet. Should be used with caution, as in development - features are experimental and can have unexpected effects." - }, :versioned_environment_dirs => { :default => false, :type => :boolean,
(PUP-<I>) Remove future_features setting
puppetlabs_puppet
train
rb
2a350c211521a7df7b21797c46b75d88516a7756
diff --git a/src/cr/cube/cube.py b/src/cr/cube/cube.py index <HASH>..<HASH> 100644 --- a/src/cr/cube/cube.py +++ b/src/cr/cube/cube.py @@ -421,7 +421,11 @@ class Cube(object): # ---In case of numeric arrays, we need to inflate the columns dimension # ---according to the mean subvariables. For each subvar the col dimension # ---will have a new element related to the subvar metadata. - dimensions.append(self._numeric_array_dimension) + ( + dimensions.insert(0, self._numeric_array_dimension) + if self._cube_idx_arg + else dimensions.append(self._numeric_array_dimension) + ) return cube_dict @lazyproperty
insert vs append according to the cube idx arg
Crunch-io_crunch-cube
train
py
63f518e748be35876a296fdfb85b8b84ba3b1283
diff --git a/app.go b/app.go index <HASH>..<HASH> 100644 --- a/app.go +++ b/app.go @@ -27,6 +27,12 @@ type App struct { filepaths []string } +// Muxer returns the underlying mux router to allow +// for advance configurations +func (a *App) Muxer() *mux.Router { + return a.router +} + // New returns a new instance of App and adds some sane, and useful, defaults. func New(opts Options) *App { events.LoadPlugins()
exposes the mux.Router on the application (#<I>)
gobuffalo_buffalo
train
go
a2eb27de11926c48398d2ca234766d0143fca7f5
diff --git a/src/VR.js b/src/VR.js index <HASH>..<HASH> 100644 --- a/src/VR.js +++ b/src/VR.js @@ -143,14 +143,19 @@ class Gamepad { this.hand = hand; this.index = index; + const gamepad = GlobalContext.xrState.gamepads[index]; + this.connected = false; this.mapping = 'standard'; - this.buttons = Array(16); - for (let i = 0; i < this.buttons.length; i++) { - this.buttons[i] = new GamepadButton(); - } - this.pose = new GamepadPose(); - this.axes = new Float32Array(10); + this.buttons = (() => { + const result = Array(5); + for (let i = 0; i < result.length; i++) { + result[i] = new GamepadButton(gamepad.buttons[i].value, gamepad.buttons[i].pressed, gamepad.buttons[i].touched); + } + return result; + })(); + this.pose = new GamepadPose(gamepad.position, gamepad.orientation); + this.axes = gamepad.axes; this.hapticActuators = [new GamepadHapticActuator(index)]; }
Bind Gamepad to XRState
exokitxr_exokit
train
js
ea04a81f38afbe6f6b108db71458cfbe9a8bb529
diff --git a/lib/email_spy/version.rb b/lib/email_spy/version.rb index <HASH>..<HASH> 100644 --- a/lib/email_spy/version.rb +++ b/lib/email_spy/version.rb @@ -1,3 +1,3 @@ module EmailSpy - VERSION = "1.4.0" + VERSION = "1.4.1" end
Bumping constant version by patch level.
krainboltgreene_email_spy
train
rb
4326ffdf5c795974be7453bf5ec3f8b0d7107985
diff --git a/japicmp/src/main/java/japicmp/output/stdout/StdoutOutputGenerator.java b/japicmp/src/main/java/japicmp/output/stdout/StdoutOutputGenerator.java index <HASH>..<HASH> 100644 --- a/japicmp/src/main/java/japicmp/output/stdout/StdoutOutputGenerator.java +++ b/japicmp/src/main/java/japicmp/output/stdout/StdoutOutputGenerator.java @@ -367,8 +367,7 @@ public class StdoutOutputGenerator extends OutputGenerator<String> { private void processSuperclassChanges(StringBuilder sb, JApiClass jApiClass) { JApiSuperclass jApiSuperclass = jApiClass.getSuperclass(); - if (!options.isOutputOnlyModifications() || (jApiSuperclass.getChangeStatus() != JApiChangeStatus.UNCHANGED - || jApiClass.getChangeStatus() != JApiChangeStatus.UNCHANGED)) { + if (!options.isOutputOnlyModifications() || jApiSuperclass.getChangeStatus() != JApiChangeStatus.UNCHANGED) { sb.append(tabs(1)).append(signs(jApiSuperclass)).append(" ").append(jApiSuperclass.getChangeStatus()).append(" SUPERCLASS: ").append(superclassChangeAsString(jApiSuperclass)).append("\n"); } }
print superclass not when class itself changed
siom79_japicmp
train
java
f035f25ad6f2e0885f27770ed647ff92a6c19962
diff --git a/views/category/edit.php b/views/category/edit.php index <HASH>..<HASH> 100644 --- a/views/category/edit.php +++ b/views/category/edit.php @@ -8,7 +8,7 @@ use yii\widgets\ActiveForm; /* @var $baseCategory integer */ /* @var $parents array CategoryTranslation */ /* @var $baseLanguage Language */ -$this->title = Yii::t('bl.articles.category.view', 'Panel helps'); +$this->title = Yii::t('bl.articles.category.view', 'Panel article'); ?> <div class="row"> diff --git a/views/category/index.php b/views/category/index.php index <HASH>..<HASH> 100644 --- a/views/category/index.php +++ b/views/category/index.php @@ -8,7 +8,7 @@ use yii\helpers\Url; /* @var $languages Language[] */ /* @var $baseLanguage Language */ -$this->title = Yii::t('bl.articles.category.view', 'Category panel'); +$this->title = Yii::t('bl.articles.category.view', 'Panel article'); ?> <div class="row">
V <I> refactoring view
black-lamp_yii2-articles
train
php,php
91f1f430e1f6f8c8118fea8b642277a0ad4de97a
diff --git a/discord/member.py b/discord/member.py index <HASH>..<HASH> 100644 --- a/discord/member.py +++ b/discord/member.py @@ -198,7 +198,7 @@ class Member(discord.abc.Messageable, _BaseUser): try: member_data = data.pop('member') except KeyError: - return state.store_user(member_data) + return state.store_user(data) else: member_data['user'] = data return cls(data=member_data, guild=guild, state=state)
Fix NameError in member upgrade code
Rapptz_discord.py
train
py
39fb41684618f480d4b95ccdf0422f7dd7cd9be0
diff --git a/source/rafcon/gui/controllers/top_tool_bar.py b/source/rafcon/gui/controllers/top_tool_bar.py index <HASH>..<HASH> 100644 --- a/source/rafcon/gui/controllers/top_tool_bar.py +++ b/source/rafcon/gui/controllers/top_tool_bar.py @@ -88,7 +88,7 @@ class TopToolBarController(ExtendedController): if event.is_hint: window_containing_pointer, x, y, state = event.get_window().get_pointer() else: - state = event.get_state() + state = event.get_state()[1] if state & Gdk.ModifierType.BUTTON1_MASK: self.top_level_window.begin_move_drag(Gdk.ModifierType.BUTTON1_MASK, int(event.x_root), int(event.y_root), 0)
fix(controllers): Access of event state
DLR-RM_RAFCON
train
py
3517c7c569e4c543e1aa0639f064e3e63d2425ef
diff --git a/ui/app/components/stats-time-series.js b/ui/app/components/stats-time-series.js index <HASH>..<HASH> 100644 --- a/ui/app/components/stats-time-series.js +++ b/ui/app/components/stats-time-series.js @@ -31,7 +31,7 @@ export default LineChart.extend({ const duration = formatDuration(xRange[1] - xRange[0], 'ms', true); - return `Time-series data for the last ${duration}, with values ranging from ${yFormatter(yRange[0])} to ${yFormatter(yRange[1])}`; + return `Time series data for the last ${duration}, with values ranging from ${yFormatter(yRange[0])} to ${yFormatter(yRange[1])}`; }), xScale: computed('data.[]', 'xProp', 'timeseries', 'yAxisOffset', function() {
Be consistent with "time series" instead of "time-series"
hashicorp_nomad
train
js
561a784339517e61c6e0c0bbb2a36d8389b701f7
diff --git a/src/FormObject/FieldList.php b/src/FormObject/FieldList.php index <HASH>..<HASH> 100644 --- a/src/FormObject/FieldList.php +++ b/src/FormObject/FieldList.php @@ -112,7 +112,7 @@ class FieldList extends Field implements Countable, ArrayAccess, IteratorAggrega if($numArgs > 1){ $args = func_get_args(); - for($i=0;$i<$numArgs;$i++){ + for($i=1;$i<$numArgs;$i++){ $this->push($args[$i]); } } @@ -213,4 +213,4 @@ class FieldList extends Field implements Countable, ArrayAccess, IteratorAggrega } return FALSE; } -} \ No newline at end of file +}
Fixed wrong start idx of push() param loop
mtils_formobject
train
php
67ccb24b41880cd2517f6ecf4e08a182a5d49256
diff --git a/test/test_generated.rb b/test/test_generated.rb index <HASH>..<HASH> 100644 --- a/test/test_generated.rb +++ b/test/test_generated.rb @@ -1,3 +1,5 @@ +require_relative "./helper" + class TestGenerated < Test::Unit::TestCase include Linguist
Require test helper in generated test
github_linguist
train
rb
6cd24bfabb25426453909f86c86d0ceede684899
diff --git a/test/performance.spec.js b/test/performance.spec.js index <HASH>..<HASH> 100644 --- a/test/performance.spec.js +++ b/test/performance.spec.js @@ -41,6 +41,7 @@ describe('Performance', function() { }; it('generates stats for the README', function() { + verifyResults(); var table = new Table({head: ['Number of validations', 'Total time (ms)']}); run(table, 100); run(table, 1000); @@ -52,10 +53,28 @@ describe('Performance', function() { var start = new Date(); for (var i = 0; i < count; ++i) { var errors = schema(invalidObject); - errors.should.have.length(3); } var end = new Date(); table.push([format()(count), end-start]); } + function verifyResults() { + var errors = schema(invalidObject); + errors.should.eql( + [{ + path: 'addresses[1].postcode', + value: undefined, + message: 'should be a number' + }, { + path: 'nicknames[2]', + value: false, + message: 'should be a string' + }, { + path: 'phones[2].type', + value: 'OTHER', + message: 'should be a valid enum value' + }] + ); + } + });
Don't count verification cost as part of the performance test
Tabcorp_strummer
train
js
93fc2d04a41040ff0a50dc13a019ca710f2e08aa
diff --git a/test/unit/integrations/pxpay_module_test.rb b/test/unit/integrations/pxpay_module_test.rb index <HASH>..<HASH> 100644 --- a/test/unit/integrations/pxpay_module_test.rb +++ b/test/unit/integrations/pxpay_module_test.rb @@ -121,7 +121,7 @@ class PxpayModuleTest < Test::Unit::TestCase def test_created_form_is_invalid_when_credentials_are_wrong Pxpay::Helper.any_instance.stubs(:ssl_post).returns('<Request valid="1"><Reco>IP</Reco><ResponseText>Invalid Access Info</ResponseText></Request>') - assert_raise_with_message(ActionViewHelperError, "error - failed to get token - message was Invalid Access Info") do + assert_raise(ActionViewHelperError) do payment_service_for('44',@username, :service => :pxpay, :amount => 157.0){|service| service.credential2 @key service.return_url "http://store.shopify.com/done"
No assert_raise_with_message in older rails
activemerchant_active_merchant
train
rb
7ea3361479b6dc975e25d8e7cfb345774f7471b1
diff --git a/plugins/CorePluginsAdmin/Controller.php b/plugins/CorePluginsAdmin/Controller.php index <HASH>..<HASH> 100644 --- a/plugins/CorePluginsAdmin/Controller.php +++ b/plugins/CorePluginsAdmin/Controller.php @@ -312,8 +312,16 @@ class Controller extends Plugin\ControllerAdmin return $pluginsFiltered; } - public function safemode($lastError) + public function safemode($lastError = array()) { + if (empty($lastError)) { + $lastError = array( + 'message' => Common::getRequestVar('error_message', null, 'string'), + 'file' => Common::getRequestVar('error_file', null, 'string'), + 'line' => Common::getRequestVar('error_line', null, 'integer') + ); + } + $outputFormat = Common::getRequestVar('format', 'html', 'string'); $outputFormat = strtolower($outputFormat);
refs #<I> if lastError is not set, get them from url param, allows us to create a UI test
matomo-org_matomo
train
php
3fd7f28b39c2e7bd92cc5afb284c71d9d827fda6
diff --git a/lnwallet/wallet.go b/lnwallet/wallet.go index <HASH>..<HASH> 100644 --- a/lnwallet/wallet.go +++ b/lnwallet/wallet.go @@ -5,7 +5,6 @@ import ( "crypto/sha256" "fmt" "net" - "strings" "sync" "sync/atomic" @@ -1114,12 +1113,9 @@ func (l *LightningWallet) handleFundingCounterPartySigs(msg *addCounterPartySigs // Broadcast the finalized funding transaction to the network. if err := l.PublishTransaction(fundingTx); err != nil { - // TODO(roasbeef): need to make this into a concrete error - if !strings.Contains(err.Error(), "already have") { - msg.err <- err - msg.completeChan <- nil - return - } + msg.err <- err + msg.completeChan <- nil + return } msg.completeChan <- res.partialState
lnwallet: don't ignore any returned error from PublishTransaction
lightningnetwork_lnd
train
go
732d37455e74e6472fb776db788804e7b47259ea
diff --git a/src/events/http/HttpServer.js b/src/events/http/HttpServer.js index <HASH>..<HASH> 100644 --- a/src/events/http/HttpServer.js +++ b/src/events/http/HttpServer.js @@ -5,7 +5,6 @@ import { join, resolve } from 'node:path' import process, { env, exit } from 'node:process' import h2o2 from '@hapi/h2o2' import { Server } from '@hapi/hapi' -import * as pathUtils from 'node:path' import authFunctionNameExtractor from '../authFunctionNameExtractor.js' import authJWTSettingsExtractor from './authJWTSettingsExtractor.js' import createAuthScheme from './createAuthScheme.js' @@ -429,10 +428,7 @@ export default class HttpServer { customizations && customizations.offline?.customAuthenticationProvider ) { - const root = pathUtils.resolve( - this.#serverless.serviceDir, - 'require-resolver', - ) + const root = resolve(this.#serverless.serviceDir, 'require-resolver') const customRequire = createRequire(root) const provider = customRequire(
refactor: re-use path.resolve kimport
dherault_serverless-offline
train
js
860253c2f010b3eedb3fa9a2f6d18ea4a7e8af05
diff --git a/Entity/OrderRepository.php b/Entity/OrderRepository.php index <HASH>..<HASH> 100644 --- a/Entity/OrderRepository.php +++ b/Entity/OrderRepository.php @@ -14,6 +14,7 @@ class OrderRepository extends ResourceRepository { /** * {@inheritdoc} + * @return \Ekyna\Component\Sale\Order\OrderInterface */ public function createNew($type = OrderTypes::TYPE_ORDER) {
[OrderBundle] Order repository phpdoc
ekyna_OrderBundle
train
php
ab4e1d9c933c659605fac9b7403f5c2e015ac769
diff --git a/app/adapters/operation.js b/app/adapters/operation.js index <HASH>..<HASH> 100644 --- a/app/adapters/operation.js +++ b/app/adapters/operation.js @@ -3,11 +3,11 @@ import buildURLWithPrefixMap from '../utils/build-url-with-prefix-map'; export default ApplicationAdapter.extend({ buildURL: buildURLWithPrefixMap({ - 'databases': {property: 'database.id'}, - 'apps': {property: 'app.id'}, - 'vhosts': {property: 'vhost.id'}, - 'log_drains': {property: 'logDrain.id'}, - 'services': {property: 'service.id'} + 'databases': {property: 'database.id', only:['create', 'index']}, + 'apps': {property: 'app.id', only:['create', 'index']}, + 'vhosts': {property: 'vhost.id', only:['create', 'index']}, + 'log_drains': {property: 'logDrain.id', only:['create', 'index']}, + 'services': {property: 'service.id', only:['create', 'index']} }), findQuery: function(store, type, query){
Only prefix operation parent for create and index This commit should only prefix the parent path for an operation for create or index paths. This means that for example if the parent is a service the show method goes directly to /operations/{id} instead of /services/{id}/operations/{id}.
aptible_ember-cli-aptible-shared
train
js
57e5e1b145938cc0da9c9d535d64d04daa9009b9
diff --git a/Controller/CalendarController.php b/Controller/CalendarController.php index <HASH>..<HASH> 100644 --- a/Controller/CalendarController.php +++ b/Controller/CalendarController.php @@ -105,7 +105,7 @@ class CalendarController extends Controller } // Return a JSON response. - return new JsonResponse($result); + return new JsonResponse($this->prepareResult($events, $production)); } /** @@ -181,6 +181,20 @@ class CalendarController extends Controller new \DateTime('@' . ($request->query->get('to')/1000)) ); + // Return a JSON response. + return new JsonResponse($this->prepareResult($events, $production)); + } + + /** + * Helper function to prepare results for the calendar. + * + * @param array $events The events to return. + * @param Production $production The production for these events. + * + * @return array The formatted events. + */ + private function prepareResult(array $events, Production $production): array + { // Create array of events for calendar. $result = [ 'success' => 1, @@ -199,8 +213,6 @@ class CalendarController extends Controller 'end' => $event->getEnd()->format('U') * 1000, ]; } - - // Return a JSON response. - return new JsonResponse($result); + return $result; } }
Adding helper function to prepare results.
bkstg_schedule-bundle
train
php
f544a3f799cf7b148bf9203983e642aeaee39643
diff --git a/php/lib/GrabzItClient.class.php b/php/lib/GrabzItClient.class.php index <HASH>..<HASH> 100644 --- a/php/lib/GrabzItClient.class.php +++ b/php/lib/GrabzItClient.class.php @@ -14,7 +14,7 @@ class GrabzItClient private $signaturePartOne; private $signaturePartTwo; private $request; - private $connectionTimeout = 120; + private $connectionTimeout = 600; public function __construct($applicationKey, $applicationSecret) {
Matched default connection timeout with max server side timeout
GrabzIt_grabzit
train
php
87b1da63f4ce6744f04766f7adb73393eec752cd
diff --git a/ants/registration/interface.py b/ants/registration/interface.py index <HASH>..<HASH> 100644 --- a/ants/registration/interface.py +++ b/ants/registration/interface.py @@ -1565,7 +1565,7 @@ def motion_correction( temp = utils.iMath(temp, "Normalize") if temp.numpy().var() > 0: if outprefix != "": - outprefixloc = outprefix + "_" + str.zfill( str(k), 5 ) + outprefixloc = outprefix + "_" + str.zfill( str(k), 5 ) + "_" myreg = registration( fixed, temp, type_of_transform=type_of_transform, mask=mask, outprefix=outprefixloc, **kwargs
STYLE: of output prefix naming for motion correction
ANTsX_ANTsPy
train
py
3bb5b5e7d4368038215e3998787eec06df9c2165
diff --git a/packages/table/src/table-body.js b/packages/table/src/table-body.js index <HASH>..<HASH> 100644 --- a/packages/table/src/table-body.js +++ b/packages/table/src/table-body.js @@ -3,7 +3,6 @@ import { hasClass } from 'element-ui/src/utils/dom'; import ElCheckbox from 'element-ui/packages/checkbox'; import ElTooltip from 'element-ui/packages/tooltip'; import debounce from 'throttle-debounce/debounce'; -import ElTooltip from 'element-ui/packages/tooltip'; export default { components: {
Table: delete duplicate declaration "ElTooltip", fixed #<I> (#<I>)
ElemeFE_element
train
js
bef9a6ee64f3c21a559c6123a2d64e09f67d3d20
diff --git a/virtualenv/manage.py b/virtualenv/manage.py index <HASH>..<HASH> 100644 --- a/virtualenv/manage.py +++ b/virtualenv/manage.py @@ -112,7 +112,7 @@ class VirtualEnvironment(object): def installed_packages(self): """List of all packages that are installed in this environment.""" pkgs = [] #: [(name, ver), ..] - l = self._execute([self._pip_rpath, 'freeze']).split(linesep) + l = self._execute([self._pip_rpath, 'freeze', '-l']).split(linesep) for p in l: if p == '': continue pkgs.append(split_package_name(p))
show only packages installed in the venv
sjkingo_virtualenv-api
train
py
92158e69e17b6d3d091bd49883eaf9705241494b
diff --git a/build/tasks/test.js b/build/tasks/test.js index <HASH>..<HASH> 100644 --- a/build/tasks/test.js +++ b/build/tasks/test.js @@ -8,10 +8,10 @@ gulp.task('test', ['lint'], function(done) { var karmaServer = new KarmaServer({ configFile: __dirname + '/../../karma.conf.js', singleRun: true - }, function() { + }, function(exitCode) { done(); - process.exit(); + process.exit(exitCode); }); karmaServer.start();
chore(test): test task exit with exit code
SpoonX_aurelia-authentication
train
js
96aac637eafa3d7c7a11e86475374f7039207bbd
diff --git a/b2.go b/b2.go index <HASH>..<HASH> 100644 --- a/b2.go +++ b/b2.go @@ -15,6 +15,18 @@ // Downloads from B2 are simple GETs, so if you want more control than the // standard functions you can build your own URL according to the API docs. // All the information you need is in the Client object. +// +// Hidden files and versions +// +// There is no first-class support for versions in this library, but most +// behaviors are transparently exposed. Upload can be used multiple times +// with the same name, ListFiles will only return the latest version of +// non-hidden files, and ListFilesVersions will return all files and versions. +// +// Unsupported APIs +// +// Large files (b2_*_large_file, b2_*_part), b2_get_download_authorization, +// b2_hide_file, b2_update_bucket. package b2 import (
Add documentation about unimplemented parts of the API
FiloSottile_b2
train
go
70dc6d4dea07965bee969bab52daee64b7353658
diff --git a/src/test/php/DateTest.php b/src/test/php/DateTest.php index <HASH>..<HASH> 100644 --- a/src/test/php/DateTest.php +++ b/src/test/php/DateTest.php @@ -504,11 +504,20 @@ class DateTest extends TestCase { $date = new Date('31.12.1969 00:00 GMT'); $clonedDate = clone $date; - $dateHandle = new class('today') extends Date - { - public function of(Date $date): \DateTime { return $date->dateTime; } - }; - assertThat($dateHandle->of($clonedDate), isNotSameAs($dateHandle->of($date))); + assertThat($this->retrieveHandle($clonedDate), isNotSameAs($this->retrieveHandle($date))); + } + + /** + * Retrieves date handle from given date. + * + * @param Date $date + * @return \DateTime + */ + private function retrieveHandle(Date $date): \DateTime + { + $property = (new \ReflectionObject($date))->getProperty('dateTime'); + $property->setAccessible(true); + return $property->getValue($date); } /**
replace anonymous class, pcov on Mac segfaults with it
stubbles_stubbles-date
train
php
1cf19e1bb75b993c9c4ba318f197c883a8dd5a25
diff --git a/Player.py b/Player.py index <HASH>..<HASH> 100644 --- a/Player.py +++ b/Player.py @@ -65,17 +65,6 @@ class Player(object): this method does nothing and may raise an error. """ - def Seeked(postition): - """Indicates that the track position has changed in a way - that is inconsistant with the current playing state. - Parameters - position — The new position, in microseconds. - - This signal does not need to be emitted - when playback starts or when the track changes, - unless the track is starting at an unexpected position. - """ - def PlaybackStatus(self): """The current playback status. May be "Playing", "Paused" or "Stopped".
removed signal 'Seeked';
wistful_pympris
train
py
392e7d0f0ac7228fe1610d2ff0dff2e3487448de
diff --git a/src/frontend/org/voltdb/iv2/LeaderAppointer.java b/src/frontend/org/voltdb/iv2/LeaderAppointer.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/iv2/LeaderAppointer.java +++ b/src/frontend/org/voltdb/iv2/LeaderAppointer.java @@ -320,10 +320,11 @@ public class LeaderAppointer implements Promotable } else if (m_state.get() == AppointerState.INIT) { try { - if ((m_iv2appointees.pointInTimeCache().size() != getInitialPartitionCount()) || - (m_iv2masters.pointInTimeCache().size() != getInitialPartitionCount())) { + if ((m_iv2appointees.pointInTimeCache().size() < getInitialPartitionCount()) || + (m_iv2masters.pointInTimeCache().size() < getInitialPartitionCount()) || + (m_iv2appointees.pointInTimeCache().size() != m_iv2masters.pointInTimeCache().size())) { // If we are promoted and the appointees or masters set is partial, the previous appointer failed - // during startup (at least for now, until we add add/remove a partition on the fly). + // during startup (at least for now, until we add remove a partition on the fly). VoltDB.crashGlobalVoltDB("Detected failure during startup, unable to start", false, null); } } catch (IllegalAccessException e) {
Fix LeaderAppointer check for elastic. Taking the coward way out of this. Loosing the partition count check on LeaderAppointer promotion. If a new LeaderAppointer is elected, only crash if the number of partitions is LESS than that when the cluster initially started. Elastic join adds new partitions on the fly, so tolerate that.
VoltDB_voltdb
train
java
1f4a8cb2f0f821cb36f1f76df55b11d2f29bea03
diff --git a/pages/app/controllers/refinery/pages_controller.rb b/pages/app/controllers/refinery/pages_controller.rb index <HASH>..<HASH> 100644 --- a/pages/app/controllers/refinery/pages_controller.rb +++ b/pages/app/controllers/refinery/pages_controller.rb @@ -3,7 +3,7 @@ module Refinery include Pages::RenderOptions before_action :find_page, :set_canonical - before_action :error_404, :unless => :current_user_can_view_page? + before_action :error_404, unless: :current_user_can_view_page? # Save whole Page after delivery after_action :write_cache? @@ -60,9 +60,13 @@ module Refinery end def current_user_can_view_page? - page.live? || authorisation_manager.allow?(:plugin, "refinery_pages") + page.live? || current_refinery_user_can_access?("refinery_pages") end + def current_refinery_user_can_access?(plugin) + admin? && authorisation_manager.allow?(:plugin, plugin) + end + def first_live_child page.children.order('lft ASC').live.first end
Bugfix draft page view for user with access only
refinery_refinerycms
train
rb
eb0a179e023314f063eb37258ebb913c4a5d3544
diff --git a/tests/frontend/org/voltdb/iv2/TestMpPromoteAlgo.java b/tests/frontend/org/voltdb/iv2/TestMpPromoteAlgo.java index <HASH>..<HASH> 100644 --- a/tests/frontend/org/voltdb/iv2/TestMpPromoteAlgo.java +++ b/tests/frontend/org/voltdb/iv2/TestMpPromoteAlgo.java @@ -41,6 +41,7 @@ import junit.framework.TestCase; import org.junit.Test; import org.mockito.InOrder; import org.voltcore.utils.Pair; +import org.voltdb.messaging.Iv2InitiateTaskMessage; import org.voltdb.messaging.CompleteTransactionMessage; import org.voltdb.messaging.FragmentTaskMessage; import org.voltdb.messaging.Iv2RepairLogRequestMessage; @@ -109,6 +110,7 @@ public class TestMpPromoteAlgo extends TestCase long sourceHSId, int sequence, int ofTotal, long handle) { FragmentTaskMessage frag = mock(FragmentTaskMessage.class); + when(frag.getInitiateTask()).thenReturn(mock(Iv2InitiateTaskMessage.class)); Iv2RepairLogResponseMessage m = new Iv2RepairLogResponseMessage(requestId, sequence, ofTotal, handle, handle, frag); m.m_sourceHSId = sourceHSId;
Fix test case that tripped an assertion
VoltDB_voltdb
train
java
6cdfe5301f877d90ed8a6ed116af1f867d299c58
diff --git a/lib/conceptql/operators/multiple_vocabularies.rb b/lib/conceptql/operators/multiple_vocabularies.rb index <HASH>..<HASH> 100644 --- a/lib/conceptql/operators/multiple_vocabularies.rb +++ b/lib/conceptql/operators/multiple_vocabularies.rb @@ -32,6 +32,7 @@ module ConceptQL h = super op_info = multiple_vocabularies[name].first h[:preferred_name] = op_info[:operator] + h[:predominant_domains] = multiple_vocabularies[name].map { |h| h[:domain] }.uniq.compact h end end diff --git a/lib/conceptql/operators/vocabulary.rb b/lib/conceptql/operators/vocabulary.rb index <HASH>..<HASH> 100644 --- a/lib/conceptql/operators/vocabulary.rb +++ b/lib/conceptql/operators/vocabulary.rb @@ -66,6 +66,7 @@ module ConceptQL h = super vocab = assigned_vocabularies[name] h[:preferred_name] = vocab[:vocabulary_short_name] || vocab[:id] + h[:predominant_domains] = [vocab[:domain]].flatten h end end
(Multi)Vocabulary: register predominant domains This should help color the operators on the JAM. Addresses #<I>
outcomesinsights_conceptql
train
rb,rb
aa3d50c590515a966672b588dcb7c112dccc6e05
diff --git a/framework/core/migrations/2015_02_24_000000_create_users_table.php b/framework/core/migrations/2015_02_24_000000_create_users_table.php index <HASH>..<HASH> 100644 --- a/framework/core/migrations/2015_02_24_000000_create_users_table.php +++ b/framework/core/migrations/2015_02_24_000000_create_users_table.php @@ -18,7 +18,6 @@ return Migration::createTable( $table->string('email', 150)->unique(); $table->boolean('is_activated')->default(0); $table->string('password', 100); - $table->text('bio')->nullable(); $table->string('avatar_path', 100)->nullable(); $table->binary('preferences')->nullable(); $table->dateTime('join_time')->nullable();
Don't create user bio column on new installations (#<I>)
flarum_core
train
php
ce947a1ceb0f7698a09775612d22817d60b5e875
diff --git a/generator/osc.go b/generator/osc.go index <HASH>..<HASH> 100644 --- a/generator/osc.go +++ b/generator/osc.go @@ -27,6 +27,14 @@ func NewOsc(shape WaveType, hz float64, fs int) *Osc { return &Osc{Shape: shape, Amplitude: 1, Freq: hz, Fs: fs, phaseAngleIncr: ((hz * TwoPi) / float64(fs))} } +// SetFreq updates the oscillator frequency +func (o *Osc) SetFreq(hz float64) { + if o.Freq != hz { + o.Freq = hz + o.phaseAngleIncr = ((hz * TwoPi) / float64(o.Fs)) + } +} + // Signal uses the osc to generate a discreet signal func (o *Osc) Signal(length int) []float64 { output := make([]float64, length)
generator: allow the change of freq on the fly
mattetti_audio
train
go
a458ef9fbf6693097ea1a64cbd8db0cfbb9f0fea
diff --git a/jira/client.py b/jira/client.py index <HASH>..<HASH> 100644 --- a/jira/client.py +++ b/jira/client.py @@ -2306,8 +2306,9 @@ class JIRA(object): from requests_kerberos import HTTPKerberosAuth from requests_kerberos import OPTIONAL - mutual_authentication = OPTIONAL - if kerberos_options.get('mutual_authentication') == 'DISABLED': + if kerberos_options.get('mutual_authentication', 'OPTIONAL') == 'OPTIONAL': + mutual_authentication = OPTIONAL + elif kerberos_options.get('mutual_authentication') == 'DISABLED': mutual_authentication = DISABLED else: raise ValueError("Unknown value for mutual_authentication: %s" %
Make OPTIONAL default and allowed value of mutual_authentication Before this change Kerberos authentication worked only if Kerberos option mutual_authentication was explicitly set to DISABLED. OPTIONAL was not default value anymore but it wasn't among allowed values of mutual_authentication. Therefore these authentications failed with raised exception: ValueError: Unknown value for mutual_authentication Relates: #<I> Relates: #<I>
pycontribs_jira
train
py
2ce813fefb7d3f946303777b9381ecf707542d20
diff --git a/packages/Users/Controllers/UserController.php b/packages/Users/Controllers/UserController.php index <HASH>..<HASH> 100644 --- a/packages/Users/Controllers/UserController.php +++ b/packages/Users/Controllers/UserController.php @@ -54,7 +54,7 @@ class UserController extends Controller } /** - * update profile action + * Update profile action * @param Request $request * @return Response */ @@ -102,9 +102,10 @@ class UserController extends Controller 'user' => $user ]), 200); } + /** - * [delete user] - * @param [int] $id [id user] + * Delete user + * @param int $id * @return Response */ public function delete($id)
Update Conventions file UserController.php
php-soft_laravel-users
train
php
443e2a24d7a6bab2d7a2a0c96fe29ebeb40d894d
diff --git a/src/React/Whois/Client.php b/src/React/Whois/Client.php index <HASH>..<HASH> 100644 --- a/src/React/Whois/Client.php +++ b/src/React/Whois/Client.php @@ -34,7 +34,7 @@ class Client $this->dns->resolve($target, array($deferred, 'resolve')); - return $deferred; + return $deferred->promise(); } public function queryWhoisServer($domain, $ip) @@ -53,6 +53,6 @@ class Client $deferred->resolve($result); }); - return $deferred; + return $deferred->promise(); } }
Return promise instead of full deferred
reactphp-legacy_whois
train
php
0ed63763db91521bb32be3bdab25af09ea8d0873
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -15,13 +15,12 @@ var Simple = Formatter.extend(); /** * After all tests. * - * @param {Result} test result * @api public */ -Simple.prototype.afterAll = function(result) { - this.displayResult(result); - this.displayFailed(result); +Simple.prototype.afterAll = function() { + this.displayResult(); + this.displayFailed(); }; /**
Make compatible with hydro <I>
hydrojs_simple
train
js
7ba7f7c7cbce843c3bacf71b0a1e05882f1f9592
diff --git a/system/modules/generalDriver/GeneralControllerDefault.php b/system/modules/generalDriver/GeneralControllerDefault.php index <HASH>..<HASH> 100644 --- a/system/modules/generalDriver/GeneralControllerDefault.php +++ b/system/modules/generalDriver/GeneralControllerDefault.php @@ -2860,7 +2860,7 @@ class GeneralControllerDefault extends Controller implements InterfaceGeneralCon $arrProcedure[] = array('operation' => 'IN', 'property' => 'id', 'values' => array_map('intval', $this->getDC()->getRootIds())); } - foreach ($this->getFilter() as $arrSubFilter) + foreach ((array)$this->getFilter() as $arrSubFilter) { if ($arrSubFilter['property'] != $field) {
Fix a warning when no filter has been selecten in the backend.
contao-community-alliance_dc-general
train
php