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
fb7d7b0f6ee9fea030766ab85c3f06edfcdc456b
diff --git a/src/directives/jf_sidebar/jf_sidebar.js b/src/directives/jf_sidebar/jf_sidebar.js index <HASH>..<HASH> 100644 --- a/src/directives/jf_sidebar/jf_sidebar.js +++ b/src/directives/jf_sidebar/jf_sidebar.js @@ -274,7 +274,7 @@ class jfSidebarController { } else { if (!this.skip && this.menu.width !== this.subMenuWidth) { this._updateMenuObject(this.subMenuWidth,'0.3s','0s'); - this._setSubMenuFocus(); + this.$timeout(()=>this._setSubMenuFocus()); if(angular.isDefined(this.subMenuDelay)) { this._subMenuDelayStop(); }
Fix jf-sidebar extended menu filter not focused on first time
jfrog_jfrog-ui-essentials
train
js
11514ba5078bc0ea5af65cd3843034f9bcc630cf
diff --git a/presto-main/src/main/java/com/facebook/presto/execution/scheduler/BroadcastOutputBufferManager.java b/presto-main/src/main/java/com/facebook/presto/execution/scheduler/BroadcastOutputBufferManager.java index <HASH>..<HASH> 100644 --- a/presto-main/src/main/java/com/facebook/presto/execution/scheduler/BroadcastOutputBufferManager.java +++ b/presto-main/src/main/java/com/facebook/presto/execution/scheduler/BroadcastOutputBufferManager.java @@ -23,7 +23,6 @@ import java.util.function.Consumer; import static com.facebook.presto.OutputBuffers.BROADCAST_PARTITION_ID; import static com.facebook.presto.OutputBuffers.INITIAL_EMPTY_OUTPUT_BUFFERS; -import static com.google.common.base.Preconditions.checkArgument; import static java.util.Objects.requireNonNull; @ThreadSafe @@ -51,8 +50,8 @@ class BroadcastOutputBufferManager return; } - checkArgument(partition == BROADCAST_PARTITION_ID, "Broadcast partition must be %s", BROADCAST_PARTITION_ID); - newOutputBuffers = outputBuffers.withBuffer(bufferId, partition); + // Note: it does not matter which partition id the task is using, in broadcast all tasks read from the same partition + newOutputBuffers = outputBuffers.withBuffer(bufferId, BROADCAST_PARTITION_ID); if (newOutputBuffers == outputBuffers) { return; }
Remove invalid check for broadcast partition id Do not use the partition id assigned to the task for broadcast distributions. Instead all tasks read from the same partition. Fixes #<I>
prestodb_presto
train
java
6ed5670ace8d9c01a9bd0977ef4656e68563e60d
diff --git a/DrdPlus/Tables/Speed/SpeedMeasurement.php b/DrdPlus/Tables/Speed/SpeedMeasurement.php index <HASH>..<HASH> 100644 --- a/DrdPlus/Tables/Speed/SpeedMeasurement.php +++ b/DrdPlus/Tables/Speed/SpeedMeasurement.php @@ -31,18 +31,16 @@ class SpeedMeasurement extends AbstractMeasurement */ public function addInDifferentUnit($value, $unit) { - $this->checkUnit($unit); + parent::checkValueInDifferentUnit($value, $unit); $this->checkProportion($value, $unit, $this->getValue(), $this->getUnit()); - $this->inDifferentUnits[$unit] = ToFloat::toFloat($value); + if ($this->getUnit() !== $unit) { + $this->inDifferentUnits[$unit] = ToFloat::toFloat($value); + } } private function checkProportion($value, $unit, $originalValue, $originalUnit) { - if ($unit === $originalUnit) { - if ($value !== $originalValue) { - throw new \LogicException; - } - } else if ($unit === self::M_PER_ROUND && $originalUnit === self::KM_PER_HOUR) { + if ($unit === self::M_PER_ROUND && $originalUnit === self::KM_PER_HOUR) { if ($value <= $originalValue) { throw new \LogicException; }
Speed measurement reuses more code from generic parent
drdplusinfo_tables
train
php
ff020055f33635fd6d9a65d64bc013286bea0089
diff --git a/packages/openneuro-app/src/scripts/dataset/tools/index.js b/packages/openneuro-app/src/scripts/dataset/tools/index.js index <HASH>..<HASH> 100644 --- a/packages/openneuro-app/src/scripts/dataset/tools/index.js +++ b/packages/openneuro-app/src/scripts/dataset/tools/index.js @@ -203,7 +203,7 @@ class Tools extends Reflux.Component { tooltip: 'Follow Dataset', icon: 'fa-tag icon-plus', action: actions.createSubscription.bind(this), - display: 1 && !isSubscribed, + display: isSignedIn && !isSubscribed, warn: false, validations: [ {
users that are not signed in cannot follow a dataset
OpenNeuroOrg_openneuro
train
js
a6c4793d02f8afff548433f1dc3d5c86f50efbd2
diff --git a/dustmaps/bayestar.py b/dustmaps/bayestar.py index <HASH>..<HASH> 100644 --- a/dustmaps/bayestar.py +++ b/dustmaps/bayestar.py @@ -618,7 +618,7 @@ def fetch(version='bayestar2019'): requirements = { 'bayestar2015': {'contentType': 'application/x-hdf'}, - 'bayestar2017': {'filename': 'bayestar2017.h5'} + 'bayestar2017': {'filename': 'bayestar2017.h5'}, 'bayestar2019': {'filename': 'bayestar2019.h5'} }[version]
Fixed Bayestar<I> fetcher.
gregreen_dustmaps
train
py
55056abae0bcb49e03ebf6b01ebcad9c074ff178
diff --git a/docroot/modules/custom/ymca_retention/src/PersonifyApi.php b/docroot/modules/custom/ymca_retention/src/PersonifyApi.php index <HASH>..<HASH> 100644 --- a/docroot/modules/custom/ymca_retention/src/PersonifyApi.php +++ b/docroot/modules/custom/ymca_retention/src/PersonifyApi.php @@ -67,7 +67,8 @@ class PersonifyApi { } $body = $response->getBody(); return json_decode($body->getContents()); - } catch (\Exception $e) { + } + catch (\Exception $e) { watchdog_exception('ymca_personify', $e); } return []; @@ -120,7 +121,8 @@ class PersonifyApi { } $visits = $results->FacilityVisitCustomerRecord; return reset($visits); - } catch (\Exception $e) { + } + catch (\Exception $e) { watchdog_exception('ymca_personify', $e); } return []; @@ -166,7 +168,8 @@ class PersonifyApi { } $body = $response->getBody(); return json_decode($body->getContents()); - } catch (\Exception $e) { + } + catch (\Exception $e) { watchdog_exception('ymca_personify', $e); } return [];
[YMCA-<I>] fix sniffer notes
ymcatwincities_openy
train
php
0343b31b3238407f5c4647acfa2a9f502e0c6127
diff --git a/packages/micro-journeys/src/two-character-layout.js b/packages/micro-journeys/src/two-character-layout.js index <HASH>..<HASH> 100644 --- a/packages/micro-journeys/src/two-character-layout.js +++ b/packages/micro-journeys/src/two-character-layout.js @@ -71,6 +71,9 @@ class BoltTwoCharacterLayout extends withLitHtml() { persistentlyAttemptToEqualizeRelativeHeights( eqHeightArgs, this.setConnectionWidth, + 0, + 3, + true, ); }
chore(micro-journeys): remove debug code from two-char layout
bolt-design-system_bolt
train
js
5a25b6cfc1b32ee809420767769d68c8dd74da1c
diff --git a/sources/scalac/backend/jvm/GenJVM.java b/sources/scalac/backend/jvm/GenJVM.java index <HASH>..<HASH> 100644 --- a/sources/scalac/backend/jvm/GenJVM.java +++ b/sources/scalac/backend/jvm/GenJVM.java @@ -483,6 +483,25 @@ class GenJVM { generatedType = finalType; } break; + case Switch(Tree test, int[] tags, Tree[] bodies, Tree otherwise): { + JLabel[] labels = new JLabel[bodies.length]; + for (int i = 0; i < labels.length; ++i) labels[i] = new JLabel(); + JLabel defaultLabel = new JLabel(); + JLabel afterLabel = new JLabel(); + + genLoad(ctx, test, JType.INT); + ctx.code.emitSWITCH(tags, labels, defaultLabel, 0.9F); + for (int i = 0; i < bodies.length; ++i) { + ctx.code.anchorLabelToNext(labels[i]); + genLoad(ctx, bodies[i], expectedType); + ctx.code.emitGOTO(afterLabel); + } + ctx.code.anchorLabelToNext(defaultLabel); + genLoad(ctx, otherwise, expectedType); + ctx.code.anchorLabelToNext(afterLabel); + generatedType = expectedType; + } break; + case This(_): case Super(_, _): ctx.code.emitALOAD_0();
- implemented new Switch node (warning, unteste... - implemented new Switch node (warning, untested code, I'm waiting for test cases)
scala_scala
train
java
559c513acae725acbbf464214f2b309d4bf25723
diff --git a/go/engine/engine.go b/go/engine/engine.go index <HASH>..<HASH> 100644 --- a/go/engine/engine.go +++ b/go/engine/engine.go @@ -54,14 +54,18 @@ func runPrereqs(e Engine, ctx *Context) (err error) { } -func RunEngine(e Engine, ctx *Context) error { - if err := check(e, ctx); err != nil { +func RunEngine(e Engine, ctx *Context) (err error) { + e.G().Log.Debug("+ RunEngine(%s)", e.Name()) + defer func() { e.G().Log.Debug("- RunEngine(%s) -> %s", e.Name(), libkb.ErrToOk(err)) }() + + if err = check(e, ctx); err != nil { return err } - if err := runPrereqs(e, ctx); err != nil { + if err = runPrereqs(e, ctx); err != nil { return err } - return e.Run(ctx) + err = e.Run(ctx) + return err } func check(c libkb.UIConsumer, ctx *Context) error {
Add entry/exit debug to RunEngine
keybase_client
train
go
ae22dcd28c3d0aed258a7fcb1d9c931c7ab44b73
diff --git a/test/test_autopep8.py b/test/test_autopep8.py index <HASH>..<HASH> 100755 --- a/test/test_autopep8.py +++ b/test/test_autopep8.py @@ -430,6 +430,10 @@ sys.maxint pass # pragma: no cover self.assertEqual(None, autopep8.extract_code_from_function(e123)) + def fix_(): + pass # pragma: no cover + self.assertEqual(None, autopep8.extract_code_from_function(fix_)) + class SystemTests(unittest.TestCase):
Test "fix_()" case in code extraction
hhatto_autopep8
train
py
ccc12a647ac1739c5b726169a09614a7db2a040f
diff --git a/prospector/tools/mccabe/__init__.py b/prospector/tools/mccabe/__init__.py index <HASH>..<HASH> 100644 --- a/prospector/tools/mccabe/__init__.py +++ b/prospector/tools/mccabe/__init__.py @@ -19,8 +19,9 @@ def _find_code_files(rootpath, ignores): for root, _, files in os.walk(rootpath): for potential in files: - fullpath = os.path.relpath(os.path.join(root, potential), rootpath) - if potential.endswith('.py') and not any([ip.search(fullpath) for ip in ignores]): + fullpath = os.path.join(root, potential) + relpath = os.path.relpath(fullpath, rootpath) + if potential.endswith('.py') and not any([ip.search(relpath) for ip in ignores]): code_files.append(fullpath) return code_files @@ -77,6 +78,7 @@ class McCabeTool(ToolBase): function=graph.entity, line=graph.lineno, character=0, + absolute_path=True ) message = Message( source='mccabe',
Fixing path handling in mccabe tool. The previous fix to test relative paths against ignoring introduced a bug where the full path to the file to be checked was not returned, which in turn prevented files being checked if prospector was run using the --path parameter
PyCQA_prospector
train
py
65aee29f13581181640c0d4fdeeb05678f39f271
diff --git a/lib/juicy/initializers.rb b/lib/juicy/initializers.rb index <HASH>..<HASH> 100644 --- a/lib/juicy/initializers.rb +++ b/lib/juicy/initializers.rb @@ -1,2 +1,3 @@ ENV['RACK_ENV'] ||= "development" +Mongoid.logger.level = Logger::INFO Mongoid.load!("config/mongoid.yml")
Tone down mongo's logging
richo_juici
train
rb
c99f65d2603190541791eb4fe5304b7abe664b6f
diff --git a/src/main/java/de/btobastian/javacord/entities/impl/ImplServer.java b/src/main/java/de/btobastian/javacord/entities/impl/ImplServer.java index <HASH>..<HASH> 100644 --- a/src/main/java/de/btobastian/javacord/entities/impl/ImplServer.java +++ b/src/main/java/de/btobastian/javacord/entities/impl/ImplServer.java @@ -800,8 +800,7 @@ public class ImplServer implements Server { .asJson(); api.checkResponse(response); if (voice) { - // TODO voice channels - return null; + return new ImplVoiceChannel(response.getBody().getObject(), this, api); } else { return new ImplChannel(response.getBody().getObject(), this, api); }
Added missing VoiceChannel object creation
Javacord_Javacord
train
java
99ec829652a70430a820e8525d66e4d76dc3329d
diff --git a/src/Task/SymlinkReleaseTask.php b/src/Task/SymlinkReleaseTask.php index <HASH>..<HASH> 100644 --- a/src/Task/SymlinkReleaseTask.php +++ b/src/Task/SymlinkReleaseTask.php @@ -16,7 +16,10 @@ use TYPO3\Surf\Domain\Service\ShellCommandServiceAwareInterface; use TYPO3\Surf\Domain\Service\ShellCommandServiceAwareTrait; /** - * A symlink task for switching over the current directory to the new release + * A symlink task for switching over the current directory to the new release. + * + * It doesn't take any options. + * */ class SymlinkReleaseTask extends Task implements ShellCommandServiceAwareInterface {
[TASK] Add documentation in class annotation for `SymlinkReleaseTask` (#<I>)
TYPO3_Surf
train
php
40dff651dd71042684f79ba4a5fed8f056274438
diff --git a/src/test/java/org/cp/elements/beans/model/BeanModelUnitTests.java b/src/test/java/org/cp/elements/beans/model/BeanModelUnitTests.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/cp/elements/beans/model/BeanModelUnitTests.java +++ b/src/test/java/org/cp/elements/beans/model/BeanModelUnitTests.java @@ -57,7 +57,7 @@ public class BeanModelUnitTests { assertThat(userModel.getBeanInfo()).isNotNull(); assertThat(userModel.getProperties()).isNotNull(); assertThat(userModel.getTargetObject()).isSameAs(mockUser); - assertThat(userModel.getTargetType()).isEqualTo(User.class); + assertThat(User.class).isAssignableFrom(userModel.getTargetType()); verify(mockUserBean, atLeastOnce()).getTarget(); } @@ -87,7 +87,7 @@ public class BeanModelUnitTests { assertThat(processModel.getBeanInfo()).isNotNull(); assertThat(processModel.getProperties()).isNotNull(); assertThat(processModel.getTargetObject()).isSameAs(mockProcess); - assertThat(processModel.getTargetType()).isEqualTo(Process.class); + assertThat(Process.class).isAssignableFrom(processModel.getTargetType()); verify(mockProcessBean, atLeastOnce()).getTarget(); }
Fix failing tests in BeanModelUnitTests.
codeprimate-software_cp-elements
train
java
db3a916e99615c07f4a91db064c77f40652e0d20
diff --git a/bct/algorithms/centrality.py b/bct/algorithms/centrality.py index <HASH>..<HASH> 100644 --- a/bct/algorithms/centrality.py +++ b/bct/algorithms/centrality.py @@ -327,7 +327,7 @@ def edge_betweenness_wei(G): if D[S].size == 0: break # all nodes reached, or if np.isinf(np.min(D[S])): # some cannot be reached - Q[:q], = np.where(np.isinf(D)) # these are first in line + Q[:q + 1], = np.where(np.isinf(D)) # these are first in line. break V, = np.where(D == np.min(D[S]))
Changed L<I> from Q[:q] to Q[:q<I>]
aestrivex_bctpy
train
py
5bec9816a1e29daf36447fab7e358de7f67c7999
diff --git a/question/type/ddmarker/version.php b/question/type/ddmarker/version.php index <HASH>..<HASH> 100644 --- a/question/type/ddmarker/version.php +++ b/question/type/ddmarker/version.php @@ -25,14 +25,14 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2013070100; +$plugin->version = 2014010800; $plugin->requires = 2013051400; $plugin->cron = 0; $plugin->component = 'qtype_ddmarker'; $plugin->maturity = MATURITY_STABLE; -$plugin->release = '1.3 for Moodle 2.5+'; +$plugin->release = '1.4 for Moodle 2.5+'; $plugin->dependencies = array( - 'qtype_gapselect' => 2013070100, - 'qtype_ddimageortext' => 2013070100, + 'qtype_gapselect' => 2014010800, + 'qtype_ddimageortext' => 2014010800, );
MDL-<I> ddmarker: Update version number for the <I> release.
moodle_moodle
train
php
b4ec1b36c4f4e7c20fe9e672c5dbe5553696a824
diff --git a/src/Composer/Downloader/GitDownloader.php b/src/Composer/Downloader/GitDownloader.php index <HASH>..<HASH> 100644 --- a/src/Composer/Downloader/GitDownloader.php +++ b/src/Composer/Downloader/GitDownloader.php @@ -36,10 +36,6 @@ class GitDownloader implements DownloaderInterface throw new \InvalidArgumentException('The given package is missing reference information'); } - if (!extension_loaded('openssl')) { - throw new \RuntimeException('You must enable the openssl extension to clone git repositories'); - } - $url = escapeshellarg($package->getSourceUrl()); $ref = escapeshellarg($package->getSourceReference()); system(sprintf('git clone %s %s && cd %2$s && git reset --hard %s', $url, $path, $ref));
OpenSSL is not required to clone git repos
mothership-ec_composer
train
php
63022950b4b8bf1cf7f820b1e69c824249010637
diff --git a/test/helpers_test.rb b/test/helpers_test.rb index <HASH>..<HASH> 100644 --- a/test/helpers_test.rb +++ b/test/helpers_test.rb @@ -460,6 +460,12 @@ class HelpersTest < Test::Unit::TestCase assert_equal 'attachment; filename="file.txt"', response['Content-Disposition'] end + it "sets the Content-Disposition header when :disposition set to 'inline'" do + send_file_app :disposition => 'inline' + get '/file.txt' + assert_equal 'inline', response['Content-Disposition'] + end + it "sets the Content-Disposition header when :filename provided" do send_file_app :filename => 'foo.txt' get '/file.txt'
test send_file with inline disposition
sinatra_sinatra
train
rb
2fec0dc731cbf89d2ff116ca5e08305f055de890
diff --git a/cli/export.php b/cli/export.php index <HASH>..<HASH> 100644 --- a/cli/export.php +++ b/cli/export.php @@ -174,10 +174,13 @@ function main($filename, $dir, $params, $options) // bootstrap $bootstrap = new Bootstrap(); if ($options[CMD_OPT_LIST_EXPORTER]) { + $formatters = $bootstrap->getFormatters(); + // find the longest formatter name + $len = max(array_map('strlen', array_keys($formatters))) + 1; echo "Supported exporter:\n"; - foreach ($bootstrap->getFormatters() as $name => $class) { + foreach ($formatters as $name => $class) { $formatter = $bootstrap->getFormatter($name); - echo sprintf("- %-25s %s\n", $name, $formatter->getTitle()); + echo sprintf("- %-".$len."s %s\n", $name, $formatter->getTitle()); } die(0); }
Make --list-exporter command of CLI to expand to the longest formatter name.
mysql-workbench-schema-exporter_mysql-workbench-schema-exporter
train
php
0552c0d0c8d07a4f4f04487cb0cee572532d6d3e
diff --git a/lib/assertions.js b/lib/assertions.js index <HASH>..<HASH> 100644 --- a/lib/assertions.js +++ b/lib/assertions.js @@ -2515,15 +2515,7 @@ module.exports = expect => { (expect, subject, value) => expect(subject, 'to call the callback with error').tap(err => { expect.errorMode = 'nested'; - if ( - err && - err._isUnexpected && - (typeof value === 'string' || isRegExp(value)) - ) { - return expect(err, 'to have message', value); - } else { - return expect(err, 'to satisfy', value); - } + expect(err, 'to satisfy', value); }) ); };
Simplify to call the callback with error
unexpectedjs_unexpected
train
js
5d076913347ec3b29db522c5f37f02b084d535d5
diff --git a/spec/Normalt/NormalizerSetSpec.php b/spec/Normalt/NormalizerSetSpec.php index <HASH>..<HASH> 100644 --- a/spec/Normalt/NormalizerSetSpec.php +++ b/spec/Normalt/NormalizerSetSpec.php @@ -19,9 +19,13 @@ class NormalizerSetSpec extends ObjectBehavior $this->beConstructedWith(array($unsupported, $supported)); } - function it_is_initializable() + /** + * @param stdClass $std + */ + function it_throws_exception_when_no_normalizer_is_found($std) { - $this->shouldHaveType('Normalt\NormalizerSet'); + $this->shouldThrow('UnexpectedValueException')->duringNormalize($std); + $this->shouldThrow('UnexpectedValueException')->duringDenormalize(array(), 'stdClass'); } function it_implements_normalizer_and_denormalizer() diff --git a/src/NormalizerSet.php b/src/NormalizerSet.php index <HASH>..<HASH> 100644 --- a/src/NormalizerSet.php +++ b/src/NormalizerSet.php @@ -4,6 +4,7 @@ namespace Normalt; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; +use UnexpectedValueException; /** * Functionality extracted from Symfony\Component\Serializer\Serializer in order to
Spec exception is thrown when no normalizer or denormalizer can be found
bernardphp_normalt
train
php,php
94c01e2d54293e2d3ad977c7ee20c6846264fa73
diff --git a/app/react-native/src/bin/storybook-start.js b/app/react-native/src/bin/storybook-start.js index <HASH>..<HASH> 100644 --- a/app/react-native/src/bin/storybook-start.js +++ b/app/react-native/src/bin/storybook-start.js @@ -78,7 +78,7 @@ if (!program.skipPackager) { let cliCommand = 'node node_modules/react-native/local-cli/cli.js start'; if (program.haul) { const platform = program.platform || 'all'; - cliCommand = `node node_modules/.bin/haul start --config ${ + cliCommand = `node node_modules/haul/bin/cli.js start --config ${ program.haul } --platform ${platform}`; }
Merge pull request #<I> from FredyC/haul-xplatform Use haul/bin/cli.js for cross-platform support
storybooks_storybook
train
js
5b60a84019c9f90b328ce825b1a62df1c8df1ea8
diff --git a/iexfinance/iexretriever.py b/iexfinance/iexretriever.py index <HASH>..<HASH> 100644 --- a/iexfinance/iexretriever.py +++ b/iexfinance/iexretriever.py @@ -4,7 +4,6 @@ try: import simplejson as json except ImportError: import json -import pandas as pd import requests from functools import wraps
Removed pandas dependency for travis
addisonlynch_iexfinance
train
py
b4613b6b20c6fae1b73095363078201e666bd5bc
diff --git a/djangosaml2/urls.py b/djangosaml2/urls.py index <HASH>..<HASH> 100644 --- a/djangosaml2/urls.py +++ b/djangosaml2/urls.py @@ -13,7 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls.defaults import patterns, handler500, url +try: + from django.conf.urls import patterns, handler500, url +# Fallback for Django versions < 1.4 +except ImportError: + from django.conf.urls.defaults import patterns, handler500, url urlpatterns = patterns( 'djangosaml2.views',
Fix imports for Django <I> and above
knaperek_djangosaml2
train
py
47ac376a5cd72340151f4630fb6dbbcd77cac72c
diff --git a/unleash/main.py b/unleash/main.py index <HASH>..<HASH> 100644 --- a/unleash/main.py +++ b/unleash/main.py @@ -133,8 +133,12 @@ def main(): from logbook.more import ColorizedStderrHandler from logbook.handlers import NullHandler - default_footer = ('\n\nCommit using `unleash 0.1dev <' - 'http://pypi.python.org/pypi/unleash>`_.') + from . import __version__ + + default_footer = ('\n\nCommit using `unleash %s <' + 'http://pypi.python.org/pypi/unleash>`_.' + % __version__ + ) parser = argparse.ArgumentParser() sub = parser.add_subparsers(dest='action')
Added proper version info to footer.
mbr_unleash
train
py
f2e933bb09a4e1da78a8d8c3a566569d2f9b221b
diff --git a/lib/portfolio/exporter.php b/lib/portfolio/exporter.php index <HASH>..<HASH> 100644 --- a/lib/portfolio/exporter.php +++ b/lib/portfolio/exporter.php @@ -170,6 +170,16 @@ class portfolio_exporter { } /** + * sets this export to force queued + * sometimes plugins need to set this randomly + * if an external system changes its mind + * about what's supported + */ + public function set_forcequeue() { + $this->forcequeue = true; + } + + /** * process the given stage calling whatever functions are necessary * * @param int $stage (see PORTFOLIO_STAGE_* constants) diff --git a/portfolio/type/mahara/lib.php b/portfolio/type/mahara/lib.php index <HASH>..<HASH> 100644 --- a/portfolio/type/mahara/lib.php +++ b/portfolio/type/mahara/lib.php @@ -189,7 +189,7 @@ class portfolio_plugin_mahara extends portfolio_plugin_pull_base { throw new portfolio_export_exception($this->get('exporter'), 'failedtoping', 'portfolio_mahara'); } if ($response->type =='queued') { - $this->exporter->set('forcequeue', true); + $this->exporter->set_forcequeue(); } }
MDL-<I> - fixing bad regression in mahara portfolio plugin
moodle_moodle
train
php,php
64ae6072df53fd16c584af5cf1590ed62970f70d
diff --git a/git_pull_request/__init__.py b/git_pull_request/__init__.py index <HASH>..<HASH> 100644 --- a/git_pull_request/__init__.py +++ b/git_pull_request/__init__.py @@ -93,16 +93,6 @@ def get_github_user_repo_from_url(url): return user, repo[:-4] -try: - user, password = get_login_password() -except KeyError: - raise RuntimeError( - "Unable to find your GitHub crediential.\n" - "Make sure you have a line like this in your ~/.netrc file:\n" - "machine github.com login <login> password <pwd>" - ) - - def main(): branch = git_get_branch_name() if not branch: @@ -136,6 +126,16 @@ def main(): LOG.debug("GitHub user and repository to fork: %s/%s", user_to_fork, reponame_to_fork) + try: + user, password = get_login_password() + except KeyError: + LOG.critical( + "Unable to find your GitHub crediential.\n" + "Make sure you have a line like this in your ~/.netrc file:\n" + "machine github.com login <login> password <pwd>" + ) + return 35 + g = github.Github(user, password) g_user = g.get_user() repo_to_fork = g.get_user(user_to_fork).get_repo(reponame_to_fork)
Move user/pass parsing in the right place
Mergifyio_git-pull-request
train
py
b81991daef66b061edac2c0d94581603db44e0e8
diff --git a/server.js b/server.js index <HASH>..<HASH> 100644 --- a/server.js +++ b/server.js @@ -130,7 +130,12 @@ app.use(function (req, res, next) { detectPort(PORT).then(function (_port) { if (PORT !== _port) { console.log('\nPort %d already occupied. Using port %d instead.', PORT, _port) - config.set('port', _port) + // Persist the new port to the in-memory store. This is kinda hacky + // Assign value to cliValue since it overrides all other values + var ConfigItem = require('./models/ConfigItem.js') + portConfigItem = ConfigItem.findOneByKey('port') + portConfigItem.cliValue = _port + portConfigItem.computeEffectiveValue() } http.createServer(app).listen(_port, IP, function () { console.log('\nWelcome to ' + app.locals.title + '!. Visit http://' + (IP === '0.0.0.0' ? 'localhost' : IP) + ':' + _port + BASE_URL + ' to get started')
persist alternate port config.set helper is no longer a thing
rickbergfalk_sqlpad
train
js
9103095af4536ecda439fdd0f4d19737e8699bf6
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -108,7 +108,7 @@ gulp.task('styles', function () { pipe(scss({ sourcemap: true })). - pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4')). + pipe(autoprefixer('last 2 versions', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4')). pipe(minifycss()). pipe(gulp.dest(PATH.dist)); });
RG-<I> commit in honnor of Leonya (versions instead of version in the gulp-autoprefixer) Former-commit-id: caed<I>f4e<I>b0c<I>f<I>dc<I>a7a
JetBrains_ring-ui
train
js
2c9352b30ad5342e7abb23d5f08bdbcfa4959e5a
diff --git a/ns1/rest/transport/basic.py b/ns1/rest/transport/basic.py index <HASH>..<HASH> 100644 --- a/ns1/rest/transport/basic.py +++ b/ns1/rest/transport/basic.py @@ -62,11 +62,11 @@ class BasicTransport(TransportBase): resp = opener.open(request, timeout=self._timeout) except HTTPError as e: resp = e - body = resp.read() except Exception as e: body = '"Service Unavailable"' resp = HTTPError(url, 503, body, headers, None) finally: + body = resp.read() if resp.code != 200: handleProblem(resp.code, resp, body)
Fix variable referenced before assignment The variable "body" is referenced before request if the their was no error in the url request. Regression from this commit <URL>
ns1_ns1-python
train
py
03778bd1d2c6ecea3b040fedad081f87e4f74317
diff --git a/docs/registry.go b/docs/registry.go index <HASH>..<HASH> 100644 --- a/docs/registry.go +++ b/docs/registry.go @@ -213,6 +213,9 @@ func (e ErrNoSupport) Error() string { func ContinueOnError(err error) bool { switch v := err.(type) { case errcode.Errors: + if len(v) == 0 { + return true + } return ContinueOnError(v[0]) case ErrNoSupport: return ContinueOnError(v.Err)
Add missing bounds in ContinueOnError ContinueOnError assumes that something of type errcode.Errors contains at least one error. This is generally true, but might not be true if the remote registry returns an empty error body or invalid JSON. Add the bounds check, and in the case where it fails, allow fallbacks to v1. Fixes #<I>
docker_distribution
train
go
44fbef220cdb353b07f5ba0e1a60f1dcaa2f1bb1
diff --git a/lib/geminabox/incoming_gem.rb b/lib/geminabox/incoming_gem.rb index <HASH>..<HASH> 100644 --- a/lib/geminabox/incoming_gem.rb +++ b/lib/geminabox/incoming_gem.rb @@ -33,17 +33,7 @@ module Geminabox end def spec - @spec ||= extract_spec - end - - def extract_spec - if Gem::Package.respond_to? :open - Gem::Package.open(gem_data, "r", nil) do |pkg| - return pkg.metadata - end - else - Gem::Package.new(@tempfile.path).spec - end + @spec ||= Gem::Package.new(@tempfile.path).spec end def name
Remove IncomingGem code for RubyGems 1.x (#<I>) Gem::Package.open was removed in RubyGems <I> - <URL>
geminabox_geminabox
train
rb
3ffd105237464bca63d02019bb5e4a26c8144a56
diff --git a/src/sdk/pynni/nni/nas/tensorflow/mutator.py b/src/sdk/pynni/nni/nas/tensorflow/mutator.py index <HASH>..<HASH> 100644 --- a/src/sdk/pynni/nni/nas/tensorflow/mutator.py +++ b/src/sdk/pynni/nni/nas/tensorflow/mutator.py @@ -66,7 +66,12 @@ class Mutator(BaseMutator): if reduction_type == 'mean': return sum(tensor_list) / len(tensor_list) if reduction_type == 'concat': - return tf.concat(tensor_list, axis=0) + image_data_format = tf.keras.backend.image_data_format() + if image_data_format == "channels_first": + axis = 0 + else: + axis = -1 + return tf.concat(tensor_list, axis=axis) raise ValueError('Unrecognized reduction policy: "{}'.format(reduction_type)) def _get_decision(self, mutable):
Udpated concat axis to match image_data_format in keras (#<I>)
Microsoft_nni
train
py
1560fd2fc5b52ce4050416d11e9ee45a5ecccf82
diff --git a/Classes/Service/CacheService.php b/Classes/Service/CacheService.php index <HASH>..<HASH> 100644 --- a/Classes/Service/CacheService.php +++ b/Classes/Service/CacheService.php @@ -187,14 +187,10 @@ class CacheService implements SingletonInterface } /** - * @deprecated can be removed when TYPO3 7.6 support is removed + * @deprecated can be removed when TYPO3 8 support is removed */ private function ensureDatabaseIsInitialized() { - if (class_exists(ConnectionPool::class)) { - // With doctrine, we don't need to initialize $GLOBALS['TYPO3_DB'] - return; - } if (!empty($GLOBALS['TYPO3_DB'])) { // Already initialized return;
[BUGFIX] Init DB also on TYPO3 8 (#<I>) Although TYPO3 8 comes with doctrine, there might be some extensions which require $GLOBALS['TYPO3_DB'], thus we need to initialize this global as well for TYPO3 8
TYPO3-Console_TYPO3-Console
train
php
4c18f26f6665228ea5722a6d401fdc02fb47a8d2
diff --git a/sources/index.js b/sources/index.js index <HASH>..<HASH> 100644 --- a/sources/index.js +++ b/sources/index.js @@ -0,0 +1,8 @@ +module.exports = chaiStyle + +function chaiStyle() { +// function chaiStyle(chai, utils) { + // const {Assertion} = chai + + // your helpers here +} diff --git a/sources/index.spec.js b/sources/index.spec.js index <HASH>..<HASH> 100644 --- a/sources/index.spec.js +++ b/sources/index.spec.js @@ -1,9 +1,11 @@ const {describe, it} = require('mocha') const {expect} = require('chai') - // .use(require('./index.js')) + .use(require('./index.js')) describe('chai-style', () => { - it('fake test', () => { - expect(true).to.be.true + it('should exports a named function', () => { + const module = require('./index.js') + expect(module).to.be.a('function') + expect(module.name).to.be.equal('chaiStyle') }) })
add spec: should exports a named function
darlanmendonca_chai-style
train
js,js
ced4fb6eed22858999fbe88d4ccbc6ed1b80b8c0
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ setup( license="PSF or ZPL", long_description = open('README.txt').read(), keywords = "CPAN PyPI distutils eggs package management", - url = "http://pypi.python.org/pypi/setuptools", + url = "http://pypi.python.org/pypi/distribute", test_suite = 'setuptools.tests', packages = find_packages(), package_data = {'setuptools':['*.exe']}, @@ -81,7 +81,7 @@ setup( classifiers = [f.strip() for f in """ - Development Status :: 3 - Alpha + Development Status :: 5 - Production/Stable Intended Audience :: Developers License :: OSI Approved :: Python Software Foundation License License :: OSI Approved :: Zope Public License @@ -92,32 +92,4 @@ setup( Topic :: System :: Systems Administration Topic :: Utilities""".splitlines() if f.strip()], scripts = scripts, - - # uncomment for testing - # setup_requires = ['setuptools>=0.6a0'], ) - - - - - - - - - - - - - - - - - - - - - - - - -
Update setup.py - note new download location, update dev status to stable and get rid of blank lines at the end of the file. --HG-- branch : distribute extra : rebase_source : b8d7de6a<I>ffd9b4aefc<I>faeadee0d<I>
pypa_setuptools
train
py
9c82b5e183c114d55888c83aa31e46b593b4e871
diff --git a/ast_test.go b/ast_test.go index <HASH>..<HASH> 100644 --- a/ast_test.go +++ b/ast_test.go @@ -1970,9 +1970,6 @@ func setPosRecurse(t *testing.T, v interface{}, to Pos, diff bool) Node { setPos(&x.Rparen) recurse(x.Stmts) return x - case nil: - default: - panic(reflect.TypeOf(v)) } return nil }
ast_test: remove now unnecessary panic
mvdan_sh
train
go
047187fd345bb9401e6644f6437c43212fc06db5
diff --git a/main/java/uk/co/real_logic/sbe/generation/java/JavaGenerator.java b/main/java/uk/co/real_logic/sbe/generation/java/JavaGenerator.java index <HASH>..<HASH> 100644 --- a/main/java/uk/co/real_logic/sbe/generation/java/JavaGenerator.java +++ b/main/java/uk/co/real_logic/sbe/generation/java/JavaGenerator.java @@ -852,7 +852,7 @@ public class JavaGenerator implements CodeGenerator sb.append(String.format( "\n" + - indent + " private static final byte[] %sValue = {%s};\n", + indent + " private final byte[] %sValue = {%s};\n", propertyName, values ));
Changed support for constants in repeating groups to use instance initialisation rather than static initialisation to address issue #3.
real-logic_simple-binary-encoding
train
java
b2a80f8ada343136d668f446f0ba99f64fb5b787
diff --git a/test/application/inspectors/ensureNotExpired.test.js b/test/application/inspectors/ensureNotExpired.test.js index <HASH>..<HASH> 100644 --- a/test/application/inspectors/ensureNotExpired.test.js +++ b/test/application/inspectors/ensureNotExpired.test.js @@ -1,7 +1,6 @@ -import 'babel-polyfill'; import { ensureNotExpired } from '../../../src/inspectors'; -describe('Checks test suite', function () { +describe('Inspectors test suite', function () { describe('ensureNotExpired method', function () { const errorMessage = 'This certificate has expired.';
test(inspectors): ensureNotExpired test language
blockchain-certificates_cert-verifier-js
train
js
0bb402f91d3a37c59480ddfbb080356d4c0f9067
diff --git a/assets/test/integration/e2e.js b/assets/test/integration/e2e.js index <HASH>..<HASH> 100644 --- a/assets/test/integration/e2e.js +++ b/assets/test/integration/e2e.js @@ -67,8 +67,8 @@ describe('', function() { h.waitForPresence('.deployment-trigger', 'from image change'); // Check the pod count inside the donut chart for each rc. - h.waitForPresence('#service-database .pod-count', '1'); - h.waitForPresence('#service-frontend .pod-count', '2'); + h.waitForPresence('#service-database .donut-title-big-pf', '1'); + h.waitForPresence('#service-frontend .donut-title-big-pf', '2'); // TODO: validate correlated images, builds, source });
Fix UI e2e test failure `pod-count` class is no longer used in donut title.
openshift_origin
train
js
78a44ba1bf127b6f44ac122a1fe65491e73e0e8c
diff --git a/appended.go b/appended.go index <HASH>..<HASH> 100644 --- a/appended.go +++ b/appended.go @@ -9,6 +9,7 @@ import ( "time" "bitbucket.org/kardianos/osext" + "github.com/daaku/go.zipexe" ) // appendedBox defines an appended box
rice: restore missing imports #<I> This is also missing here
GeertJohan_go.rice
train
go
30adca1298a682a93ddac344b974f0b2be58057f
diff --git a/src/main/java/uk/co/real_logic/agrona/concurrent/AtomicCounter.java b/src/main/java/uk/co/real_logic/agrona/concurrent/AtomicCounter.java index <HASH>..<HASH> 100644 --- a/src/main/java/uk/co/real_logic/agrona/concurrent/AtomicCounter.java +++ b/src/main/java/uk/co/real_logic/agrona/concurrent/AtomicCounter.java @@ -20,10 +20,10 @@ package uk.co.real_logic.agrona.concurrent; */ public class AtomicCounter implements AutoCloseable { - private final AtomicBuffer buffer; private final int counterId; - private final CountersManager countersManager; private final int offset; + private final AtomicBuffer buffer; + private final CountersManager countersManager; AtomicCounter(final AtomicBuffer buffer, final int counterId, final CountersManager countersManager) {
[Java] Reorder fields.
real-logic_agrona
train
java
5112c33f3a6ef694c1e5784b68981f08b3f0327c
diff --git a/mux_test.go b/mux_test.go index <HASH>..<HASH> 100644 --- a/mux_test.go +++ b/mux_test.go @@ -7,11 +7,24 @@ package mux import ( "fmt" "net/http" + "strings" "testing" "github.com/gorilla/context" ) +func (r *Route) GoString() string { + matchers := make([]string, len(r.matchers)) + for i, m := range r.matchers { + matchers[i] = fmt.Sprintf("%#v", m) + } + return fmt.Sprintf("&Route{matchers:[]matcher{%s}}", strings.Join(matchers, ", ")) +} + +func (r *routeRegexp) GoString() string { + return fmt.Sprintf("&routeRegexp{template: %q, matchHost: %t, matchQuery: %t, strictSlash: %t, regexp: regexp.MustCompile(%q), reverse: %q, varsN: %v, varsR: %v", r.template, r.matchHost, r.matchQuery, r.strictSlash, r.regexp.String(), r.reverse, r.varsN, r.varsR) +} + type routeTest struct { title string // title of the test route *Route // the route being tested
slightly improve printing of regexps in failed tests.
gorilla_mux
train
go
dc2a1c0c90054428cc18f507c0c10e1c4e549364
diff --git a/src/Command/DaemonCommand.php b/src/Command/DaemonCommand.php index <HASH>..<HASH> 100644 --- a/src/Command/DaemonCommand.php +++ b/src/Command/DaemonCommand.php @@ -28,7 +28,7 @@ class DaemonCommand extends BackgroundCommand { $this->addArgument('action', InputArgument::REQUIRED, 'Start, stop or status.') ->addOption('pid-file', 'p', InputOption::VALUE_REQUIRED, 'PID file location.', false) - ->addOption('no-daemonize', 'd', InputOption::VALUE_NONE, 'Do not daemonize the process.'); + ->addOption('daemonize', 'd', InputOption::VALUE_NONE, 'Make the process run in the background and detach.'); } /** @@ -83,7 +83,7 @@ class DaemonCommand extends BackgroundCommand throw new \InvalidArgumentException(sprintf("Can not write to PID file '%s'", $pidFile)); } - if (!$input->getOption('no-daemonize')) { + if ($input->getOption('daemonize')) { $this->onBeforeDaemonize($input, $output); $isChild = $this->daemonize(); if (!$isChild) {
Reverted daemonize flag to positive meaning Daemonize flag must be specified to make the process background and detach.
phlib_console-process
train
php
6d1e390c5d2dfdcfebf2780ca8bbc8f5ec978b89
diff --git a/src/Runtime.php b/src/Runtime.php index <HASH>..<HASH> 100644 --- a/src/Runtime.php +++ b/src/Runtime.php @@ -623,9 +623,14 @@ class Runtime { $options = array( 'name' => $ch, 'hash' => $vars[1], - '_this' => $isBlock ? $op : $inverted, ); + if ($isBlock) { + $options['_this'] = &$op; + } else { + $options['_this'] = &$inverted; + } + // $invert the logic if ($inverted) { $tmp = $else; @@ -634,7 +639,7 @@ class Runtime { } if ($isBlock) { - $options['fn'] = function ($context = '_NO_INPUT_HERE_', $data = null) use ($cx, $op, $cb) { + $options['fn'] = function ($context = '_NO_INPUT_HERE_', $data = null) use ($cx, &$op, $cb, $options) { if ($cx['flags']['echo']) { ob_start(); }
context should be passed by reference, then the helper behavior will more like handlebars.js
zordius_lightncandy
train
php
5c73ed11097244deed1ed71456c08c08fe9a8344
diff --git a/lib/auth.js b/lib/auth.js index <HASH>..<HASH> 100644 --- a/lib/auth.js +++ b/lib/auth.js @@ -5,8 +5,8 @@ 'use strict'; -var _ = require('lodash'), fs = require('fs'); -var DEFAULT_USERS_LOC = '../local-site.json', memberTemplate = _.template(fs.readFileSync('./web/site/member.js')); +var _ = require('lodash'), fs = require('fs'), path = require('path'); +var DEFAULT_USERS_LOC = '../local-site.json', memberTemplate = _.template(fs.readFileSync(path.join(process.env.PWD, './web/site/member.js'))); exports.userByUsername = userByUsername; exports.clientIDByUsername = clientIDByUsername;
make auth js relative to project base
vid_SenseBase
train
js
b2b5e39b9df9adfb346ff740c212c68f0484b166
diff --git a/src/player.js b/src/player.js index <HASH>..<HASH> 100644 --- a/src/player.js +++ b/src/player.js @@ -131,7 +131,10 @@ class Player { setSrc(src) { this._engine.pause(); - this._engine.setSrc(src); + //TODO: Change this ugly fix on something smarter + setTimeout(() => { + this._engine.setSrc(src); + }, 0); } on(name, callback) {
Fix race condition for pausing video on source change
wix_playable
train
js
7ed6fa7b2e943d2c11c675594a756477ec173032
diff --git a/pkg/kubelet/cm/cpumanager/cpu_assignment_test.go b/pkg/kubelet/cm/cpumanager/cpu_assignment_test.go index <HASH>..<HASH> 100644 --- a/pkg/kubelet/cm/cpumanager/cpu_assignment_test.go +++ b/pkg/kubelet/cm/cpumanager/cpu_assignment_test.go @@ -656,7 +656,7 @@ func TestTakeByTopologyNUMAPacked(t *testing.T) { for _, tc := range testCases { t.Run(tc.description, func(t *testing.T) { result, err := takeByTopologyNUMAPacked(tc.topo, tc.availableCPUs, tc.numCPUs) - if tc.expErr != "" && err.Error() != tc.expErr { + if tc.expErr != "" && err != nil && err.Error() != tc.expErr { t.Errorf("expected error to be [%v] but it was [%v]", tc.expErr, err) } if !result.Equals(tc.expResult) {
Method call 'err.Error()' might lead to a nil pointer dereference for pkg/kubelet/cm/cpumanager/cpu_assignment_test.go
kubernetes_kubernetes
train
go
15d295c89b32b3d6ee93be18fef46198c5626747
diff --git a/lib/keep_track/creation.rb b/lib/keep_track/creation.rb index <HASH>..<HASH> 100644 --- a/lib/keep_track/creation.rb +++ b/lib/keep_track/creation.rb @@ -4,17 +4,19 @@ module KeepTrack included do after_create do - user = nil - if not self.activity_user.nil? + if self.activity_user user = self.activity_user else - if self.class.activity_user_global.is_a?(Symbol) or self.class.activity_user_global.is_a?(String) - user = self[self.class.activity_user_global] - end + case self.activity_user_global + when Symbol, String + user = self[self.class.activity_user_global] + when Proc + user = self.class.activity_user_global.call + end end + self.activities.create(:key => self.class.name.downcase+".create", :user_id => user, :parameters => self.activity_params) end - end - + end end end
Clean up the code and allow tracked :user to be Proc or a Symbol/String, setting activity_user on a tracked object takes priority over :user attribute in model definition
chaps-io_public_activity
train
rb
bab0d56bd9be6ba1afe0eef352c8732dd7fe4f73
diff --git a/lib/plugins/aws/package/compile/functions/index.js b/lib/plugins/aws/package/compile/functions/index.js index <HASH>..<HASH> 100644 --- a/lib/plugins/aws/package/compile/functions/index.js +++ b/lib/plugins/aws/package/compile/functions/index.js @@ -553,7 +553,9 @@ class AwsCompileFunctions { let maximumEventAgeOnDestinations; let maximumRetryAttemptsOnDestinations; - if (!destinations && !maximumEventAgeOnFunction && !maximumRetryAttemptsOnFunction) return; + if (!destinations && !maximumEventAgeOnFunction && maximumRetryAttemptsOnFunction == null) { + return; + } const destinationConfig = {};
fix(AWS Lambda): Ensure to respect `maximumRetryAttempts` set to `0`
serverless_serverless
train
js
4ac132dcebcfab9506c3394dc754ada6c31d015d
diff --git a/src/main/java/org/cactoos/iterable/Matched.java b/src/main/java/org/cactoos/iterable/Matched.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/cactoos/iterable/Matched.java +++ b/src/main/java/org/cactoos/iterable/Matched.java @@ -55,7 +55,8 @@ public final class Matched<X> implements Iterable<X> { * @param snd The second part of duplex iterator. */ public Matched( - final Iterable<? extends X> fst, final Iterable<? extends X> snd + final Iterable<? extends X> fst, + final Iterable<? extends X> snd ) { this(Object::equals, fst, snd); } @@ -68,7 +69,8 @@ public final class Matched<X> implements Iterable<X> { */ public Matched( final BiFunc<X, X, Boolean> fnc, - final Iterable<? extends X> fst, final Iterable<? extends X> snd + final Iterable<? extends X> fst, + final Iterable<? extends X> snd ) { this( () -> {
(#<I>) Fix indentation
yegor256_cactoos
train
java
0bd829259869523c43afd2b7258ee9dd32758dce
diff --git a/p2p/protocol/internal/circuitv1-deprecated/conn.go b/p2p/protocol/internal/circuitv1-deprecated/conn.go index <HASH>..<HASH> 100644 --- a/p2p/protocol/internal/circuitv1-deprecated/conn.go +++ b/p2p/protocol/internal/circuitv1-deprecated/conn.go @@ -43,7 +43,7 @@ func (c *Conn) RemoteAddr() net.Addr { } func (c *Conn) RemoteMultiaddr() ma.Multiaddr { - a, err := ma.NewMultiaddr(fmt.Sprintf("/ipfs/%s/p2p-circuit/ipfs/%s", c.Conn().RemotePeer().Pretty(), c.remote.ID.Pretty())) + a, err := ma.NewMultiaddr(fmt.Sprintf("/ipfs/%s/p2p-circuit", c.Conn().RemotePeer().Pretty())) if err != nil { panic(err) }
connection RemoteMultiaddr returns partial relay address for consistency
libp2p_go-libp2p
train
go
99cd2d2868f143ce27b0456abc0bfc95921ac96d
diff --git a/backup/backup_scheduled.php b/backup/backup_scheduled.php index <HASH>..<HASH> 100644 --- a/backup/backup_scheduled.php +++ b/backup/backup_scheduled.php @@ -418,7 +418,7 @@ function schedule_backup_course_configure($course,$starttime = 0) { $preferences->mods[$mod->modname]->instances[$mod->instance]->backup = $preferences->mods[$mod->modname]->backup; $preferences->mods[$mod->modname]->instances[$mod->instance]->userinfo = $preferences->mods[$mod->modname]->userinfo; // there isn't really a nice way to do this... - $preferences->mods[$mod->modname]->instances[$mod->instance]->name = get_field($mod->modname,'name','id',$mod->instance); + $preferences->mods[$mod->modname]->instances[$mod->instance]->name = $DB->get_field($mod->modname,'name', array('id'=>$mod->instance)); } } }
MDL-<I> some forgotten conversions
moodle_moodle
train
php
e0def320685ec55f6da079f2b1596c86daff2b5e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -113,7 +113,6 @@ INSTALL_REQUIRES = [ 'protobuf==2.6.1', 'pyaml==15.3.1', 'pyOpenSSL==0.15.1', - 'python-gflags==2.0', 'PyYAML==3.11', 'singledispatch==3.4.0.3', 'tornado==4.3', @@ -173,6 +172,7 @@ setup( 'usb_plugs': [ 'libusb1==1.3.0', 'M2Crypto==0.22.3', + 'python-gflags==2.0', ], }, setup_requires=[
Move gflags to a usb_plugs-only dependency
google_openhtf
train
py
5f3da9c5e1209075c711a7bcb26efa68bd832e00
diff --git a/bakery/__init__.py b/bakery/__init__.py index <HASH>..<HASH> 100644 --- a/bakery/__init__.py +++ b/bakery/__init__.py @@ -1,8 +1,34 @@ DEFAULT_GZIP_CONTENT_TYPES = ( - 'text/css', - 'text/html', - 'application/javascript', - 'application/x-javascript', - 'application/json', - 'application/xml' + "application/atom+xml", + "application/javascript", + "application/json", + "application/ld+json", + "application/manifest+json", + "application/rdf+xml", + "application/rss+xml", + "application/schema+json", + "application/vnd.geo+json", + "application/vnd.ms-fontobject", + "application/x-font-ttf", + "application/x-javascript", + "application/x-web-app-manifest+json", + "application/xhtml+xml", + "application/xml", + "font/eot", + "font/opentype", + "image/bmp", + "image/svg+xml", + "image/vnd.microsoft.icon", + "image/x-icon", + "text/cache-manifest", + "text/css", + "text/html", + "text/javascript", + "text/plain", + "text/vcard", + "text/vnd.rim.location.xloc", + "text/vtt", + "text/x-component", + "text/x-cross-domain-policy", + "text/xml" )
Expanded GZIP_CONTENT_TYPES list to cover everything in the HTML5 boilerplate recommended list. This fixes #<I> by adding SVGs and also throws in a ton of other new stuff as well.
datadesk_django-bakery
train
py
6fcc94f30e23200a03164a898dd0bd673b98fac5
diff --git a/connection.js b/connection.js index <HASH>..<HASH> 100644 --- a/connection.js +++ b/connection.js @@ -971,11 +971,11 @@ Connection.prototype.rcpt_incr = function(rcpt, action, msg, retval) { var addr = rcpt.format(); var recipient = { address: addr.substr(1, addr.length -2), + action: action }; if (msg && action !== 'accept') { recipient.msg = msg; recipient.code = constants.translate(retval); - recipient.action = action; } this.transaction.results.push({name: 'rcpt_to'}, {
add action var to rcpt_to results
haraka_Haraka
train
js
d62d6bd1c055c7b17d499b4b56f5e54a5201e90a
diff --git a/cachier/pickle_core.py b/cachier/pickle_core.py index <HASH>..<HASH> 100644 --- a/cachier/pickle_core.py +++ b/cachier/pickle_core.py @@ -19,6 +19,11 @@ from watchdog.events import PatternMatchingEventHandler from .base_core import _BaseCore +try: + FileNotFoundError +except NameError: # we're on python 2 + FileNotFoundError = IOError + CACHIER_DIR = '~/.cachier/' EXPANDED_CACHIER_DIR = os.path.expanduser(CACHIER_DIR) diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ setup( cachier=cachier.scripts.cli:cli ''', install_requires=[ - 'watchdog' + 'watchdog', 'portalocker' ], extras_require={ 'test': TEST_REQUIRES
dependency fix and FileNotFoundError for python 2
shaypal5_cachier
train
py,py
c7bc6eab3e897906ef5e35ab122ad246aa4cbb9b
diff --git a/src/sankeyLayout/index.js b/src/sankeyLayout/index.js index <HASH>..<HASH> 100644 --- a/src/sankeyLayout/index.js +++ b/src/sankeyLayout/index.js @@ -19,6 +19,7 @@ export default function sankeyLayout () { var edgeValue = function (e) { return e.data.value } var whitespace = 0.5 var verticalLayout = positionVertically() + var alignLinkTypes = false function position (graph) { if (scale === null) position.scaleToFit(graph) @@ -32,7 +33,7 @@ export default function sankeyLayout () { positionHorizontally(nested, size[0]) // sort & position links - orderLinks(graph) + orderLinks(graph, { alignLinkTypes: alignLinkTypes }) layoutLinks(graph) return graph @@ -92,6 +93,12 @@ export default function sankeyLayout () { return position } + position.alignLinkTypes = function (x) { + if (!arguments.length) return alignLinkTypes + alignLinkTypes = !!x + return position + } + return position }
Add option to sankeyLayout for alignLinkTypes
ricklupton_d3-sankey-diagram
train
js
b83c123939e62a1fbdf41504078e40dec6cc6b16
diff --git a/src/ApiGatewayWebSocket.js b/src/ApiGatewayWebSocket.js index <HASH>..<HASH> 100644 --- a/src/ApiGatewayWebSocket.js +++ b/src/ApiGatewayWebSocket.js @@ -94,6 +94,11 @@ module.exports = class ApiGatewayWebSocket { ws.send(JSON.stringify({ message:'Internal server error', connectionId, requestId:'1234567890' })); } + // mimic AWS behaviour (close connection) when the $connect action handler throws + if (name === '$connect') { + ws.close(); + } + debugLog(`Error in handler of action ${action}`, err); };
chore: if an error occurs during the $connect action, close the connection
dherault_serverless-offline
train
js
57b90fe4150c5e355c4566b3e9f3569f2f1bfbb4
diff --git a/lib/ti/cli.rb b/lib/ti/cli.rb index <HASH>..<HASH> 100644 --- a/lib/ti/cli.rb +++ b/lib/ti/cli.rb @@ -7,7 +7,14 @@ module Ti :not_found => 4, :incorrect_usage => 64, } - + + def cli_error(message, exit_status=nil) + $stderr.puts message + exit_status = ERROR_TYPES[exit_status] if exit_status.is_a?(Symbol) + exit exit_status || 1 + end + + ### TODO: When these commands list grows big, we need to move them into a seperate commands.rb file map %w(--version -v) => 'info' desc "info", "information about Ti." def info @@ -15,7 +22,7 @@ module Ti end desc "new <name> <id> <platform>", "generates a new Titanium project." - long_desc "Generates a new Titanium project. See 'ti help project:new' for more information. + long_desc "Generates a new Titanium project. See 'ti help new' for more information. \n\nExamples: \n\nti new demo ==> Creates a new project with a default id (org.mycompany.demo) and sets the project platform to iphone. \n\nti new demo com.youwantit.dontyou ==> Creates a new project 'demo' with the id of 'com.youwantit.dontyou' to be used on the iphone.
Add a helper method to trap errors.
revans_Ti
train
rb
07868a58283a2de77f958fa6122bb62d90fc77b1
diff --git a/staging/src/k8s.io/apimachinery/pkg/runtime/converter.go b/staging/src/k8s.io/apimachinery/pkg/runtime/converter.go index <HASH>..<HASH> 100644 --- a/staging/src/k8s.io/apimachinery/pkg/runtime/converter.go +++ b/staging/src/k8s.io/apimachinery/pkg/runtime/converter.go @@ -746,7 +746,7 @@ func isZero(v reflect.Value) bool { func structToUnstructured(sv, dv reflect.Value) error { st, dt := sv.Type(), dv.Type() if dt.Kind() == reflect.Interface && dv.NumMethod() == 0 { - dv.Set(reflect.MakeMap(mapStringInterfaceType)) + dv.Set(reflect.MakeMapWithSize(mapStringInterfaceType, st.NumField())) dv = dv.Elem() dt = dv.Type() }
Save 2-3 commits from unstructured object creation.
kubernetes_kubernetes
train
go
87e4a75a433bbb5948faffc233a0ab172181a72b
diff --git a/src/main/java/com/mangopay/core/APIs/implementation/ClientApiImpl.java b/src/main/java/com/mangopay/core/APIs/implementation/ClientApiImpl.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/mangopay/core/APIs/implementation/ClientApiImpl.java +++ b/src/main/java/com/mangopay/core/APIs/implementation/ClientApiImpl.java @@ -30,9 +30,6 @@ public class ClientApiImpl extends ApiBase implements ClientApi { */ public ClientApiImpl(MangoPayApi root, GsonBuilder gsonBuilder) { super(root); - -// gsonBuilder.registerTypeAdapter(PayIn.class, new PayInSerializer()); -// gsonBuilder.registerTypeAdapter(PayIn.class, new PayInDeserializer()); } @Override
User-Client-Api-GSON: removed unnecessary adapters from ClientApiImpl
Mangopay_mangopay2-java-sdk
train
java
93d11352b0d8d4da3169a9b86983f31658735db7
diff --git a/tests/Doctrine/Tests/Common/Cache/MongoDBCacheTest.php b/tests/Doctrine/Tests/Common/Cache/MongoDBCacheTest.php index <HASH>..<HASH> 100644 --- a/tests/Doctrine/Tests/Common/Cache/MongoDBCacheTest.php +++ b/tests/Doctrine/Tests/Common/Cache/MongoDBCacheTest.php @@ -52,7 +52,7 @@ class MongoDBCacheTest extends CacheTest public function testMongoCursorExceptionsDoNotBubbleUp() { /* @var $collection \MongoCollection|\PHPUnit_Framework_MockObject_MockObject */ - $collection = $this->getMock('MongoCollection'); + $collection = $this->getMock('MongoCollection', array(), array(), '', false); $collection->expects(self::once())->method('update')->willThrowException(new \MongoCursorException());
`MongoCollection` expects constructor parameters - we don't have them
doctrine_cache
train
php
40b0f9ca1e79bf1cab978ccc01f37ae8c5b32b38
diff --git a/cmd/torrent/main.go b/cmd/torrent/main.go index <HASH>..<HASH> 100644 --- a/cmd/torrent/main.go +++ b/cmd/torrent/main.go @@ -359,7 +359,7 @@ func downloadErr(flags downloadFlags) error { if client.WaitAll() { log.Print("downloaded ALL the torrents") } else { - return errors.New("y u no complete torrents?!") + err = errors.New("y u no complete torrents?!") } if flags.Seed { if len(client.Torrents()) == 0 { @@ -378,7 +378,7 @@ func downloadErr(flags downloadFlags) error { humanize.Bytes(uint64(clStats.BytesRead.Int64())), 100*float64(clStats.BytesReadUsefulData.Int64())/float64(clStats.BytesRead.Int64()), humanize.Bytes(uint64(sentOverhead))) - return nil + return err } func outputStats(cl *torrent.Client, args downloadFlags) {
cmd/torrent: Include download stats on interrupt
anacrolix_torrent
train
go
e2a8156f34ce3a27b33331d1df0689c39829eb5f
diff --git a/src/paper.js b/src/paper.js index <HASH>..<HASH> 100644 --- a/src/paper.js +++ b/src/paper.js @@ -315,7 +315,7 @@ Snap.plugin(function (Snap, Element, Paper, glob, Fragment) { * Paper.ptrn [ method ] ** - * Equivalent in behaviour to @Paper.g, except it’s a mask. + * Equivalent in behaviour to @Paper.g, except it’s a pattern. - x (number) @optional X of the element - y (number) @optional Y of the element - width (number) @optional width of the element @@ -325,7 +325,7 @@ Snap.plugin(function (Snap, Element, Paper, glob, Fragment) { - vbw (number) @optional viewbox width - vbh (number) @optional viewbox height ** - = (object) the `mask` element + = (object) the `pattern` element ** \*/ proto.ptrn = function (x, y, width, height, vx, vy, vw, vh) {
Typo in dr.js comments
adobe-webplatform_Snap.svg
train
js
0f3cd21652decd15a6f15100211389f300bd2869
diff --git a/packages/react-ui-components/src/SelectBox/selectBox.js b/packages/react-ui-components/src/SelectBox/selectBox.js index <HASH>..<HASH> 100644 --- a/packages/react-ui-components/src/SelectBox/selectBox.js +++ b/packages/react-ui-components/src/SelectBox/selectBox.js @@ -259,6 +259,7 @@ export default class SelectBox extends PureComponent { if ( displaySearchBox && ( isNil(value) || + value === '' || this.state.isExpanded || plainInputMode )
BUGFIX: Render search also for empty string (#<I>) With the introduction of isNil() the check for empty strings fail. So, we need to check also for empty strings and render the select box with search header.
neos_neos-ui
train
js
5493d353801831c6392670fb856211882005006a
diff --git a/externs/window.js b/externs/window.js index <HASH>..<HASH> 100644 --- a/externs/window.js +++ b/externs/window.js @@ -173,19 +173,19 @@ function setImmediate(callback) {} /** * @param {Function|string} callback - * @param {number} delay + * @param {number=} opt_delay * @return {number} * @see https://developer.mozilla.org/en/DOM/window.setInterval - * @see https://msdn.microsoft.com/en-us/library/ms536749(v=VS.85).aspx + * @see https://html.spec.whatwg.org/multipage/webappapis.html#timers */ -function setInterval(callback, delay) {} +function setInterval(callback, opt_delay) {} /** * @param {Function|string} callback - * @param {number} delay + * @param {number=} opt_delay * @param {...*} var_args * @return {number} * @see https://developer.mozilla.org/en/DOM/window.setTimeout - * @see https://msdn.microsoft.com/en-us/library/ms536753(VS.85).aspx + * @see https://html.spec.whatwg.org/multipage/webappapis.html#timers */ -function setTimeout(callback, delay, var_args) {} +function setTimeout(callback, opt_delay, var_args) {}
Attempt #2 at this change, was previously rolled back. Updates the externs for window.setTimeout() and window.setInterval() in accordance with the HTML5 spec's modification to the spec which sets an explicit default value for the delay parameter (0), thus making them optional. See <URL>
google_closure-compiler
train
js
f9367abed0b67a24b95a449dd49714a95a3035db
diff --git a/polyfills/Array.from/detect.js b/polyfills/Array.from/detect.js index <HASH>..<HASH> 100644 --- a/polyfills/Array.from/detect.js +++ b/polyfills/Array.from/detect.js @@ -1 +1,9 @@ -Array.from +Array.from && (function () { + try { + Array.from({ length: -Infinity }); + + return true; + } catch (e) { + return false; + } +})()
Update Array.from - test out-of-range length handling
Financial-Times_polyfill-service
train
js
9a219d061c585e6355de844b34b8105c290b4ebf
diff --git a/src/cropper.js b/src/cropper.js index <HASH>..<HASH> 100644 --- a/src/cropper.js +++ b/src/cropper.js @@ -771,6 +771,7 @@ if (this.built) { this.initDragger(); this.renderDragger(); + this.setData(this.defaults.data); // Reset to initial state } } },
Improve "setAspectRatio" method.
fengyuanchen_cropper
train
js
0597e914ff5792b79fe0830184624c044c4dcbab
diff --git a/i18n/i18nTextCollector.php b/i18n/i18nTextCollector.php index <HASH>..<HASH> 100644 --- a/i18n/i18nTextCollector.php +++ b/i18n/i18nTextCollector.php @@ -162,6 +162,7 @@ class i18nTextCollector extends Object { //Debug::message("Processing Module '{$module}'", false); // Search for calls in code files if these exists + $fileList = array(); if(is_dir("$this->basePath/$module/code")) { $fileList = $this->getFilesRecursive("$this->basePath/$module/code"); } else if($module == FRAMEWORK_DIR || substr($module, 0, 7) == 'themes/') {
MINOR Don't fail text collection for modules without any matching PHP files (only _config.php)
silverstripe_silverstripe-framework
train
php
0d0de4309863c417345aaad55d0546bf1139070b
diff --git a/ui-v2/app/services/repository/service-instance.js b/ui-v2/app/services/repository/service-instance.js index <HASH>..<HASH> 100644 --- a/ui-v2/app/services/repository/service-instance.js +++ b/ui-v2/app/services/repository/service-instance.js @@ -7,7 +7,7 @@ export default RepositoryService.extend({ findByService: function(slug, dc, nspace, configuration = {}) { const query = { dc: dc, - nspace: nspace, + ns: nspace, id: slug, }; if (typeof configuration.cursor !== 'undefined') {
ui: Change query param name for service instance listing from nspace to ns (#<I>)
hashicorp_consul
train
js
77afa3480e9c1fb44ed32d57c6c1aa9e15fb98f4
diff --git a/lib/deep_cover/node.rb b/lib/deep_cover/node.rb index <HASH>..<HASH> 100644 --- a/lib/deep_cover/node.rb +++ b/lib/deep_cover/node.rb @@ -34,7 +34,7 @@ module DeepCover # Returns true iff it is executable and if was successfully executed def was_executed? - false + runs > 0 end # Returns the number of times it was executed (completely or not) diff --git a/lib/deep_cover/node_behavior/cover_with_next_instruction.rb b/lib/deep_cover/node_behavior/cover_with_next_instruction.rb index <HASH>..<HASH> 100644 --- a/lib/deep_cover/node_behavior/cover_with_next_instruction.rb +++ b/lib/deep_cover/node_behavior/cover_with_next_instruction.rb @@ -5,10 +5,6 @@ module DeepCover ";$_cov[#{context.nb}][#{nb*2}]+=1;nil" unless next_instruction end - def was_executed? - runs > 0 - end - def runs next_instruction ? next_instruction.runs : context.cover.fetch(nb*2) end
Make default slightly less dum; simplify
deep-cover_deep-cover
train
rb,rb
fe9e801d05af2ae9f3643e9d6530e536b664b304
diff --git a/benchexec/tools/depthk.py b/benchexec/tools/depthk.py index <HASH>..<HASH> 100644 --- a/benchexec/tools/depthk.py +++ b/benchexec/tools/depthk.py @@ -38,7 +38,8 @@ class Tool(benchexec.tools.template.BaseTool): "esbmc", "__init__.py", "modules", - "tokenizer" + "tokenizer", + "graphml" ] def executable(self):
Correct problem with missing directory (esbmc)
sosy-lab_benchexec
train
py
454ed970268b091bffd61891ad280120032e2249
diff --git a/src/DataGrid.php b/src/DataGrid.php index <HASH>..<HASH> 100644 --- a/src/DataGrid.php +++ b/src/DataGrid.php @@ -381,6 +381,10 @@ class DataGrid extends Nette\Application\UI\Control */ protected $show_selected_rows_count = true; + /** + * @var string + */ + private $custom_paginator_template; /** * @param Nette\ComponentModel\IContainer|NULL $parent @@ -2760,6 +2764,10 @@ class DataGrid extends Nette\Application\UI\Control $paginator->setPage($this->page); $paginator->setItemsPerPage($this->getPerPage()); + if ($this->custom_paginator_template) { + $component->setTemplateFile($this->custom_paginator_template); + } + return $component; } @@ -3559,5 +3567,15 @@ class DataGrid extends Nette\Application\UI\Control $this->getPresenter()->payload->_datagrid_url = $this->refresh_url; $this->redrawControl('non-existing-snippet'); } + + + /** + * @param string $template_file + * @return void + */ + public function setCustomPaginatortemplate($template_file) + { + $this->custom_paginator_template = $template_file; + } }
Allows set custom paginator template before datagrid component is attached to presenter component
contributte_datagrid
train
php
80ab41dff6ec63a591cb2f7450a6c8582f7b3fcb
diff --git a/app/lib/notifications/CheckServerClocksNotification.java b/app/lib/notifications/CheckServerClocksNotification.java index <HASH>..<HASH> 100644 --- a/app/lib/notifications/CheckServerClocksNotification.java +++ b/app/lib/notifications/CheckServerClocksNotification.java @@ -43,6 +43,6 @@ public class CheckServerClocksNotification implements NotificationType { @Override public boolean isCloseable() { - return false; + return true; } }
clock skew detection needs to be closable, it doesn't fix itself fixes Graylog2/graylog2-server#<I>
Graylog2_graylog2-server
train
java
435371efe461b95cdd7dc2453b07ac944cb273f4
diff --git a/webview/platforms/cocoa.py b/webview/platforms/cocoa.py index <HASH>..<HASH> 100755 --- a/webview/platforms/cocoa.py +++ b/webview/platforms/cocoa.py @@ -338,6 +338,9 @@ class BrowserView: self.webkit = BrowserView.WebKitHost.alloc().initWithFrame_(rect).retain() + if 'user_agent' in settings and settings['user_agent']: + self.webkit.setCustomUserAgent_(settings['user_agent']) + if window.initial_x is not None and window.initial_y is not None: self.move(window.initial_x, window.initial_y) else:
Added user-agent support for cocoa
r0x0r_pywebview
train
py
7881338c2f09e5614a08cb260774b508feae7c79
diff --git a/lang/en_US.php b/lang/en_US.php index <HASH>..<HASH> 100644 --- a/lang/en_US.php +++ b/lang/en_US.php @@ -3,7 +3,7 @@ global $lang; $lang['en_US']['SubsiteAdmin']['MENUTITLE'] = array( - 'Subsite', + 'Subsites', 100, 'Menu title' );
BUGFIX: Fixed name of subsite admin area - it is now 'Subsites', and will survive an i<I>ncollectortask execution. (from r<I>) (from r<I>)
silverstripe_silverstripe-subsites
train
php
73d58b4c0bfb12ddce0ae35156d05bc825e5ff70
diff --git a/lib/pod/command/plugins/installed.rb b/lib/pod/command/plugins/installed.rb index <HASH>..<HASH> 100644 --- a/lib/pod/command/plugins/installed.rb +++ b/lib/pod/command/plugins/installed.rb @@ -72,10 +72,10 @@ module Pod end end - # List of registered hook(s) (if any) for the given plugin + # Names of the registered hook(s) (if any) for the given plugin # # @return [Array<String>] - # List of hooks the given plugin did register for. + # Names of the hooks the given plugin did register for. # def registered_hooks(plugin) registrations = Pod::HooksManager.registrations
[installed] Improved yard doc
CocoaPods_cocoapods-plugins
train
rb
edf89c87ae4b6d930968da497caffd3dad4ef167
diff --git a/modules/social_features/social_group/modules/social_group_invite/src/Plugin/Join/SocialGroupInviteJoin.php b/modules/social_features/social_group/modules/social_group_invite/src/Plugin/Join/SocialGroupInviteJoin.php index <HASH>..<HASH> 100644 --- a/modules/social_features/social_group/modules/social_group_invite/src/Plugin/Join/SocialGroupInviteJoin.php +++ b/modules/social_features/social_group/modules/social_group_invite/src/Plugin/Join/SocialGroupInviteJoin.php @@ -107,7 +107,7 @@ class SocialGroupInviteJoin extends SocialGroupDirectJoin { } elseif ( count($items = parent::actions($entity, $variables)) === 1 && - $entity->bundle() === 'flexible_group' || + in_array($entity->bundle(), $this->types()) || $entity->bundle() === 'closed_group' && !$entity->hasPermission('manage all groups', $this->currentUser) ) { @@ -125,4 +125,11 @@ class SocialGroupInviteJoin extends SocialGroupDirectJoin { return $items; } + /** + * Gets a list of group types to which a user can be invited. + */ + protected function types(): array { + return ['flexible_group']; + } + }
Issue #<I> by chmez: Create a method for providing a list of group types to which a user can be invited
goalgorilla_open_social
train
php
3bb048251a91d1a6b51ddb49eb6867b976a12ef6
diff --git a/allauth/account/models.py b/allauth/account/models.py index <HASH>..<HASH> 100644 --- a/allauth/account/models.py +++ b/allauth/account/models.py @@ -145,7 +145,7 @@ class EmailConfirmationHMAC: try: max_age = 60 * 60 * 24 * app_settings.EMAIL_CONFIRMATION_EXPIRE_DAYS pk = signing.loads(key, max_age=max_age, salt=app_settings.SALT) - ret = EmailConfirmationHMAC(EmailAddress.objects.get(pk=pk)) + ret = EmailConfirmationHMAC(EmailAddress.objects.get(pk=pk, verified=False)) except ( signing.SignatureExpired, signing.BadSignature,
feat(account): only process confirmation mails for unverified email addresses * Update app_settings.py * Update views.py * Update views.py * Update models.py * Update app_settings.py * Update views.py * Update app_settings.py
pennersr_django-allauth
train
py
2367ecb919d351d1ccd0201716a75c7ae689f234
diff --git a/taxtastic/subcommands/new_database.py b/taxtastic/subcommands/new_database.py index <HASH>..<HASH> 100644 --- a/taxtastic/subcommands/new_database.py +++ b/taxtastic/subcommands/new_database.py @@ -45,6 +45,12 @@ def build_parser(parser): and/or re-create the database even if one or both already exists. [%(default)s]""") + parser.add_argument( + '--preserve-inconsistent-taxonomies', + action='store_true', default=False, + help="""If a node has the same rank as its parent, do *not* its rank + set to no_rank.""") + def action(args): dbname = args.database_file @@ -60,6 +66,19 @@ def action(args): (dbname, zfile)) con = ncbi.db_connect(dbname, clobber=True) ncbi.db_load(con, zfile) + if not args.preserve_inconsistent_taxonomies: + curs = con.cursor() + curs.execute(""" + UPDATE nodes + SET rank = 'no_rank' + WHERE tax_id IN (SELECT n1.tax_id + FROM nodes n1 + JOIN nodes n2 + ON n1.parent_id = n2.tax_id + WHERE n1.rank = n2.rank + AND n1.rank NOT IN ('root', 'no_rank')) + """) + con.commit() con.close() else: log.warning('taxonomy database already exists in %s' % dbname)
Fixing taxonomies in new_database by default.
fhcrc_taxtastic
train
py
399241cae26de85ad39e1152376f9dcbd25d517a
diff --git a/cmd/nuke.go b/cmd/nuke.go index <HASH>..<HASH> 100644 --- a/cmd/nuke.go +++ b/cmd/nuke.go @@ -33,8 +33,8 @@ func NewNuke(params NukeParameters, account awsutil.Account) *Nuke { func (n *Nuke) Run() error { var err error - if n.Parameters.ForceSleep < 3 { - return fmt.Errorf("Value for --force-sleep cannot be less than 3 seconds. This is for your own protection.") + if n.Parameters.ForceSleep < 3 && n.Parameters.NoDryRun { + return fmt.Errorf("Value for --force-sleep cannot be less than 3 seconds if --no-dry-run is set. This is for your own protection.") } forceSleep := time.Duration(n.Parameters.ForceSleep) * time.Second
Only force sleep to be more than 3 seconds if `--no-dry-run` is set (#<I>) Useful for debugging discovery/listing. Allows setting it to 0 if the nuking isn't going to be happen.
rebuy-de_aws-nuke
train
go
5a358d8c7e817a380beae09feb8cc024409b5079
diff --git a/src/video.js b/src/video.js index <HASH>..<HASH> 100644 --- a/src/video.js +++ b/src/video.js @@ -100,6 +100,7 @@ Video.prototype.createLayer = function(config) { video._isRoot = false; video.init(); + video._resize(this.width, this.height); this._children.push(video);
resize new layered video canvases
jansedivy_potion
train
js
6efb62d94c6191ca7e8fbc1cf57578ed44822dd0
diff --git a/server/app/services/rpc_client.rb b/server/app/services/rpc_client.rb index <HASH>..<HASH> 100644 --- a/server/app/services/rpc_client.rb +++ b/server/app/services/rpc_client.rb @@ -53,16 +53,10 @@ class RpcClient end end + ## # @param [Fixnum] request_id # @return [Celluloid::Future] def response(request_id) - Celluloid::Future.new{ self.wait_for_response(request_id) } - end - - ## - # @param [Fixnum] request_id - # @return [Array<Object>] - def wait_for_response(request_id) result = nil error = nil resp_received = false @@ -74,17 +68,20 @@ class RpcClient resp_received = true end end - begin - Timeout::timeout(self.timeout) do - sleep 0.001 until resp_received + + Celluloid::Future.new { + begin + Timeout::timeout(self.timeout) do + sleep 0.001 until resp_received + end + rescue + raise RpcClient::TimeoutError.new(503, "Connection timeout (#{self.timeout}s)") + ensure + subscription.terminate if subscription.alive? end - rescue - raise RpcClient::TimeoutError.new(503, "Connection timeout (#{self.timeout}s)") - ensure - subscription.terminate if subscription.alive? - end - [result, error] + [result, error] + } end ##
subscribe to rpc response channel before spawning future
kontena_kontena
train
rb
77e4677fc576d36748702b2f49338769104cc0e8
diff --git a/src/eXpansion/Framework/AdminGroups/Helpers/AdminGroups.php b/src/eXpansion/Framework/AdminGroups/Helpers/AdminGroups.php index <HASH>..<HASH> 100644 --- a/src/eXpansion/Framework/AdminGroups/Helpers/AdminGroups.php +++ b/src/eXpansion/Framework/AdminGroups/Helpers/AdminGroups.php @@ -48,6 +48,7 @@ class AdminGroups foreach ($this->adminGroupConfiguration->getGroups() as $groupName) { $groups[] = $this->getUserGroup("$groupName"); } + $groups[] = $this->getUserGroup('guest'); return $groups; }
#<I> - Fixed issue with guest admin group missing in list of groups.
eXpansionPluginPack_eXpansion2
train
php
b4555ed7300526cd08837f7302cecf065cc0f7bc
diff --git a/src/project/ProjectManager.js b/src/project/ProjectManager.js index <HASH>..<HASH> 100644 --- a/src/project/ProjectManager.js +++ b/src/project/ProjectManager.js @@ -670,8 +670,8 @@ define(function (require, exports, module) { "mouseup.jstree", function (event) { var treenode = $(event.target).closest("li"); - // How long do we wait for the long press. OS X testing seemed to imply 2 seconds - var longPressThreshhold = 200; + // Guess (based on eye-test) for Mac and Win length of a long press before the rename input show sup. + var longPressThreshhold = 250; // Check to make sure the event is happening on the selected item if ($(treenode)[0] === $(_lastSelected)[0]) {
Tweaked the timing threshhold based on some additional testing. Also cleared up the comment.
adobe_brackets
train
js
42616536394e23419278480ce0fec02df6e59ffd
diff --git a/glud/internal.py b/glud/internal.py index <HASH>..<HASH> 100644 --- a/glud/internal.py +++ b/glud/internal.py @@ -65,6 +65,8 @@ class AnyBaseClassMatcher(Matcher): for c in cursor.get_children(): if c.kind == CursorKind.CXX_BASE_SPECIFIER: cdef = c.get_definition() + if cdef is None: + continue if any(m(cdef) for m in self.matchers): return True elif self(cdef):
corrected issue in the base class matcher
AndrewWalker_glud
train
py
f8d9f96034f362a50211e9900e0e0ca77e00a79c
diff --git a/lib/travis/addons/pusher/task.rb b/lib/travis/addons/pusher/task.rb index <HASH>..<HASH> 100644 --- a/lib/travis/addons/pusher/task.rb +++ b/lib/travis/addons/pusher/task.rb @@ -27,6 +27,8 @@ module Travis case client_event when 'job:log' ["job-#{payload[:id]}"] + when /^worker/ + ['workers'] else ['common'] end diff --git a/spec/travis/addons/pusher/task_spec.rb b/spec/travis/addons/pusher/task_spec.rb index <HASH>..<HASH> 100644 --- a/spec/travis/addons/pusher/task_spec.rb +++ b/spec/travis/addons/pusher/task_spec.rb @@ -142,10 +142,10 @@ describe Travis::Addons::Pusher::Task do handler.send(:channels).should include('common') end - it 'returns "common" for the event "worker:started"' do + it 'returns "workers" for the event "worker:started"' do payload = Travis::Api.data(worker, for: 'pusher', type: 'worker', version: 'v1') handler = subject.new(payload, event: 'worker:created') - handler.send(:channels).should include('common') + handler.send(:channels).should include('workers') end end
worker:started pusher messages should go to the workers channel
travis-ci_travis-core
train
rb,rb
9dd0f82b46420c9c8fd5a43411703f149ccdcd0b
diff --git a/OauthPlugin.php b/OauthPlugin.php index <HASH>..<HASH> 100644 --- a/OauthPlugin.php +++ b/OauthPlugin.php @@ -88,7 +88,7 @@ class OauthPlugin extends BasePlugin public function registerCpRoutes() { return array( - 'oauth' => array('action' => "oauth/index"), + 'oauth' => array('action' => "oauth/providers/index"), 'oauth/tokens' => array('action' => "oauth/tokens/index"), 'oauth/providers/(?P<handle>.*)/tokens' => ['action' => 'oauth/tokens/providerTokens'], 'oauth/providers/(?P<handle>.*)' => array('action' => "oauth/providerInfos"),
Fixed route for OAuth CP section index
dukt_oauth
train
php
b01a4e65794585352d8a27ee46db6b2b9c823282
diff --git a/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/controllers/group/GroupInfoFragment.java b/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/controllers/group/GroupInfoFragment.java index <HASH>..<HASH> 100644 --- a/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/controllers/group/GroupInfoFragment.java +++ b/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/controllers/group/GroupInfoFragment.java @@ -216,7 +216,7 @@ public class GroupInfoFragment extends BaseFragment { //Members TextView memberCount = (TextView) header.findViewById(R.id.membersCount); - memberCount.setText(groupInfo.getMembersCount()); + memberCount.setText(groupInfo.getMembersCount() + ""); memberCount.setTextColor(style.getTextHintColor()); listView.addHeaderView(header, null, false);
fix(android): set members count string
actorapp_actor-platform
train
java
8fc788e5633091998c2518b145cf7a3f88b82b88
diff --git a/sharding-core/src/main/java/io/shardingsphere/core/event/executor/SQLExecutionEvent.java b/sharding-core/src/main/java/io/shardingsphere/core/event/executor/SQLExecutionEvent.java index <HASH>..<HASH> 100644 --- a/sharding-core/src/main/java/io/shardingsphere/core/event/executor/SQLExecutionEvent.java +++ b/sharding-core/src/main/java/io/shardingsphere/core/event/executor/SQLExecutionEvent.java @@ -37,6 +37,4 @@ public class SQLExecutionEvent extends ShardingEvent { private final RouteUnit routeUnit; private final List<Object> parameters; - - private final String url; }
#<I>, for comment: refine SQL execution event mechanism
apache_incubator-shardingsphere
train
java
646de3e3afef5e8c1b772f8ee293adf10ddbc58d
diff --git a/src/org/zaproxy/zap/extension/api/ApiGeneratorUtils.java b/src/org/zaproxy/zap/extension/api/ApiGeneratorUtils.java index <HASH>..<HASH> 100644 --- a/src/org/zaproxy/zap/extension/api/ApiGeneratorUtils.java +++ b/src/org/zaproxy/zap/extension/api/ApiGeneratorUtils.java @@ -22,6 +22,7 @@ import java.util.List; import org.parosproxy.paros.core.scanner.ScannerParam; import org.parosproxy.paros.network.ConnectionParam; +import org.zaproxy.zap.extension.alert.AlertAPI; import org.zaproxy.zap.extension.anticsrf.AntiCsrfAPI; import org.zaproxy.zap.extension.anticsrf.AntiCsrfParam; import org.zaproxy.zap.extension.ascan.ActiveScanAPI; @@ -60,6 +61,8 @@ public class ApiGeneratorUtils { ApiImplementor api; + imps.add(new AlertAPI(null)); + api = new AntiCsrfAPI(null); api.addApiOptions(new AntiCsrfParam()); imps.add(api);
Include Alert API when generating API clients Change ApiGeneratorUtils to include the Alert API, introduced in #<I>.
zaproxy_zaproxy
train
java
617b59286b1cf9b394bb2de4b6062dd9961dd28e
diff --git a/classes/ggwebservicesserver.php b/classes/ggwebservicesserver.php index <HASH>..<HASH> 100644 --- a/classes/ggwebservicesserver.php +++ b/classes/ggwebservicesserver.php @@ -51,7 +51,7 @@ abstract class ggWebservicesServer /// @todo reinflate, dechunk, correct encoding, check for supported /// http features of the client, etc... - $data = ggWebservicesResponse::stripHTTPHeader( $this->RawPostData ); + $data = $this->RawPostData; $request = $this->parseRequest( $data );
- fix parsing of request body: do not try to strip http headers from it, as they are not there!
gggeek_ggwebservices
train
php
805a0a4bc9d405a79e2208551e78c7116f2ca604
diff --git a/src/Asset/AssetAbstract.php b/src/Asset/AssetAbstract.php index <HASH>..<HASH> 100644 --- a/src/Asset/AssetAbstract.php +++ b/src/Asset/AssetAbstract.php @@ -14,7 +14,7 @@ abstract class AssetAbstract protected $asset; protected $renderString; - public function __construct(string $asset) { + public function __construct($asset) { $this->asset = $asset; }
String fix on AssetAbstract.
tylerjuniorcollege_slim-layout
train
php
101302eec6c52b0eaa797c81e94e2bb3b16a3ab1
diff --git a/javascript/libjoynr-js/src/main/js/joynr/dispatching/types/SubscriptionInformation.js b/javascript/libjoynr-js/src/main/js/joynr/dispatching/types/SubscriptionInformation.js index <HASH>..<HASH> 100644 --- a/javascript/libjoynr-js/src/main/js/joynr/dispatching/types/SubscriptionInformation.js +++ b/javascript/libjoynr-js/src/main/js/joynr/dispatching/types/SubscriptionInformation.js @@ -53,6 +53,23 @@ define("joynr/dispatching/types/SubscriptionInformation", [ } } + /* + * the following members may contain native timer objects, which cannot + * be serialized via JSON.stringify(), hence they must be excluded + */ + Object.defineProperty(this, 'endDateTimeout', { + enumerable : false, + configurable : false, + writable : true, + value : undefined + }); + Object.defineProperty(this, 'subscriptionInterval', { + enumerable : false, + configurable : false, + writable : true, + value : undefined + }); + /** * The joynr type name *
[JS] Bugfix: Hide timer based SubscriptionInformation members * Timer based members in SubscriptionInformation since they may contain cyclic references and cannot be serialized by JSON.stringify(). Change-Id: I<I>bd1c3b<I>da<I>eab<I>ecaf1bec<I>f<I>
bmwcarit_joynr
train
js
2be045189b0b17dc12951e707370c82104e10376
diff --git a/src/Pupcake/Object.php b/src/Pupcake/Object.php index <HASH>..<HASH> 100644 --- a/src/Pupcake/Object.php +++ b/src/Pupcake/Object.php @@ -24,15 +24,15 @@ class Object public function __call($method_name, $params) { $class_name = get_class($this); - if(isset($this->methods[$class_name])){ - return call_user_func_array($this->methods[$class_name], $params); + if(isset($this->methods[$class_name][$method_name])){ + return call_user_func_array($this->methods[$class_name][$method_name], $params); } } final public function method($name, $callback) { $class_name = get_called_class(); - $this->methods[$class_name] = $callback; + $this->methods[$class_name][$name] = $callback; } final public function storageSet($key, $val) diff --git a/src/Pupcake/Pupcake.php b/src/Pupcake/Pupcake.php index <HASH>..<HASH> 100644 --- a/src/Pupcake/Pupcake.php +++ b/src/Pupcake/Pupcake.php @@ -4,7 +4,7 @@ * * @author Zike(Jim) Huang * @copyright 2012 Zike(Jim) Huang - * @version 1.4alpha + * @version 1.6alpha * @package Pupcake */
fix critical error in object method hashing
superjimpupcake_Pupcake
train
php,php
6bf002a955fac6f994bf09290562af366d5a4fff
diff --git a/lib/media/drm_engine.js b/lib/media/drm_engine.js index <HASH>..<HASH> 100644 --- a/lib/media/drm_engine.js +++ b/lib/media/drm_engine.js @@ -1173,11 +1173,19 @@ shaka.media.DrmEngine.probeSupport = function() { 'com.adobe.primetime' ]; + var basicVideoCapabilities = [ + { contentType: 'video/mp4; codecs="avc1.42E01E"' } + ]; + + var basicConfig = { + videoCapabilities: basicVideoCapabilities + }; var offlineConfig = { + videoCapabilities: basicVideoCapabilities, persistentState: 'required', sessionTypes: ['persistent-license'] }; - var basicConfig = {}; + // Try the offline config first, then fall back to the basic config. var configs = [offlineConfig, basicConfig];
Add videoCapabilities to EME probes According to the spec, one of videoCapabilities or audioCapabilities must be non-empty. Change-Id: I7c<I>d<I>afab1aca<I>e<I>e<I>fa3d6bef6
google_shaka-player
train
js
1802195faadf786d42568658d40ce511218a9f9b
diff --git a/lib/build.js b/lib/build.js index <HASH>..<HASH> 100644 --- a/lib/build.js +++ b/lib/build.js @@ -180,7 +180,7 @@ module.exports = async (opts) => { config.output = { path: opts.outDir, filename: 'bundle.js', - publicPath: opts.basename + '/' + publicPath: opts.basename } // push per route/page diff --git a/lib/createTemplate.js b/lib/createTemplate.js index <HASH>..<HASH> 100644 --- a/lib/createTemplate.js +++ b/lib/createTemplate.js @@ -5,7 +5,7 @@ const defaultTemplate = require('./template') module.exports = opts => { const template = opts.template || defaultTemplate return context => { - const scripts = generateJSReferences(context.js, context.publicPath) + const scripts = generateJSReferences(context.js, context.publicPath + '/') return minify( template(Object.assign({}, context, { scripts
Adjust js script base url
c8r_x0
train
js,js
5521a9e7b128edaff4f8a4f8ac4675dd0306b01a
diff --git a/image_service_test.go b/image_service_test.go index <HASH>..<HASH> 100644 --- a/image_service_test.go +++ b/image_service_test.go @@ -48,6 +48,7 @@ func TestUpdateImage(t *testing.T) { t.Fatal(err) } + // this takes a while WaitForPendingJobs(client, linodeId) // list images for this linode account @@ -65,8 +66,6 @@ func TestUpdateImage(t *testing.T) { } } - WaitForPendingJobs(client, linodeId) - imageUpdateResponse, err := client.Image.Update(imageid, "Updated label", "Updated description") if err != nil { t.Fatal(err)
unneccessary blocking
taoh_linodego
train
go