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
5c54b9d726b8071de419c4db6b8ad5d41e2412f0
diff --git a/lib/Models/OgrCatalogItem.js b/lib/Models/OgrCatalogItem.js index <HASH>..<HASH> 100644 --- a/lib/Models/OgrCatalogItem.js +++ b/lib/Models/OgrCatalogItem.js @@ -183,11 +183,14 @@ function loadOgrData(ogrItem, file, url) { // generate form to submit file for conversion var formData = new FormData(); if (defined(file)) { + var maxConversionSize = 1000000; if (defined(terria.serverConfig) && defined(terria.serverConfig.config) && - defined(terria.serverConfig.config.maxConversionSize) && - file.size > terria.serverConfig.config.maxConversionSize) { - var maxConversionSizeMB = terria.serverConfig.config.maxConversionSize / 1000000; + defined(terria.serverConfig.config.maxConversionSize)) { + maxConversionSize = terria.serverConfig.config.maxConversionSize; + } + if (file.size > maxConversionSize) { + var maxConversionSizeMB = maxConversionSize / 1000000; errorLoading(ogrItem, 'The file size is greater than the '+maxConversionSizeMB+'MB limit of the '+terria.appName+' conversion service.'); return; }
[TerriaJS/geoglam-nm#<I>] Add a default check were the serverConfig doesn't contain maxConversionSize.
TerriaJS_terriajs
train
js
8c5b9fee0f52bdbb192280fef1dc18d8930666ca
diff --git a/ropetest/refactor/renametest.py b/ropetest/refactor/renametest.py index <HASH>..<HASH> 100644 --- a/ropetest/refactor/renametest.py +++ b/ropetest/refactor/renametest.py @@ -172,6 +172,14 @@ class RenameRefactoringTest(unittest.TestCase): self.assertEquals('async def new_func():\n pass\nnew_func()', refactored) + @testutils.only_for('3.5') + def test_renaming_await(self): + code = 'async def b_func():\n pass\nasync def a_func():\n await b_func()' + refactored = self._local_rename(code, len(code) - 5, 'new_func') + self.assertEquals('async def new_func():\n pass\nasync def a_func():\n await new_func()', + refactored) + + def test_renaming_functions_across_modules(self): mod1 = testutils.create_module(self.project, 'mod1') mod1.write('def a_func():\n pass\na_func()\n')
Added test for renaming in presence of await.
python-rope_rope
train
py
7881f368853f96adbc86465680a421a756801498
diff --git a/tpot/gp_deap.py b/tpot/gp_deap.py index <HASH>..<HASH> 100644 --- a/tpot/gp_deap.py +++ b/tpot/gp_deap.py @@ -23,7 +23,6 @@ License along with TPOT. If not, see <http://www.gnu.org/licenses/>. """ -import dask import numpy as np from deap import tools, gp from inspect import isclass
clean a bug reported in issue #<I>
EpistasisLab_tpot
train
py
86af7b091e5cc167d2b9a3146953da347cc38614
diff --git a/bdata/bdata.py b/bdata/bdata.py index <HASH>..<HASH> 100644 --- a/bdata/bdata.py +++ b/bdata/bdata.py @@ -1054,6 +1054,10 @@ class bdata(object): 'sl_c': [ve][f] combined helicity. """ + # check rebin factor + if type(rebin) not in (int,np.int64) or rebin < 1: + raise RuntimeError('Rebinning factor must be int >= 1.') + # check for additonal options (1F) if omit != '': further_options = list(map(str.strip,omit.split(' ')))
Added rebin check for int in asym
dfujim_bdata
train
py
b18d446ff2e5fee8ebbf289711619cc17860f50d
diff --git a/src/Container.php b/src/Container.php index <HASH>..<HASH> 100644 --- a/src/Container.php +++ b/src/Container.php @@ -26,6 +26,8 @@ use UnexpectedValueException; * @property-read array $setters A reference to the Factory $setter. * * @property-read array $types A reference to the Factory $types. + * + * @property-read array $values A reference to the Factory $values. * */ class Container implements ContainerInterface
Added missing property values in docblock
auraphp_Aura.Di
train
php
a7e03ed02049928a86fa40b64794124e91e0c5f7
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -88,8 +88,8 @@ setup(name="HMpTy", license='MIT', packages=find_packages(), package_data={'HMpTy': [ - 'resources/*/*', 'resources/*.*']}, - include_package_data=True, + 'resources/*/*', 'resources/*.*', 'default_settings.yaml']}, + # include_package_data=True, install_requires=[ 'pyyaml', 'HMpTy',
trying to add default_settings to pypi
thespacedoctor_HMpTy
train
py
e8db0311120d5e9a545fde5862f8a16b07760697
diff --git a/tags.go b/tags.go index <HASH>..<HASH> 100644 --- a/tags.go +++ b/tags.go @@ -70,11 +70,11 @@ func (store *TagStore) LookupImage(name string) (*Image, error) { if err != nil { // FIXME: standardize on returning nil when the image doesn't exist, and err for everything else // (so we can pass all errors here) - repoAndTag := strings.SplitN(name, ":", 2) - if len(repoAndTag) == 1 { - repoAndTag = append(repoAndTag, DEFAULTTAG) + repos, tag := utils.ParseRepositoryTag(name) + if tag == "" { + tag = DEFAULTTAG } - if i, err := store.GetImage(repoAndTag[0], repoAndTag[1]); err != nil { + if i, err := store.GetImage(repos, tag); err != nil { return nil, err } else if i == nil { return nil, fmt.Errorf("Image does not exist: %s", name)
Fixed tag parsing when the repos name contains both a port and a tag
moby_moby
train
go
6a2c089317286096b4d39c270b6b9534acfdf62f
diff --git a/libpebble2/util/hardware.py b/libpebble2/util/hardware.py index <HASH>..<HASH> 100644 --- a/libpebble2/util/hardware.py +++ b/libpebble2/util/hardware.py @@ -41,7 +41,7 @@ class PebbleHardware(object): SPALDING_EVT: 'chalk', SPALDING: 'chalk', SILK_EVT: 'diorite', - ROBERT_EVT: 'emery, + ROBERT_EVT: 'emery', SILK: 'diorite', TINTIN_BB: 'aplite', TINTIN_BB2: 'aplite',
Fix typo in ROBERT_EVT declaration
pebble_libpebble2
train
py
9fb56e01b7124d84c3bb8933835053eb2dedb418
diff --git a/ykman/cli/piv.py b/ykman/cli/piv.py index <HASH>..<HASH> 100644 --- a/ykman/cli/piv.py +++ b/ykman/cli/piv.py @@ -462,7 +462,17 @@ def unblock_pin(ctx, puk, new_pin): new_pin = click_prompt( "Enter a new PIN", default="", show_default=False, hide_input=True ) - session.unblock_pin(puk, new_pin) + try: + session.unblock_pin(puk, new_pin) + click.echo("PIN unblocked") + except InvalidPinError as e: + attempts = e.attempts_remaining + if attempts: + logger.debug("Failed to unblock PIN, %d tries left", attempts, exc_info=e) + ctx.fail("PIN unblock failed - %d tries left." % attempts) + else: + logger.debug("PUK is blocked.", exc_info=e) + ctx.fail("PUK is blocked.") @piv.group()
Error handling when unblocking pin
Yubico_yubikey-manager
train
py
81b2289ccd6421e4b2ed4e0a262459e9aeaf0fdb
diff --git a/jquery.colorpicker.js b/jquery.colorpicker.js index <HASH>..<HASH> 100644 --- a/jquery.colorpicker.js +++ b/jquery.colorpicker.js @@ -2,9 +2,9 @@ /*globals jQuery */ /* - * ColorPicker v0.6.4 + * ColorPicker v0.6.5 * - * Copyright (c) 2011 Martijn W. van der Lee + * Copyright (c) 2011-2012 Martijn W. van der Lee * Licensed under the MIT. * * Full-featured colorpicker for jQueryUI with full theming support.
Alpha channel fix in parsing of RGBA() color by ramontiveros
vanderlee_colorpicker
train
js
e0d7bace4ecb9152fac112e809af521e36fbc6a5
diff --git a/railties/lib/commands/server.rb b/railties/lib/commands/server.rb index <HASH>..<HASH> 100644 --- a/railties/lib/commands/server.rb +++ b/railties/lib/commands/server.rb @@ -23,10 +23,10 @@ server = case ARGV.first when "lighttpd", "mongrel", "new_mongrel", "webrick", "thin" ARGV.shift else - if defined?(Thin) - "thin" - elsif defined?(Mongrel) + if defined?(Mongrel) "mongrel" + elsif defined?(Thin) + "thin" elsif RUBY_PLATFORM !~ /(:?mswin|mingw)/ && !silence_stderr { `lighttpd -version` }.blank? && defined?(FCGI) "lighttpd" else
Prefer Mongrel over Thin [#<I> state:resolved]
rails_rails
train
rb
53757c570c506fe7ec3f40d34bdad4844f1b3f46
diff --git a/packages/karma.conf.js b/packages/karma.conf.js index <HASH>..<HASH> 100644 --- a/packages/karma.conf.js +++ b/packages/karma.conf.js @@ -18,7 +18,7 @@ module.exports = function (config) { jasmine: { random: false, }, - clearContext: true // leave Jasmine Spec Runner output visible in browser + clearContext: false // leave Jasmine Spec Runner output visible in browser }, coverageReporter: { subdir: '.',
chore: set `clearContext` is `false` (#<I>)
ng-alain_delon
train
js
95c17ef4dd920d7764f4989081f604a2232c5872
diff --git a/src/org/openscience/cdk/io/CMLReader.java b/src/org/openscience/cdk/io/CMLReader.java index <HASH>..<HASH> 100644 --- a/src/org/openscience/cdk/io/CMLReader.java +++ b/src/org/openscience/cdk/io/CMLReader.java @@ -39,7 +39,8 @@ import java.io.*; import java.net.*; /** - * Reads a molecule in CML format from a Reader. + * Reads a molecule in CML 1.0 and 1.1 format from a Reader. + * CML 2.0 is not yet supported. * * References: * <a href="http://cdk.sf.net/biblio.html#PMR99">PMR99</a>,
Updated info about currently supported CML versions. git-svn-id: <URL>
cdk_cdk
train
java
f8aeffaf1aa9cda4c5289864116a3431dafeaa3e
diff --git a/marrow/util/url.py b/marrow/util/url.py index <HASH>..<HASH> 100644 --- a/marrow/util/url.py +++ b/marrow/util/url.py @@ -218,7 +218,7 @@ class URL(object): parts.append(self.user or "") parts.append((":" + self.password) if self.user else ("@" if self.user else "")) parts.append(self.host or "") - parts.append((":" + self.port) if self.port else "") + parts.append((":" + str(self.port)) if self.port else "") parts.append(unicode(self.path) or "/") parts.append((";" + unicode(self.params)) if self.params else "") parts.append(("?" + unicode(self.query)) if self.query else "")
Now handles integer port numbers correctly; this is important is populated by an existing URL.
marrow_util
train
py
c195907f553df6760214c2032ecb3f83b81e8580
diff --git a/src/tabris/main.js b/src/tabris/main.js index <HASH>..<HASH> 100644 --- a/src/tabris/main.js +++ b/src/tabris/main.js @@ -108,7 +108,7 @@ Object.assign(window, { XMLHttpRequest }); -tabris.once('start', () => { +tabris.on('start', () => { tabris.app = createApp(); tabris.ui = createUi(); tabris.device = createDevice();
Enable initializing Tabris.js more than once When mocking tabris, it is useful to reset the state of the module between tests. Enable triggering the tabris 'start' event on demand to reset internal state. Change-Id: I1a<I>d<I>d<I>f<I>ebba<I>d
eclipsesource_tabris-js
train
js
0aa81bc3462ba89b238599cdfb8395e97451f1b9
diff --git a/version.php b/version.php index <HASH>..<HASH> 100644 --- a/version.php +++ b/version.php @@ -6,9 +6,9 @@ // This is compared against the values stored in the database to determine // whether upgrades should be performed (see lib/db/*.php) - $version = 2006050400; // YYYYMMDD = date + $version = 2006050500; // YYYYMMDD = date // XY = increments within a single day $release = '1.7 dev'; // Human-friendly version name -?> +?> \ No newline at end of file
Fix for Bug #<I> - Inconsistency between log_display and log tables. Bumped version number.
moodle_moodle
train
php
568566edd26806eea312f4bac632644bb4c242f6
diff --git a/core/src/main/java/com/orientechnologies/orient/core/metadata/security/OImmutableRole.java b/core/src/main/java/com/orientechnologies/orient/core/metadata/security/OImmutableRole.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/orientechnologies/orient/core/metadata/security/OImmutableRole.java +++ b/core/src/main/java/com/orientechnologies/orient/core/metadata/security/OImmutableRole.java @@ -64,7 +64,11 @@ public class OImmutableRole implements OSecurityRole { final ORule.ResourceGeneric resourceGeneric, final String resourceSpecific, final int iCRUDOperation) { - final ORule rule = rules.get(resourceGeneric); + ORule rule = rules.get(resourceGeneric); + if (rule == null) { + rule = rules.get(ORule.ResourceGeneric.ALL); + } + if (rule != null) { final Boolean allowed = rule.isAllowed(resourceSpecific, iCRUDOperation); if (allowed != null) return allowed;
Fix security checks for ROOT user (check ALL permission as a fallback)
orientechnologies_orientdb
train
java
b53af6a2247d1fb850d4a451123673e2b8247a66
diff --git a/provider/ec2/local_test.go b/provider/ec2/local_test.go index <HASH>..<HASH> 100644 --- a/provider/ec2/local_test.go +++ b/provider/ec2/local_test.go @@ -5,6 +5,7 @@ package ec2_test import ( "fmt" + "net" "regexp" "sort" "strings" @@ -804,8 +805,8 @@ func (t *localServerSuite) TestSubnets(c *gc.C) { CIDR: "10.10.0.0/20", ProviderId: "subnet-0", VLANTag: 0, - AllocatableIPLow: "10.10.0.4", - AllocatableIPHigh: "10.10.15.254", + AllocatableIPLow: net.ParseIP("10.10.0.4").To4(), + AllocatableIPHigh: net.ParseIP("10.10.15.254").To4(), }} c.Assert(subnets, jc.DeepEquals, defaultSubnets) }
Correct test for ec2 Subnets
juju_juju
train
go
6dac6c2072509af176663d55ce016c55c7ab2789
diff --git a/src/main/java/com/datasift/client/cli/Interface.java b/src/main/java/com/datasift/client/cli/Interface.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/datasift/client/cli/Interface.java +++ b/src/main/java/com/datasift/client/cli/Interface.java @@ -51,6 +51,7 @@ public class Interface { Map.Entry<String, String> authVals = auth.entrySet().iterator().next(); DataSiftConfig config = new DataSiftConfig(authVals.getKey(), authVals.getValue()); + config.host(parsedArgs.get("u")); DataSiftClient dataSift = new DataSiftClient(config); switch (parsedArgs.get("e")) { case "core":
add -u arg to override host
datasift_datasift-java
train
java
9d80dec246a7eb284ff33c3a0ffca91c6464e13b
diff --git a/Swat/SwatString.php b/Swat/SwatString.php index <HASH>..<HASH> 100644 --- a/Swat/SwatString.php +++ b/Swat/SwatString.php @@ -880,6 +880,27 @@ class SwatString extends SwatObject } // }}} + // {{{ public static function stripXHTMLTags() + + /** + * Removes all XHTML tags from a string + * + * This method is similar to the built-in + * {@link http://php.net/manual/en/function.strip-tags.php strip_tags} + * function in PHP but this method only strips XHTML tags. All other tags + * are left intact. + * + * @param string $string the string to remove XHTML tags from. + * + * @return string the given string with all XHTML tags removed. + */ + public static function stripXHTMLTags($string) + { + $elements = implode('|', self::$xhtml_elements); + return preg_replace('/<\/?('.$elements.')[^<>]*?>/siu', '', $string); + } + + // }}} // {{{ private static function stripEntities() /**
added method to remov ehtml from a string. svn commit r<I>
silverorange_swat
train
php
1e90b371c64fa192aed2999ef19dcb04de6b1ef1
diff --git a/scripts/fix-modules.js b/scripts/fix-modules.js index <HASH>..<HASH> 100644 --- a/scripts/fix-modules.js +++ b/scripts/fix-modules.js @@ -42,15 +42,15 @@ fix("./node_modules/solidity-docgen/dist/gather/solidity/compile.js", [ ); function copyDir(src, dest) { - fs.mkdirSync(dest); - for (const file of fs.readdirSync(src)) { - if (fs.lstatSync(src + "/" + file).isDirectory()) { - copyDir(src + "/" + file, dest + "/" + file); - } + fs.mkdirSync(dest); + for (const file of fs.readdirSync(src)) { + if (fs.lstatSync(src + "/" + file).isDirectory()) { + copyDir(src + "/" + file, dest + "/" + file); + } else { - fs.copyFileSync(src + "/" + file, dest + "/" + file); - } - } + fs.copyFileSync(src + "/" + file, dest + "/" + file); + } + } }; copyDir("./node_modules/truffle/node_modules/solc", "./node_modules/solidity-docgen/node_modules/solc");
Cosmetic (replace tabs with spaces).
bancorprotocol_contracts
train
js
53ce103c0890e51ff84b7542230ceab1b28ad9be
diff --git a/lib/MwbExporter/Formatter/Doctrine2/Annotation/Model/Column.php b/lib/MwbExporter/Formatter/Doctrine2/Annotation/Model/Column.php index <HASH>..<HASH> 100644 --- a/lib/MwbExporter/Formatter/Doctrine2/Annotation/Model/Column.php +++ b/lib/MwbExporter/Formatter/Doctrine2/Annotation/Model/Column.php @@ -96,7 +96,7 @@ class MwbExporter_Formatter_Doctrine2_Annotation_Model_Column extends MwbExporte $return[] = ' public function set' . $this->columnNameBeautifier($this->config['name']) . '($' . $this->config['name'] . ')'; $return[] = ' {'; - $return[] = ' $this->' . $this->config['name'] . ' = $' . $this->config['name']; + $return[] = ' $this->' . $this->config['name'] . ' = $' . $this->config['name'] . ';'; $return[] = ' return $this; // fluent interface'; $return[] = ' }'; $return[] = '';
fixed bug in annotation formatter missing semicolon in setters
mysql-workbench-schema-exporter_doctrine2-exporter
train
php
d7c60ddda9c8c97e0d6d360853f88246f58f2982
diff --git a/bokeh/models/tests/test_annotations.py b/bokeh/models/tests/test_annotations.py index <HASH>..<HASH> 100644 --- a/bokeh/models/tests/test_annotations.py +++ b/bokeh/models/tests/test_annotations.py @@ -55,15 +55,6 @@ def check_line(annotation): assert annotation.line_cap == LineCap.butt assert annotation.line_dash == [] assert annotation.line_dash_offset == 0 -# -# def check_text(annotation): -# assert annotation.text_font == "Helvetica" -# assert annotation.text_font_size == "12pt" -# assert annotation.text_font_style == FontStyle.normal -# assert annotation.text_color == "#444444" -# assert annotation.text_alpha == 1.0 -# assert annotation.text_align == TextAlign.left -# assert annotation.text_baseline == TextBaseline.bottom def test_Legend(): legend = Legend() @@ -94,6 +85,10 @@ def test_Legend(): def test_Shade(): shade = Shade() + assert shade.left == 'auto' + assert shade.right == 'auto' + assert shade.bottom == 'auto' + assert shade.top == 'auto' yield check_line, shade yield check_fill, shade yield (check_props, shade, [
Add shade bound tests to unittests
bokeh_bokeh
train
py
8f330cf4e13df2719c7ac1d737700d06fff803ee
diff --git a/examples/basic.php b/examples/basic.php index <HASH>..<HASH> 100644 --- a/examples/basic.php +++ b/examples/basic.php @@ -3,7 +3,9 @@ require __DIR__ . '/../vendor/autoload.php'; Amp\Loop::run(static function () { - $client = new Amp\Redis\Redis(new Amp\Redis\RemoteExecutor('tcp://localhost:6379')); + $client = new Amp\Redis\Redis(new Amp\Redis\RemoteExecutor( + Amp\Redis\Config::fromUri('tcp://localhost:6379') + )); yield $client->set('foo', '21'); $result = yield $client->increment('foo', 21);
Fix client instantiation with Config object (#<I>)
amphp_redis
train
php
9d0364e109b908f0ba5e7746a3413f0b95454b3c
diff --git a/phypno/widgets/utils.py b/phypno/widgets/utils.py index <HASH>..<HASH> 100644 --- a/phypno/widgets/utils.py +++ b/phypno/widgets/utils.py @@ -237,8 +237,14 @@ def keep_recent_recordings(new_recording=None): history = [history] if new_recording is not None: + if new_recording in history: + lg.debug(new_recording + ' already present, will be replaced') + history.remove(new_recording) if len(history) > MAX_RECORDING_HISTORY: + lg.debug('Removing last recording ' + history[-1]) history.pop() + + lg.info('Adding ' + new_recording + ' to list of recent recordings') history.insert(0, new_recording) config.setValue('recent_recordings', history) return None
additional log info when changing history of recent recordings
wonambi-python_wonambi
train
py
76cf78ebd0899059ccc49b1e60c89add31b2f41f
diff --git a/tensorboard/plugins/core/core_plugin.py b/tensorboard/plugins/core/core_plugin.py index <HASH>..<HASH> 100644 --- a/tensorboard/plugins/core/core_plugin.py +++ b/tensorboard/plugins/core/core_plugin.py @@ -54,10 +54,12 @@ class CorePlugin(base_plugin.TBPlugin): def get_plugin_apps(self): apps = { + '/___rPc_sWiTcH___': self._send_404_without_logging, '/audio': self._redirect_to_index, '/data/logdir': self._serve_logdir, '/data/runs': self._serve_runs, '/events': self._redirect_to_index, + '/favicon.ico': self._send_404_without_logging, '/graphs': self._redirect_to_index, '/histograms': self._redirect_to_index, '/images': self._redirect_to_index, @@ -72,6 +74,10 @@ class CorePlugin(base_plugin.TBPlugin): return apps @wrappers.Request.application + def _send_404_without_logging(self, request): + return http_util.Respond(request, 'Not found', 'text/plain', code=404) + + @wrappers.Request.application def _redirect_to_index(self, unused_request): return utils.redirect('/')
Don't log some noisy <I> errors (#<I>)
tensorflow_tensorboard
train
py
c38d6e8c582495af5b5cba29388f2b4077ed72b9
diff --git a/lib/thinking_sphinx/guard/file.rb b/lib/thinking_sphinx/guard/file.rb index <HASH>..<HASH> 100644 --- a/lib/thinking_sphinx/guard/file.rb +++ b/lib/thinking_sphinx/guard/file.rb @@ -21,6 +21,6 @@ class ThinkingSphinx::Guard::File end def unlock - FileUtils.rm path + FileUtils.rm(path) if locked? end end
unlock file only if it's locked
pat_thinking-sphinx
train
rb
e0de2e03860d659b80807a85a4a7d5422aabf5a8
diff --git a/omnibus/config/projects/chef-fips.rb b/omnibus/config/projects/chef-fips.rb index <HASH>..<HASH> 100644 --- a/omnibus/config/projects/chef-fips.rb +++ b/omnibus/config/projects/chef-fips.rb @@ -34,7 +34,9 @@ else install_dir "#{default_root}/#{name}" end +# Try a newer bundler to improve build speed. override :ruby, version: "2.1.7" +override :"rb-readline", version: "v0.5.3" # Global FIPS override flag. override :fips, enabled: true @@ -42,6 +44,8 @@ override :fips, enabled: true override :chef, version: "local_source" override :ohai, version: "master" +dependency "rb-readline" + msi_upgrade_code = "819F5DB3-B818-4358-BB2B-54B8171D0A26" project_location_dir = "chef-fips"
Add rb-readline as a project dependency
chef_chef
train
rb
bcd8192d563607879229f83a2451386a82e19de5
diff --git a/fsm/snapshots.go b/fsm/snapshots.go index <HASH>..<HASH> 100644 --- a/fsm/snapshots.go +++ b/fsm/snapshots.go @@ -18,9 +18,10 @@ import ( ) type FSMSnapshot struct { - State *FSMSnapshotState - Correlator *EventCorrelator - Events []*FSMSnapshotEvent + State *FSMSnapshotState + Correlator *EventCorrelator + Events []*FSMSnapshotEvent + ContinuedExecutionRunID *string } type FSMSnapshotState struct { @@ -130,6 +131,10 @@ func (s *snapshotter) FromHistoryEventIterator(itr HistoryEventIterator) ([]FSMS break } + if event.WorkflowExecutionStartedEventAttributes != nil { + snapshot.ContinuedExecutionRunID = event.WorkflowExecutionStartedEventAttributes.ContinuedExecutionRunID + } + snapshot.Correlator = nextCorrelator nextCorrelator = nil
Add ContinuedExecutionRunID to FSMSnapshot
sclasen_swfsm
train
go
eb8f02b6e06b8dab5817c2704602c1b9b905d7a5
diff --git a/externs/html5.js b/externs/html5.js index <HASH>..<HASH> 100644 --- a/externs/html5.js +++ b/externs/html5.js @@ -46,6 +46,11 @@ Window.prototype.JSON; */ function HTMLCanvasElement() {} +/** + * @type {function(new:HTMLCanvasElement)} + */ +Window.prototype.HTMLCanvasElement; + /** @type {number} */ HTMLCanvasElement.prototype.width;
Add HTMLCanvasElement to window. Fixes issue <I>. ------------- Created by MOE: <URL>
google_closure-compiler
train
js
b24cc4b4e8e48238ed81f88495f7854607f65b0a
diff --git a/dev/com.ibm.ws.concurrent.persistent_fat_failover1serv/fat/src/com/ibm/ws/concurrent/persistent/fat/failover1serv/Failover1ServerCoordinatedPollingTest.java b/dev/com.ibm.ws.concurrent.persistent_fat_failover1serv/fat/src/com/ibm/ws/concurrent/persistent/fat/failover1serv/Failover1ServerCoordinatedPollingTest.java index <HASH>..<HASH> 100644 --- a/dev/com.ibm.ws.concurrent.persistent_fat_failover1serv/fat/src/com/ibm/ws/concurrent/persistent/fat/failover1serv/Failover1ServerCoordinatedPollingTest.java +++ b/dev/com.ibm.ws.concurrent.persistent_fat_failover1serv/fat/src/com/ibm/ws/concurrent/persistent/fat/failover1serv/Failover1ServerCoordinatedPollingTest.java @@ -76,7 +76,7 @@ public class Failover1ServerCoordinatedPollingTest extends FATServletClient { public static void tearDown() throws Exception { try { server.stopServer( - "DSRA0302E", "DSRA0304E" // transaction times out and rolls back, persistent executor will retry + "DSRA0302E", "DSRA0304E", "J2CA0027E" // transaction times out and rolls back, persistent executor will retry ); } finally { server.updateServerConfiguration(originalConfig);
Issue #<I> J2CA<I>E missed for Failover1ServerCoordinatedPollingTest
OpenLiberty_open-liberty
train
java
f92e0d4da6980be31a8f251a777356752c12dbf1
diff --git a/test/integration/library_init.integration.js b/test/integration/library_init.integration.js index <HASH>..<HASH> 100644 --- a/test/integration/library_init.integration.js +++ b/test/integration/library_init.integration.js @@ -84,12 +84,13 @@ describe('library init', () => { done(); }); - it('can run library init without prompts', () => { + it('can run library init without prompts', function doit() { + this.timeout(10*1000); const app = cli.createAppCategory(); const lib = cli.createCategory(app, 'library'); libraryInit({lib, factory:cli}); const argv = cli.parse(app, ['library', 'init', '--name', 'foobar', - '--version=123', '--author=mrbig']); + '--version=1.2.3', '--author=mrbig']); expect(argv.clicommand).to.be.ok; const result = argv.clicommand.exec(argv).then(() => {
library init validates the version so make sure this is correctly formatted :-)
particle-iot_particle-cli
train
js
225f56d5604874c2824fe589c34ba116ae46fbc2
diff --git a/config/configure.rb b/config/configure.rb index <HASH>..<HASH> 100644 --- a/config/configure.rb +++ b/config/configure.rb @@ -91,6 +91,11 @@ options summary: You might still have to set libpath correctly EOS +unless $opts.check?([:lapack, :libpath, :download_lapack, :static_libs, :ptatlas, :arch_flavor, :libs, :lapack_build, :build_type]) + puts 'Configuration aborted.' + exit +end + configure :all => [:os_arch, :tools, :java, :cc, :fortran, :make, :lapack_sources, :libs] run :all diff --git a/config/opts.rb b/config/opts.rb index <HASH>..<HASH> 100644 --- a/config/opts.rb +++ b/config/opts.rb @@ -83,5 +83,14 @@ class Opts default end end + + def check?(admissible) + unsupported = @opts.keys - admissible + unless unsupported.empty? + puts "Unsupported flags #{unsupported.join(', ')}" + return false + end + true + end end end
Added a check that unsupported config flags lead to the configuration script to stop.
jblas-project_jblas
train
rb,rb
a9c88eb082e325b45027d9a06649f7ec8aab31e9
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,9 @@ module.exports = function (app, db) { var middleware = function (req, res, next) { if (opts.whitelist && opts.whitelist(req)) return next() opts.lookup = Array.isArray(opts.lookup) ? opts.lookup : [opts.lookup] - + opts.onRateLimited = typeof opts.onRateLimited === 'function' ? opts.onRateLimited : function (req, res, next) { + res.status(429).send('Rate limit exceeded') + } var lookups = opts.lookup.map(function (item) { return item + ':' + item.split('.').reduce(function (prev, cur) { return prev[cur] @@ -40,7 +42,7 @@ module.exports = function (app, db) { if (!opts.skipHeaders) res.set('Retry-After', after) - res.status(429).send('Rate limit exceeded') + opts.onRateLimited(req, res, next) }) })
Allow for optional handler for rate limiting Instead of hardcoding a response, allow an application to define its own way of handling rate limits being hit.
ded_express-limiter
train
js
ddf1935f306ec4804a7fe19943149194ac3f6814
diff --git a/lib/blocklib.php b/lib/blocklib.php index <HASH>..<HASH> 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -723,6 +723,8 @@ function blocks_get_pinned($page) { foreach($blocks as $block) { $block->pinned = true; // so we know we can't move it. + // make up an instanceid if we can.. + $block->pageid = $page->get_id(); $arr[$block->position][$block->weight] = $block; }
For pinned blocks (that don't have a pageid), make one up on the fly (Fixes bug #<I>)
moodle_moodle
train
php
69cadd9c533eb3e8e3e2b755ac642c45a990a496
diff --git a/src/server/pps/cmds/cmds.go b/src/server/pps/cmds/cmds.go index <HASH>..<HASH> 100644 --- a/src/server/pps/cmds/cmds.go +++ b/src/server/pps/cmds/cmds.go @@ -233,6 +233,8 @@ $ pachctl list-job -p foo bar/YYY return writer.Flush() }), } + rawFlag(listDatum) + inspectDatum := &cobra.Command{ Use: "inspect-datum job-id datum-id", Short: "Display detailed info about a single datum.", @@ -258,6 +260,7 @@ $ pachctl list-job -p foo bar/YYY return writer.Flush() }), } + rawFlag(inspectDatum) var ( jobID string
Enable raw flag for datum commands
pachyderm_pachyderm
train
go
ebe3b34ae7935d95f6bdf2c39cf89a5d6fa34f60
diff --git a/salt/states/boto_secgroup.py b/salt/states/boto_secgroup.py index <HASH>..<HASH> 100644 --- a/salt/states/boto_secgroup.py +++ b/salt/states/boto_secgroup.py @@ -126,6 +126,8 @@ def present( vpc_name The name of the VPC wherein to create the security group, if any. Exclusive with vpc_id. + .. versionadded:: 2015.8.2 + rules A list of ingress rule dicts. If not specified, ``rules=None``, the ingress rules will be unmanaged. If set to an empty list, ``[]``,
Add versionadded directive for vpc_name arg in boto_secgroup.present Fixes #<I>
saltstack_salt
train
py
20c2f4c2c3bd1a6d29fc4af179ee5e2ac1fe5a8f
diff --git a/lib/converter.js b/lib/converter.js index <HASH>..<HASH> 100644 --- a/lib/converter.js +++ b/lib/converter.js @@ -30,6 +30,7 @@ var default_options = { orientation: imgr.CENTRE , image_magick: false , optimisation: noOptimisation + , gm_quality: 100 }; /** @@ -191,6 +192,8 @@ Converter.prototype.save = function (output, callback) { operation.height = Math.round(size.height * operation.factor); } + image.quality(self.options.gm_quality); + //Fill in the missing dimension if (!operation.width && operation.height) { operation.width = Math.round(operation.height / size.height) * size.width;
Control what quality is sent to graphicsmagick
sydneystockholm_imgr
train
js
2e10368ab1784c9de90ba73c978e41dad253c43e
diff --git a/lib/simpletestcoveragelib.php b/lib/simpletestcoveragelib.php index <HASH>..<HASH> 100644 --- a/lib/simpletestcoveragelib.php +++ b/lib/simpletestcoveragelib.php @@ -442,7 +442,7 @@ class moodle_coverage_reporter extends HtmlCoverageReporter { $table->data = array( array(get_string('date') , userdate($data->time)), array(get_string('files') , format_float($data->totalfiles, 0)), - array(get_string('totallines', 'simpletest') , format_float($data->totallines, 0)), + array(get_string('totallines', 'simpletest') , format_float($data->totalln, 0)), array(get_string('executablelines', 'simpletest') , format_float($data->totalcoveredln + $data->totaluncoveredln, 0)), array(get_string('coveredlines', 'simpletest') , format_float($data->totalcoveredln, 0)), array(get_string('uncoveredlines', 'simpletest') , format_float($data->totaluncoveredln, 0)),
MDL-<I> code coverage - fix error when reporting number of lines in summary 2nd try :-(
moodle_moodle
train
php
db98521add37cd165aac22de4f2c04fe50a6bbd3
diff --git a/salt/netapi/rest_cherrypy/app.py b/salt/netapi/rest_cherrypy/app.py index <HASH>..<HASH> 100644 --- a/salt/netapi/rest_cherrypy/app.py +++ b/salt/netapi/rest_cherrypy/app.py @@ -7,7 +7,7 @@ A REST API for Salt .. py:currentmodule:: salt.netapi.rest_cherrypy.app -:depends: - CherryPy Python module +:depends: - CherryPy Python module, salt-api binary :optdepends: - ws4py Python module for websockets support. :configuration: All authentication is done through Salt's :ref:`external auth <acl-eauth>` system which requires additional configuration not described
adding the salt-api binary to the list of dependency requirements
saltstack_salt
train
py
03e30597283ee94e445f9b01abff76ea895b072d
diff --git a/lib/gcli/ui/command_output_view.js b/lib/gcli/ui/command_output_view.js index <HASH>..<HASH> 100644 --- a/lib/gcli/ui/command_output_view.js +++ b/lib/gcli/ui/command_output_view.js @@ -187,13 +187,19 @@ CommandOutputView.prototype.onChange = function(ev) { dom.clearElement(this.elems.output); var node; - if (this.outputData.output != null) { - if (this.outputData.output instanceof HTMLElement) { - this.elems.output.appendChild(this.outputData.output); + var output = this.outputData.output; + if (output != null) { + var isElement = typeof HTMLElement === 'object' ? + output instanceof HTMLElement : + typeof output === 'object' && output.nodeType === 1 && + typeof output.nodeName === 'string'; + + if (isElement) { + this.elems.output.appendChild(output); } else { node = dom.createElement(this.listView.document, 'p'); - dom.setInnerHtml(node, this.outputData.output.toString()); + dom.setInnerHtml(node, output.toString()); this.elems.output.appendChild(node); } }
Bug <I> (jumpscratch): Node doesn't know about HTMLElement so we check properties if it's not there
joewalker_gcli
train
js
16b3184a5ba24a12394a752133dcb64821d46f72
diff --git a/lib/pushbullet/channel.rb b/lib/pushbullet/channel.rb index <HASH>..<HASH> 100644 --- a/lib/pushbullet/channel.rb +++ b/lib/pushbullet/channel.rb @@ -1,5 +1,23 @@ module Pushbullet class Channel < Resource include Pushable + + def self.subscribe(name) + create(channel_tag: name) + end + + def self.unsubscribe(idn) + Pushbullet.client.delete "#{path}/#{idn}" + true + end + + def self.get_info(tag) + Pushbullet.client.get("channel-info?tag=#{tag}") + true + end + + def self.path + 'subscriptions' + end end end
Add channel missing methods subscribe, unsubscribe and get-info
letz_ruby-pushbullet
train
rb
ef561dde158103bb368dbb79b8d4ae0edfb6a51b
diff --git a/database/protocol.js b/database/protocol.js index <HASH>..<HASH> 100644 --- a/database/protocol.js +++ b/database/protocol.js @@ -16,7 +16,7 @@ protocol.prototype.createDataSet = function (datasetname, data) { operation: 'create', dataset: datasetname, content: { - owner_key: data.owner_key || "", + owner_key: data.owner_key || this.pubkey, writeScript: ((""+data.writeScript) == '5560' || !data.writeScript) ? data.writeScript : "", privileges: data.privileges || [] } @@ -162,7 +162,7 @@ protocol.prototype.setSettings = function (datasetname, data) { .then(function (item) { var act = 'settings', args = [] if (!item) { - var settings = {oid: 1, writeScript: ((""+data.writeScript) == '5560' || !data.writeScript) ? data.writeScript : "", owner_key: data.owner_key || '', privileges: data.privileges || []}; + var settings = {oid: 1, writeScript: ((""+data.writeScript) == '5560' || !data.writeScript) ? data.writeScript : "", owner_key: data.owner_key || f.pubkey, privileges: data.privileges || []}; //item = coll.insertItem(settings); args = { operation: 'insert',
fix owner_key on new database (is was empty) - if empty - set writer key as owner key.
gettocat_orwelldb
train
js
864d2f31b0d30a25d5986cb8682c5500454da6c8
diff --git a/lookup.py b/lookup.py index <HASH>..<HASH> 100644 --- a/lookup.py +++ b/lookup.py @@ -154,6 +154,7 @@ def _filter_stmts(self, stmts, frame, offset): break if isinstance(node, nodes.Class) and self in node.bases: break + assert hasattr(node, 'ass_type'), (node, node.scope(), node.scope().locals) ass_type = node.ass_type() if ass_type is mystmt and not isinstance(ass_type, (nodes.Class, nodes.Function, nodes.Import, nodes.From, nodes.Lambda)): diff --git a/scoped_nodes.py b/scoped_nodes.py index <HASH>..<HASH> 100644 --- a/scoped_nodes.py +++ b/scoped_nodes.py @@ -88,6 +88,7 @@ class LocalsDictMixIn(object): if the name is already defined, ignore it """ assert self.locals is not None, (self, id(self)) + assert not stmt in self.locals.get(name, ()), (self, stmt) self.locals.setdefault(name, []).append(stmt) __setitem__ = set_local
add some assertion, to remove later --HG-- branch : _ast_compat
PyCQA_astroid
train
py,py
c4404ae4767fab7adfa38b22679d8efa3f8073e7
diff --git a/src/neuron/lang/enhance.js b/src/neuron/lang/enhance.js index <HASH>..<HASH> 100755 --- a/src/neuron/lang/enhance.js +++ b/src/neuron/lang/enhance.js @@ -460,18 +460,17 @@ K._onceBefore = function(real_method_name, init_method_name, belong){ real = belong[real_method_name]; belong[real_method_name] = function(){ - init.call(this); + var ret, self = this; + + init.call(self); - var ret = real.apply(this, arguments); + ret = real.apply(self, arguments); + self[real_method_name] = real; - belong[real_method_name] = real; + init = real = null; return ret; }; - - // delete belong[init_method_name]; - // - belong[init_method_name] = NOOP; }; /** @@ -492,6 +491,8 @@ K._memoize = memoizeMethod; // overload_for_instance_method( memoizeMethod ) [1] why dangerous? you could find out. the order of the old keys and new created keys between various browsers is different change log: + 2012-01-04 Kael: + - KM._onceBefore will not affect prototype chain but instance only 2011-10-13 Kael: - KM.makeArray could has an array receiver to be merged to
lang/enhance: KM._onceBefore will not affect prototype chain but instance only
kaelzhang_neuron.js
train
js
af8607caada0fe35bccabd6f0c84aeec9d6b25a5
diff --git a/test/core_tests.py b/test/core_tests.py index <HASH>..<HASH> 100644 --- a/test/core_tests.py +++ b/test/core_tests.py @@ -125,20 +125,6 @@ class WhenRunningASpec(object): def it_should_not_make_any_more_calls(self): self.result.calls.should.have.length_of(10) -class WhenASpecPasses(object): - def context(self): - class TestSpec(object): - def it(self): - pass - self.spec = TestSpec() - self.result = contexts.reporting.SimpleResult() - - def because_we_run_the_spec(self): - contexts.run(self.spec, self.result) - - def the_result_should_report_success(self): - self.result.failed.should.be.false - class WhenAContextErrors(object): def context(self): class ErrorInSetup(object):
This test is not adding value any more
benjamin-hodgson_Contexts
train
py
06ee315de11ad57803b45286ff545eaec09dd76f
diff --git a/src/main/java/io/muserver/Http2Connection.java b/src/main/java/io/muserver/Http2Connection.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/muserver/Http2Connection.java +++ b/src/main/java/io/muserver/Http2Connection.java @@ -181,7 +181,6 @@ final class Http2Connection extends Http2ConnectionHandler implements Http2Frame @Override public void onPingRead(ChannelHandlerContext ctx, long data) { - encoder().writePing(ctx, true, data, ctx.channel().newPromise()); } @Override
Removed the extra ping-acks on HTTP2
3redronin_mu-server
train
java
60b354b71f48831f0a21f1e74bdd3f1c997ac802
diff --git a/src/jquery.lazyloadxt.picture.js b/src/jquery.lazyloadxt.picture.js index <HASH>..<HASH> 100644 --- a/src/jquery.lazyloadxt.picture.js +++ b/src/jquery.lazyloadxt.picture.js @@ -50,9 +50,8 @@ $img = $('<img>').appendTo($el); } - $img - .attr('width', $el.attr('width')) - .attr('height', $el.attr('height')); + $img.attr('width', $el.attr('width')); + $img.attr('height', $el.attr('height')); }) // show picture .on('lazyshow', 'picture', function (e, $el) {
fix error in the case of undefined width attribute
ressio_lazy-load-xt
train
js
cffb4edc422db3e16eaec0b6fda4bf074b0297ad
diff --git a/src/OpenAccess_EPUB/main.py b/src/OpenAccess_EPUB/main.py index <HASH>..<HASH> 100755 --- a/src/OpenAccess_EPUB/main.py +++ b/src/OpenAccess_EPUB/main.py @@ -177,16 +177,23 @@ def batch_input(args): #if args.no_epubcheck: #epubcheck('{0}.epub'.format(output_name)) + def collection_input(args): """ - + Collection Input Mode is intended for the combination of multiple articles + into a single ePub file. This may be useful for producing "Volumes", custom + reading lists for classroom use, and compendia on common subjects. + + There is a lot of potential for how this might be used, development will + proceed in the direction of interest. """ pass def zipped_input(args): """ - + Zipped Input Mode is primarily intended as a workflow for Frontiers + articles, where the article xml and relevant images are zipped together. """ pass
Added a bit of docstring to additional input methods
SavinaRoja_OpenAccess_EPUB
train
py
a265e098b80d03bee30b3c52db0df2e09264e5e9
diff --git a/Kwf/Assets/Filter/Css/UniquePrefix.php b/Kwf/Assets/Filter/Css/UniquePrefix.php index <HASH>..<HASH> 100644 --- a/Kwf/Assets/Filter/Css/UniquePrefix.php +++ b/Kwf/Assets/Filter/Css/UniquePrefix.php @@ -3,7 +3,10 @@ class Kwf_Assets_Filter_Css_UniquePrefix extends Kwf_Assets_Filter_Css_SelectorR { public function __construct($prefix = null) { - $prefix = $prefix ? $prefix : Kwf_Config::getValue('application.uniquePrefix'); + if (!$prefix) { + $prefix = Kwf_Config::getValue('application.uniquePrefix'); + if ($prefix) $prefix .= '-'; + } parent::__construct(array( 'kwfUp-' => $prefix ));
fix uniquePrefix, - has to be added
koala-framework_koala-framework
train
php
ce3ca2ef287d965a1e11b0255ae6f71f1fb34cc4
diff --git a/classes/apollo-mutation.js b/classes/apollo-mutation.js index <HASH>..<HASH> 100644 --- a/classes/apollo-mutation.js +++ b/classes/apollo-mutation.js @@ -1,5 +1,4 @@ -import { LitElement } from '@polymer/lit-element'; - +import { ApolloElement } from './apollo-element'; import { ApolloMutationMixin } from '../mixins/apollo-mutation-mixin'; /** @@ -46,7 +45,7 @@ import { ApolloMutationMixin } from '../mixins/apollo-mutation-mixin'; * @extends LitElement * @appliesMixin ApolloMutationMixin */ -export class ApolloMutation extends ApolloMutationMixin(LitElement) { +export class ApolloMutation extends ApolloMutationMixin(ApolloElement) { static get properties() { return { /**
Fixes a small bug in ApolloMutation
apollo-elements_apollo-elements
train
js
042fb6c8cd22ad97487dcfba65f5a6adab070573
diff --git a/lib/percy.rb b/lib/percy.rb index <HASH>..<HASH> 100644 --- a/lib/percy.rb +++ b/lib/percy.rb @@ -406,7 +406,7 @@ class Percy when /^:(\S+)!(\S+)@(\S+) PRIVMSG (\S+) :/ parse(:query, :nick => $1, :user => $2, :host => $3, :message => $') - when /^:(\S+)!(\S+)@(\S+) JOIN (\S+)$/ + when /^:(\S+)!(\S+)@(\S+) JOIN :*(\S+)$/ parse(:join, :nick => $1, :user => $2, :host => $3, :channel => $4) when /^:(\S+)!(\S+)@(\S+) PART (\S+)/
fixed JOIN regexp for some servers
tbuehlmann_percy
train
rb
0ace0ea52ca552aa90a181baa3bc2cde67ccaca5
diff --git a/pub/js/recently_viewed_products.js b/pub/js/recently_viewed_products.js index <HASH>..<HASH> 100644 --- a/pub/js/recently_viewed_products.js +++ b/pub/js/recently_viewed_products.js @@ -43,7 +43,10 @@ define(['lib/local_storage'], function(storage) { // TODO: Add "last" class to last element of the list. - return productList.innerHTML; + var temporaryContainer = document.createElement('DIV'); + temporaryContainer.appendChild(productList); + + return temporaryContainer.innerHTML; }, removeProductFromListBySku: function(list, sku) {
Issue #<I>: Fix recently viewed products outer HTML
lizards-and-pumpkins_catalog
train
js
d693ca0b568ef11fcc1dc199cff5be9613cdce1c
diff --git a/aioimaplib/aioimaplib.py b/aioimaplib/aioimaplib.py index <HASH>..<HASH> 100644 --- a/aioimaplib/aioimaplib.py +++ b/aioimaplib/aioimaplib.py @@ -628,6 +628,9 @@ class IMAP4(object): self.protocol = IMAP4ClientProtocol(loop) loop.create_task(loop.create_connection(lambda: self.protocol, host, port)) + def get_state(self): + return self.protocol.state + @asyncio.coroutine def wait_hello_from_server(self): yield from asyncio.wait_for(self.protocol.wait('AUTH|NONAUTH'), self.timeout)
[aiolib] method to get protocol state
bamthomas_aioimaplib
train
py
864f6643432819afd7d0e37c2388238263a27197
diff --git a/mtools/test/test_util_logfile.py b/mtools/test/test_util_logfile.py index <HASH>..<HASH> 100644 --- a/mtools/test/test_util_logfile.py +++ b/mtools/test/test_util_logfile.py @@ -5,7 +5,7 @@ from nose.tools import * from datetime import datetime from mtools.util.logfile import LogFile from mtools.util.logevent import LogEvent -from dateutil.tz import tzutc +from dateutil.tz import tzutc, tzoffset class TestUtilLogFile(object): @@ -41,6 +41,15 @@ class TestUtilLogFile(object): assert logfile.end == datetime(2014, 01, 02, 23, 27, 11, 720000, tzutc()) + def test_timezone(self): + + logfile_path = os.path.join(os.path.dirname(mtools.__file__), 'test/logfiles/', 'mongod_26.log') + mongod_26 = open(logfile_path, 'r') + + logfile = LogFile(mongod_26) + assert logfile.timezone == tzoffset(None, -14400) + + def test_rollover_detection(self): """ LogFile: test datetime_format and year_rollover properties """
added test for logfile.timezone property.
rueckstiess_mtools
train
py
597a9fac6a2d24756770b7f01e87a0a5311e3d06
diff --git a/ayrton/utils.py b/ayrton/utils.py index <HASH>..<HASH> 100644 --- a/ayrton/utils.py +++ b/ayrton/utils.py @@ -153,7 +153,7 @@ def copy_loop (copy_to, finished=None, buf_len=10240): if finished is not None and i==finished[0]: del copy_to[i] - os.close (finished[0]) + close (finished[0]) break # for error in e:
[*] use generic close() to close the finish object.
StyXman_ayrton
train
py
d0ad81fa955f82cfe0b8a213f3e9c7a7d91c6239
diff --git a/pygubu/uidesigner/previewer.py b/pygubu/uidesigner/previewer.py index <HASH>..<HASH> 100644 --- a/pygubu/uidesigner/previewer.py +++ b/pygubu/uidesigner/previewer.py @@ -158,10 +158,11 @@ class PreviewHelper: def delete(self, identifier): - preview = self.tabs[identifier] - preview.canvas_window.destroy() - del self.tabs[identifier] - self.notebook.forget(preview.tab_id) + if identifier in self.tabs: + preview = self.tabs[identifier] + preview.canvas_window.destroy() + del self.tabs[identifier] + self.notebook.forget(preview.tab_id) def remove_all(self):
Check that preview was created before delete.
alejandroautalan_pygubu
train
py
8b602ba836952ccf77eaa8eb576e60da70c17870
diff --git a/src/shapes/rectangle.js b/src/shapes/rectangle.js index <HASH>..<HASH> 100644 --- a/src/shapes/rectangle.js +++ b/src/shapes/rectangle.js @@ -279,7 +279,7 @@ var Rect = Polygon.extend({ _x1 = _x2 = arg0; _y1 = _y2 = arguments[1]; } else { - if (arg0 instanceof me.Rect) { + if (arg0 instanceof Rect) { // me.Rect _x1 = arg0.left; _x2 = arg0.right;
fix reference to the "me" global namespace should not (and cannot) be used/referenced through "me" within the class itself, or any other class for the matter !
melonjs_melonJS
train
js
37fc30b4fc3627f93c5b56b97ed13544dde35cd9
diff --git a/teknek-web/src/main/java/io/teknek/sol/Sol.java b/teknek-web/src/main/java/io/teknek/sol/Sol.java index <HASH>..<HASH> 100644 --- a/teknek-web/src/main/java/io/teknek/sol/Sol.java +++ b/teknek-web/src/main/java/io/teknek/sol/Sol.java @@ -246,11 +246,13 @@ public class Sol { if (parts.length == 3 && "CONFIGURE".equalsIgnoreCase(parts[0]) && parts[1].equalsIgnoreCase("feed")){ if (parts[1].equalsIgnoreCase("feed")){ //CONFIGURE FEED myFeed - String name = parts[2]; - FeedDesc feed = new FeedDesc(); - feed.setName(name); - feed.setProperties(new TreeMap<>()); - thePlan.setFeedDesc(feed); + if (thePlan.getFeedDesc() == null){ + String name = parts[2]; + FeedDesc feed = new FeedDesc(); + feed.setName(name); + feed.setProperties(new TreeMap<>()); + thePlan.setFeedDesc(feed); + } currentNode = feedPrompt; return new SolReturn(feedPrompt,""); }
Rentering configure feed was erasing settings
edwardcapriolo_teknek-kafka
train
java
8d3bff6800887f5051e81e3b36253604b3bca1cb
diff --git a/spyder/plugins/maininterpreter/tests/test_confpage.py b/spyder/plugins/maininterpreter/tests/test_confpage.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/maininterpreter/tests/test_confpage.py +++ b/spyder/plugins/maininterpreter/tests/test_confpage.py @@ -9,6 +9,9 @@ # Standard library imports import time +# Third-party imports +import pytest + # Local imports from spyder.api.plugins import Plugins from spyder.api.plugin_registration.registry import PLUGIN_REGISTRY @@ -23,11 +26,15 @@ from spyder.utils.pyenv import get_list_pyenv_envs # We're also recording the time needed to get them to compare it with the # loading time of that config page. t0 = time.time() -get_list_conda_envs() -get_list_pyenv_envs() +conda_envs = get_list_conda_envs() +pyenv_envs = get_list_pyenv_envs() GET_ENVS_TIME = time.time() - t0 [email protected]( + len(conda_envs) == 0 and len(pyenv_envs) == 0, + reason="Makes no sense if conda and pyenv are not installed" +) def test_load_time(qtbot): # Create Preferences dialog main = MainWindowMock()
Testing: Skip main interpreter conf page test if conda and pyenv are not installed
spyder-ide_spyder
train
py
f5d538da25507c23c6864e8644496f543f3cb897
diff --git a/thali/install/install.js b/thali/install/install.js index <HASH>..<HASH> 100644 --- a/thali/install/install.js +++ b/thali/install/install.js @@ -170,8 +170,15 @@ function uninstallPluginsIfNecessary(weAddedPluginsFile, appRootDirectory) { if (!doWeNeedToUninstall) { return; } - console.log('Removing previously installed Thali Cordova plugin'); - return childProcessExecPromise('cordova plugin remove org.thaliproject.p2p', appRootDirectory) + console.log('Trying to remove previously installed Thali Cordova plugin'); + var pluginRemoveCommand = 'cordova plugin remove org.thaliproject.p2p'; + return childProcessExecPromise(pluginRemoveCommand, appRootDirectory) + .catch(function (err) { + // Resolve the promise even if plugin removal fails, because it is possible + // that the user has removed the plugin outside of this install script, but there + // is still the left-over file that says this script has added the plugins. + return Promise.resolve(); + }); }) }
Fail gracefully if plugin missing.
thaliproject_Thali_CordovaPlugin
train
js
57e86005c0139ed4ab20c91ada48fd5d9da2d22a
diff --git a/lib/geocoder/lookups/maxmind.rb b/lib/geocoder/lookups/maxmind.rb index <HASH>..<HASH> 100644 --- a/lib/geocoder/lookups/maxmind.rb +++ b/lib/geocoder/lookups/maxmind.rb @@ -18,9 +18,6 @@ module Geocoder::Lookup warn "Maxmind error : #{doc[10]}" if doc return [] end - rescue StandardError => err - raise_error(err) - return [] end end
Don't rescue from StandardError. This code appears to be copied from the Freegeoip lookup, where it is undesirable to begin with.
alexreisner_geocoder
train
rb
f14c88de78bf9f2bbe91dd661004ab772ccf179e
diff --git a/lxd/instance/drivers/driver_qemu.go b/lxd/instance/drivers/driver_qemu.go index <HASH>..<HASH> 100644 --- a/lxd/instance/drivers/driver_qemu.go +++ b/lxd/instance/drivers/driver_qemu.go @@ -1246,17 +1246,25 @@ func (d *qemu) Start(stateful bool) error { return err } - // Enable extended topology information if needed. - cpuType := "host" + // Determine additional CPU flags. + cpuExtensions := []string{} - // Only x86_64 requires the use of topoext when SMT is used. if d.architecture == osarch.ARCH_64BIT_INTEL_X86 { + // x86_64 can use hv_time to improve Windows guest performance. + cpuExtensions = append(cpuExtensions, "hv_passthrough") + _, _, nrThreads, _, _, err := d.cpuTopology(d.expandedConfig["limits.cpu"]) if err != nil && nrThreads > 1 { - cpuType = "host,topoext" + // x86_64 requires the use of topoext when SMT is used. + cpuExtensions = append(cpuExtensions, "topoext") } } + cpuType := "host" + if len(cpuExtensions) > 0 { + cpuType += "," + strings.Join(cpuExtensions, ",") + } + // Start QEMU. qemuCmd := []string{ "--",
lxd/instance/qemu: Enable HyperV flags on x<I>_<I> This enables the Windows paravirtualization extensions in QEMU which makes Windows think it's running on HyperV and therefore provides a good performance improvement on Windows guests. For Linux guests, all the VirtIO bits remain active and I've confirmed that systemd-detect-virt and /proc/cpuinfo in our guests still look the same. Reported at: <URL>
lxc_lxd
train
go
1dce43980242d63ee792d9248fc33f61cf1e5e24
diff --git a/openpnm/models/physics/multiphase.py b/openpnm/models/physics/multiphase.py index <HASH>..<HASH> 100644 --- a/openpnm/models/physics/multiphase.py +++ b/openpnm/models/physics/multiphase.py @@ -104,6 +104,7 @@ def late_filling(target, pressure='pore.pressure', """ element = pressure.split('.')[0] + network = target.project.network phase = target.project.find_phase(target) pc_star = phase[Pc_star] Pc = phase[pressure] @@ -111,5 +112,11 @@ def late_filling(target, pressure='pore.pressure', Pc = sp.maximum(Pc, 1e-9) Swp = Swp_star*((pc_star/Pc)**eta) values = sp.clip(1 - Swp, 0.0, 1.0) - values = values[phase._get_indices(element=element)] + # Now map element onto target object + if element == 'throat': + Ts = network.map_throats(throats=target.Ts, origin=target) + values = values[Ts] + else: + Ps = network.map_pores(pores=target.Ps, origin=target) + values = values[Ps] return values
Fix bug in LPF model when physics doesn't span network
PMEAL_OpenPNM
train
py
648526d8f07af9e5b0e94e08776111a8ac201c26
diff --git a/core/commands/bitswap.go b/core/commands/bitswap.go index <HASH>..<HASH> 100644 --- a/core/commands/bitswap.go +++ b/core/commands/bitswap.go @@ -38,6 +38,12 @@ Print out all blocks currently on the bitswap wantlist for the local peer`, res.SetError(err, cmds.ErrNormal) return } + + if !nd.OnlineMode() { + res.SetError(errNotOnline, cmds.ErrClient) + return + } + bs, ok := nd.Exchange.(*bitswap.Bitswap) if !ok { res.SetError(u.ErrCast(), cmds.ErrNormal) @@ -78,6 +84,11 @@ var bitswapStatCmd = &cmds.Command{ return } + if !nd.OnlineMode() { + res.SetError(errNotOnline, cmds.ErrClient) + return + } + bs, ok := nd.Exchange.(*bitswap.Bitswap) if !ok { res.SetError(u.ErrCast(), cmds.ErrNormal)
make bitswap commands error out properly offline
ipfs_go-ipfs
train
go
ca18fd466794d00281e296c9de158ea369aef22d
diff --git a/tests/Kint_ObjectTest.php b/tests/Kint_ObjectTest.php index <HASH>..<HASH> 100644 --- a/tests/Kint_ObjectTest.php +++ b/tests/Kint_ObjectTest.php @@ -393,8 +393,6 @@ class Kint_ObjectTest extends PHPUnit_Framework_TestCase { $o = new Kint_Object(); - $o->name = 'Name'; - $o->name = 'name'; $o->size = 42; $o->access_path = 'access_path';
Kint_ObjectTest: Remove a dead line
kint-php_kint
train
php
81b3ec96783410e4369716449f08eb041b42efde
diff --git a/helios-services/src/main/java/com/spotify/helios/master/reaper/OldJobReaper.java b/helios-services/src/main/java/com/spotify/helios/master/reaper/OldJobReaper.java index <HASH>..<HASH> 100644 --- a/helios-services/src/main/java/com/spotify/helios/master/reaper/OldJobReaper.java +++ b/helios-services/src/main/java/com/spotify/helios/master/reaper/OldJobReaper.java @@ -104,7 +104,6 @@ public class OldJobReaper extends RateLimitedService<Job> { @Override void processItem(final Job job) { - log.info("Deciding whether to reap job {}", job.getId()); final JobId jobId = job.getId(); try { @@ -155,12 +154,12 @@ public class OldJobReaper extends RateLimitedService<Job> { } } else { // A job that's deployed should NOT BE reaped regardless of its history or creation date - log.info("NOT reaping job '{}' (it is deployed)", jobId); reap = false; } if (reap) { try { + log.info("reaping old job '{}'", job.getId()); masterModel.removeJob(jobId, job.getToken()); } catch (Exception e) { log.warn("Failed to reap old job '{}'", jobId, e);
don't log every time OldJobReaper runs rather than logging a message about what it is examining, just log if a job is being reaped. This aims to reduce noise in the logs.
spotify_helios
train
java
efd96f03d51c1fce3ef370cae88928e16f0b9f17
diff --git a/buffer/api.py b/buffer/api.py index <HASH>..<HASH> 100644 --- a/buffer/api.py +++ b/buffer/api.py @@ -1,3 +1,5 @@ +import json + from rauth import OAuth2Session BASE_URL = 'https://api.bufferapp.com/1/%s' @@ -12,4 +14,6 @@ class API(OAuth2Session): if not self.access_token: raise ValueError('Please set an access token first!') - return super(OAuth2Session, self).get(url=BASE_URL % url) + response = super(OAuth2Session, self).get(url=BASE_URL % url) + + return json.loads(response.content)
Parse the response with json
vtemian_buffpy
train
py
459d0dfb7bdfb3889b129d5cb89ca3429b941cef
diff --git a/openquake/calculators/views.py b/openquake/calculators/views.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/views.py +++ b/openquake/calculators/views.py @@ -1328,3 +1328,19 @@ def view_collapsible(token, dstore): n, u = len(df), len(df.mdvbin.unique()) out.append((sid, u, n, n / u)) return numpy.array(out, dt('site_id eff_rups num_rups cfactor')) + + [email protected]('event_based_mfd') +def view_event_based_mfd(token, dstore): + """ + Compare n_occ/eff_time with occurrence_rate + """ + oq = dstore['oqparam'] + R = len(dstore['weights']) + eff_time = oq.investigation_time * oq.ses_per_logic_tree_path * R + # print(oq.investigation_time, oq.ses_per_logic_tree_path, R, eff_time) + rup_df = dstore.read_df('ruptures', 'id') + out = [] + for mag, df in rup_df.groupby('mag'): + out.append((mag, df.n_occ.sum() / eff_time, df.occurrence_rate.sum())) + return numpy.array(out, dt('mag frequency occur_rate'))
Added view_event_based_mfd [ci skip]
gem_oq-engine
train
py
2d19dd99aa534d41a60667a14f9d8db10e6cb083
diff --git a/pipe.go b/pipe.go index <HASH>..<HASH> 100644 --- a/pipe.go +++ b/pipe.go @@ -28,13 +28,18 @@ func (p *PipeReader) Close() error { // NewPipeReader creates a new in-memory reader that reads from all loggers // The caller must call Close on the returned reader when done. +// +// By default, it: +// +// 1. Logs JSON. +// 2. Logs at the Debug level. However, unless SetLogLevel is called on a +// subsystem logger to decrease the default log level, for that subsystem, +// only error messages will be logged. func NewPipeReader(opts ...PipeReaderOption) *PipeReader { - loggerMutex.Lock() opt := pipeReaderOptions{ - format: defaultFormat, + format: JSONOutput, level: LevelDebug, } - loggerMutex.Unlock() for _, o := range opts { o.setOption(&opt)
fix: log with the JSON format by default and avoid taking a lock. This seems like the most reasonable default. We no longer need to take a lock to read the global log level, so we might as well drop the lock entirely.
ipfs_go-log
train
go
18ebacd614063048307ee8ed9c9f182adae5429a
diff --git a/public/assets/libs/indexedDB.js b/public/assets/libs/indexedDB.js index <HASH>..<HASH> 100644 --- a/public/assets/libs/indexedDB.js +++ b/public/assets/libs/indexedDB.js @@ -647,8 +647,7 @@ class Read { * Primeiro, baixa os dados da entidade, caso não tenha feito isso ainda, * atualizando a base local com os registros do back-end */ - if(!(await dbLocal.keys(this.entity)).length) - await dbRemote.syncDownload(this.entity); + await dbRemote.syncDownload(this.entity); /** * Primeiro tenta verificar se uma busca local é suficiente
await for syncDownload, because else the content not update
edineibauer_uebConfig
train
js
06e38968a1fbb0e12ae931a394d943dc48ce638a
diff --git a/tests/IDS/MonitorTest.php b/tests/IDS/MonitorTest.php index <HASH>..<HASH> 100644 --- a/tests/IDS/MonitorTest.php +++ b/tests/IDS/MonitorTest.php @@ -200,7 +200,7 @@ class IDS_MonitorTest extends PHPUnit_Framework_TestCase { $exploits = array(); $exploits[] = '<![test'; $exploits[] = 'test/**/blafasel'; - $exploits[] = 'test#'; + $exploits[] = 'OR 1#'; $exploits[] = '<!-- test -->'; $this->_testForPlainEvent($exploits);
fixed the CI (forgot to commit the monitor test)
PHPIDS_PHPIDS
train
php
1dbba68858d04ea579e9538143d4ac6ef48f8162
diff --git a/lib/puppet/pops/merge_strategy.rb b/lib/puppet/pops/merge_strategy.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/pops/merge_strategy.rb +++ b/lib/puppet/pops/merge_strategy.rb @@ -123,7 +123,7 @@ module Puppet::Pops result end - # Converts a single value to the type expeced when peforming a merge of two elements + # Converts a single value to the type expected when merging two elements # @param value [Object] the value to convert # @return [Object] the converted value def convert_value(value)
(maint) Spell-check merge_strategy.rb.
puppetlabs_puppet
train
rb
008231c2fd25b659b06ddb4af5161acb486037a3
diff --git a/quantecon/mc_tools.py b/quantecon/mc_tools.py index <HASH>..<HASH> 100644 --- a/quantecon/mc_tools.py +++ b/quantecon/mc_tools.py @@ -343,10 +343,6 @@ mc_sample_path.__doc__ = _sample_path_docstr.format(p_arg=""" P : array_like(float, ndim=2) A Markov transition matrix. """) -mc_sample_path_numpy.__doc__ = _sample_path_docstr.format(p_arg=""" -P : array_like(float, ndim=2) - A Markov transition matrix. -""") # -Methods- #
`mc_sample_path_numpy.__doc__` deleted
QuantEcon_QuantEcon.py
train
py
5c2e822653c553563f0f7637b9517b53b1bab8c3
diff --git a/lib/carrierwave/mongoid/version.rb b/lib/carrierwave/mongoid/version.rb index <HASH>..<HASH> 100644 --- a/lib/carrierwave/mongoid/version.rb +++ b/lib/carrierwave/mongoid/version.rb @@ -1,5 +1,5 @@ module Carrierwave module Mongoid - VERSION = "0.7.1" + VERSION = "0.8.0" end end
Bumped version to <I>
carrierwaveuploader_carrierwave-mongoid
train
rb
e22e1c194234dc77917df3f3452900024511dc53
diff --git a/router/router_drain_test.go b/router/router_drain_test.go index <HASH>..<HASH> 100644 --- a/router/router_drain_test.go +++ b/router/router_drain_test.go @@ -108,12 +108,16 @@ var _ = Describe("Router", func() { signals := make(chan os.Signal, 1) readyChan := make(chan struct{}, 1) closeChannel := make(chan struct{}, 1) + errChannel := make(chan error, 1) go func() { - r.Run(signals, readyChan) - close(closeChannel) + defer close(closeChannel) + defer close(errChannel) + errChannel <- r.Run(signals, readyChan) }() select { case <-readyChan: + case err := <-errChannel: + Expect(err).ToNot(HaveOccurred()) } return signals, closeChannel }
Propagate error from goroutine - If an error happened in the goroutine, Ginkgo would swallow it. We tried adding `defer GinkgoRecover()` to the function but it would continue the execution of the test till its end before reporting the error. This way, the test fails as soon as the error is reported.
cloudfoundry_gorouter
train
go
84a1bea9723e213be12a410eceec4c977dc9947a
diff --git a/lib/blocklib.php b/lib/blocklib.php index <HASH>..<HASH> 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -1655,6 +1655,18 @@ function plugin_pagetypelist($pagetype, $parentcontext = null, $currentcontext = } /** + * Generates the page type list for the my moodle page + * + * @param string $pagetype + * @param stdClass $parentcontext + * @param stdClass $currentcontext + * @return array + */ +function my_pagetypelist($pagetype, $parentcontext = null, $currentcontext = null) { + return array('my-index' => 'my-index'); +} + +/** * Generates the page type list for a module by either locating and using the modules callback * or by generating a default list. *
MDL-<I> blocks: readded the my moodle page's page type list generator function
moodle_moodle
train
php
457db2eb25be019a7991d69480396cac111832aa
diff --git a/test/rename.spec.js b/test/rename.spec.js index <HASH>..<HASH> 100644 --- a/test/rename.spec.js +++ b/test/rename.spec.js @@ -186,6 +186,13 @@ describe('gulp-rename', function () { var file1; var file2; + function check() { + file1.path.should.equal(Path.resolve('test/fixtures/hello-1.txt')); + file2.path.should.equal(Path.resolve('test/fixtures/hello-2.txt')); + + return done(); + } + pipe1 .on('data', function (file) { file1 = file; @@ -209,13 +216,6 @@ describe('gulp-rename', function () { return check(); } }); - - function check() { - file1.path.should.equal(Path.resolve('test/fixtures/hello-1.txt')); - file2.path.should.equal(Path.resolve('test/fixtures/hello-2.txt')); - - return done(); - } }); });
Fix code style error 'check' was used before it was defined.
hparra_gulp-rename
train
js
182104add0ec59a51d4ce38af44df1757818b082
diff --git a/livvkit/util/functions.py b/livvkit/util/functions.py index <HASH>..<HASH> 100644 --- a/livvkit/util/functions.py +++ b/livvkit/util/functions.py @@ -37,6 +37,8 @@ import shutil import fnmatch from datetime import datetime +import json_tricks + import livvkit @@ -155,7 +157,7 @@ def write_json(data, path, file_name): elif not os.path.exists(path): mkdir_p(path) with open(os.path.join(path, file_name), 'w') as f: - json.dump(data, f, indent=4) + json_tricks.np.dump(data, f, indent=4, primitives=True) def collect_cases(data_dir):
Use the json_tricks package to handle serialize numpy data Numpy arrays cannot normally be serialized using the stdlib json pacakge, but the json_tricks package allows numpy arrays to be serialized as standard python lists.
LIVVkit_LIVVkit
train
py
6cee04fbdaec5a57918f87680bc267f0c5fd71ab
diff --git a/src/FarhanWazir/GoogleMaps/GMaps.php b/src/FarhanWazir/GoogleMaps/GMaps.php index <HASH>..<HASH> 100644 --- a/src/FarhanWazir/GoogleMaps/GMaps.php +++ b/src/FarhanWazir/GoogleMaps/GMaps.php @@ -1138,7 +1138,7 @@ class GMaps if ($this->cluster) { $this->output_js .= ' - <script type="text/javascript" src="https://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer_compiled.js"></script > + <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/js-marker-clusterer/1.0.0/markerclusterer.js"></script > '; } }
Fixed MarkerCluster not defined Fixed by change url from <URL>
farhanwazir_laravelgooglemaps
train
php
66c344de38facc16be553e48ff65d93a904c0e12
diff --git a/Tone/signal/Multiply.js b/Tone/signal/Multiply.js index <HASH>..<HASH> 100644 --- a/Tone/signal/Multiply.js +++ b/Tone/signal/Multiply.js @@ -1,4 +1,4 @@ -define(["Tone/core/Tone", "Tone/signal/Signal"], function(Tone){ +define(["Tone/core/Tone", "Tone/signal/Signal", "Tone/core/Gain"], function(Tone){ "use strict"; @@ -33,7 +33,7 @@ define(["Tone/core/Tone", "Tone/signal/Signal"], function(Tone){ * @type {GainNode} * @private */ - this._mult = this.input[0] = this.output = this.context.createGain(); + this._mult = this.input[0] = this.output = new Tone.Gain(); /** * the scaling parameter
using Tone.Gain for Multiply
Tonejs_Tone.js
train
js
3ff3417a72e310fd18dfce2bbf420d127618daa0
diff --git a/gulptasks/gulpfile.js b/gulptasks/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulptasks/gulpfile.js +++ b/gulptasks/gulpfile.js @@ -131,7 +131,15 @@ gulp.task("jison", () => { const dest = "build/dist/lib/salve/datatypes"; return gulp.src("lib/salve/datatypes/regexp.jison") .pipe(newer(`${dest}/regexp.js`)) - .pipe(jison({ moduleType: "commonjs" })) + .pipe(jison({ + moduleType: "commonjs", + // Override the default main created by Jison. This module cannot ever be + // used as a main script. And the default that Jison uses does + // `require("fs")` which causes problems. + moduleMain: () => { + throw new Error("this module cannot be used as main"); + }, + })) .pipe(gulp.dest(dest)); });
Override the main module for regex.js. This is useful because if the module is then built with browserify or webpack, the call to `require("fs")` that is in the default code may cause problems. We override with something that throws immediately if the module is used at all.
mangalam-research_salve
train
js
05cad1f8d141b27cd67f2cb22e2ec573da0cda3b
diff --git a/lib/websocket_rails/dispatcher.rb b/lib/websocket_rails/dispatcher.rb index <HASH>..<HASH> 100644 --- a/lib/websocket_rails/dispatcher.rb +++ b/lib/websocket_rails/dispatcher.rb @@ -74,7 +74,7 @@ module WebsocketRails :full_messages => ex.record.errors.full_messages } else - ex.to_json if ex.respond_to?(:to_json) + ex if ex.respond_to?(:to_json) end end
Don't convert exception data to json before triggering event. The Dispatcher#extract_exception_data method was performing the JSON conversion prematurely. It only needs to test that the exception can be converted to JSON, not actually perform the encoding.
websocket-rails_websocket-rails
train
rb
1a679746a3f3f6ed74b192f1422bf5433c880b50
diff --git a/tests/Essence/EssenceTest.php b/tests/Essence/EssenceTest.php index <HASH>..<HASH> 100644 --- a/tests/Essence/EssenceTest.php +++ b/tests/Essence/EssenceTest.php @@ -70,7 +70,7 @@ class EssenceTest extends \TestCase */ public function it_validates_the_assertion() { - $builder = \Mockery::mock("Essence\AssertionBuilder"); + $builder = $this->mockAssertionBuilder(); $builder->shouldReceive("validate")->once()->andReturn(false); $builder->shouldReceive("getMessage")->once()->andReturn("foobar"); @@ -87,7 +87,7 @@ class EssenceTest extends \TestCase */ public function it_redirects_calls() { - $builder = \Mockery::mock("Essence\AssertionBuilder"); + $builder = $this->mockAssertionBuilder(); $builder->shouldReceive("foo")->twice(); @@ -96,4 +96,9 @@ class EssenceTest extends \TestCase $this->subject->foo(); $this->subject->foo; } + + protected function mockAssertionBuilder() + { + return \Mockery::mock("Essence\AssertionBuilder"); + } }
Refactor in mockAssertionBuilder
bound1ess_essence
train
php
4a5f72e0895790966739ef020ba0e647dec97dad
diff --git a/src/ufoLib2/objects/misc.py b/src/ufoLib2/objects/misc.py index <HASH>..<HASH> 100644 --- a/src/ufoLib2/objects/misc.py +++ b/src/ufoLib2/objects/misc.py @@ -60,6 +60,15 @@ class DataStore(MutableMapping): del self._data[fileName] self._scheduledForDeletion.add(fileName) + def __repr__(self): + n = len(self._data) + return "<{}.{} ({}) at {}>".format( + self.__class__.__module__, + self.__class__.__name__, + "empty" if n == 0 else "{} file{}".format(n, "s" if n > 1 else ""), + hex(id(self)), + ) + def write(self, writer, saveAs=None): if saveAs is None: saveAs = self._reader is not writer
DataStore: added custom __repr__ for DataSet and ImageSet
fonttools_ufoLib2
train
py
d14b7ed964486ca1b2440eaf9f7bd130fa40c26d
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ setup( packages=find_packages(exclude=['test*']), include_package_data=True, license=behave_django.__license__, - description=behave_django.__doc__, + description=behave_django.__doc__.strip(), long_description=read_file('README.rst'), url='https://github.com/behave/behave-django', author='Mitchel Cabuloy',
Avoid packaging issue (potential LF in description)
behave_behave-django
train
py
058a766417fcbc1e7ac3bcf16bdd420cad51c53a
diff --git a/registration/forms.py b/registration/forms.py index <HASH>..<HASH> 100644 --- a/registration/forms.py +++ b/registration/forms.py @@ -29,7 +29,7 @@ class RegistrationForm(forms.Form): registration backend. """ - username = forms.RegexField(regex=r'^\w+$', + username = forms.RegexField(regex=r'^[\w.@+-]+$', max_length=30, widget=forms.TextInput(attrs=attrs_dict), label=_("Username"),
Fix #<I>: Use the same username regex as django.contrib.auth.
ubernostrum_django-registration
train
py
06d9c12c169b09ce473630f1205004231a423071
diff --git a/packages/react/src/components/DataTable/TableToolbarSearch.js b/packages/react/src/components/DataTable/TableToolbarSearch.js index <HASH>..<HASH> 100644 --- a/packages/react/src/components/DataTable/TableToolbarSearch.js +++ b/packages/react/src/components/DataTable/TableToolbarSearch.js @@ -80,7 +80,7 @@ const TableToolbarSearch = ({ const handleExpand = (event, value = !expanded) => { if (!controlled && (!persistent || (!persistent && !persistant))) { setExpandedState(value); - if (value) { + if (value && !expanded) { setFocusTarget(searchRef); } }
fix(TableToolbarSearch): fix focus management (#<I>) This change checks if there was actual change in the expanded state of `<TableToolbarSearch>`, to set the focus upon expanding. Fixes #<I>.
carbon-design-system_carbon-components
train
js
dc66cc3268f9773d079a395242f6509a8ab3bc6c
diff --git a/tests/settings.py b/tests/settings.py index <HASH>..<HASH> 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -15,6 +15,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'sundial', 'tests.test_fields', + 'tests.test_forms', ] SILENCED_SYSTEM_CHECKS = ['1_7.W001']
Fixed a deprecation warning by making sure a test app is installed.
charettes_django-sundial
train
py
3f2aa9a059878ae95f0a01971fbb515c3a1afc5e
diff --git a/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java b/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java index <HASH>..<HASH> 100644 --- a/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java +++ b/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java @@ -539,10 +539,7 @@ class XmlNode implements Serializable { } void replaceWith(XmlNode other) { - Node replacement = other.dom; - if (replacement.getOwnerDocument() != this.dom.getOwnerDocument()) { - replacement = this.dom.getOwnerDocument().importNode(replacement, true); - } + Node replacement = this.dom.getOwnerDocument().importNode(other.dom, true); this.dom.getParentNode().replaceChild(replacement, this.dom); }
Implement change from gh-<I> to fix XMLList assignment
mozilla_rhino
train
java
d6ce6f31e8993475322ab8aef2b26471e53e6332
diff --git a/test/test-openssh.js b/test/test-openssh.js index <HASH>..<HASH> 100644 --- a/test/test-openssh.js +++ b/test/test-openssh.js @@ -178,9 +178,11 @@ const serverCfg = { hostKeys: [ fixture('ssh_host_rsa_key') ] }; `Wrong info: ${inspect(info)}` ); - accept().on('close', mustCall(() => { + const stream = accept(); + stream.on('close', mustCall(() => { client.end(); })).end(response); + stream.resume(); })); })); }));
test: fix OpenSSH test timing out
mscdex_ssh2
train
js
da4a5654763165c7b7a83c97f4ca3f7564094eb1
diff --git a/src/main/java/com/hp/autonomy/hod/client/api/authentication/ApiKey.java b/src/main/java/com/hp/autonomy/hod/client/api/authentication/ApiKey.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/hp/autonomy/hod/client/api/authentication/ApiKey.java +++ b/src/main/java/com/hp/autonomy/hod/client/api/authentication/ApiKey.java @@ -5,6 +5,7 @@ package com.hp.autonomy.hod.client.api.authentication; +import com.fasterxml.jackson.annotation.JsonCreator; import lombok.Data; /** @@ -18,6 +19,11 @@ public class ApiKey { */ private final String apiKey; + @JsonCreator + public ApiKey(final String apiKey) { + this.apiKey = apiKey; + } + @Override public String toString() { return apiKey;
Add explicit @JsonCreator to ApiKey constructor since the latest version of jackson has a bug (not seen it reported yet) which causes it not to find the constructor without the explicit declaration [rev. matthew.gordon]
microfocus-idol_java-hod-client
train
java
76d9b43c3e16e825ca7d23337ff16edf0b2468ed
diff --git a/presto-main/src/main/java/com/facebook/presto/execution/SqlTaskExecution.java b/presto-main/src/main/java/com/facebook/presto/execution/SqlTaskExecution.java index <HASH>..<HASH> 100644 --- a/presto-main/src/main/java/com/facebook/presto/execution/SqlTaskExecution.java +++ b/presto-main/src/main/java/com/facebook/presto/execution/SqlTaskExecution.java @@ -588,7 +588,13 @@ public class SqlTaskExecution @Override public synchronized void initialize() { - driver = driverSupplier.apply(driverContext); + try { + driver = driverSupplier.apply(driverContext); + } + catch (Throwable e) { + driverContext.failed(e); + throw e; + } } @Override
If Driver creation fails, fail the query
prestodb_presto
train
java
f91e0181662e741b9adf1676bde3c316ea404109
diff --git a/artist/multi_plot.py b/artist/multi_plot.py index <HASH>..<HASH> 100644 --- a/artist/multi_plot.py +++ b/artist/multi_plot.py @@ -239,7 +239,8 @@ class MultiPlot: return pdf_path def _crop_document(self, path): - output_path = 'crop-output.pdf' + dirname = os.path.dirname(path) + output_path = os.path.join(dirname, 'crop-output.pdf') try: subprocess.check_output(['pdfcrop', path, output_path], stderr=subprocess.STDOUT) diff --git a/artist/plot.py b/artist/plot.py index <HASH>..<HASH> 100644 --- a/artist/plot.py +++ b/artist/plot.py @@ -241,7 +241,8 @@ class Plot: return pdf_path def _crop_document(self, path): - output_path = 'crop-output.pdf' + dirname = os.path.dirname(path) + output_path = os.path.join(dirname, 'crop-output.pdf') try: subprocess.check_output(['pdfcrop', path, output_path], stderr=subprocess.STDOUT)
Fix: keep cropped output in builddir
davidfokkema_artist
train
py,py
a3b04909ace912794e82ed91756db83a97514749
diff --git a/test/integration/wdio.sauce-conf.js b/test/integration/wdio.sauce-conf.js index <HASH>..<HASH> 100644 --- a/test/integration/wdio.sauce-conf.js +++ b/test/integration/wdio.sauce-conf.js @@ -99,5 +99,11 @@ exports.config = { sauceConnect: true, sauceConnectOpts: { tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER || null, + verbose: true, + verboseDebugging: true, + logger: function logger(message) { + // encode JWT access key + console.log(message.replace(/-k\s[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?/, '-k XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX')); + } }, }
make sauce connect more verbose (#<I>)
zinserjan_wdio-screenshot
train
js
34eaad2e29c5c33eb33ab9230dc16cc96b3f44c6
diff --git a/public/js/admin/content-manager2.js b/public/js/admin/content-manager2.js index <HASH>..<HASH> 100644 --- a/public/js/admin/content-manager2.js +++ b/public/js/admin/content-manager2.js @@ -160,11 +160,13 @@ function RcmEdit(config) { 'name="saveData" value="" />').val(dataToSend); var form = $('<form method="post" action="/rcm-admin-save/' + - this.page+'/'+this.language+'/'+this.pageRevision+'" name="rcmDataForm" id="rcmDataForm">').append(input); + this.page+'/'+this.language+'/'+this.pageRevision+'" name="rcmDataForm" id="rcmDataForm"></form>').append(input); $("body").append(form); $("#rcmDataForm").submit(); + + alert('save submitted'); }; /**
More IE7 Fixes. Save now works in IE7
reliv_Rcm
train
js
696a08aed9139fad45341a3a2de69579fad0a853
diff --git a/Solr.php b/Solr.php index <HASH>..<HASH> 100644 --- a/Solr.php +++ b/Solr.php @@ -72,6 +72,9 @@ class Solr return $this->entityMapper; } + /** + * @param EntityMapper $mapper + */ public function setMapper($mapper) { $this->entityMapper = $mapper;
add missing doc-block for entitymapper-setter
floriansemm_SolrBundle
train
php
31c58e88cbee2f651be1b5fa656736d57fef7b56
diff --git a/main.js b/main.js index <HASH>..<HASH> 100755 --- a/main.js +++ b/main.js @@ -9,9 +9,8 @@ var define = require('u-proto/define'), target = Symbol(), emitter = Symbol(), current = Symbol(), - deferrer = Yielded.deferrer, - bag,call; + bag; // Emitter @@ -193,15 +192,10 @@ function* strings(it){ for(var v of it) if(typeof v == 'string') yield v; } -call = walk.wrap(function*(args,listener,tg){ - var e = args[0]; - - try{ - if(e && e[deferrer]) args[0] = yield e; - walk(listener,args,tg); - }catch(e){ } - -}); +function call(args,listener,tg){ + try{ walk(listener,args,tg); } + catch(e){ } +} // -- on
'deferrer' removed
manvalls_y-emitter
train
js
8c0515337ff1a60a727ceb4e56da216d7c2d4917
diff --git a/scripts/bundle.js b/scripts/bundle.js index <HASH>..<HASH> 100755 --- a/scripts/bundle.js +++ b/scripts/bundle.js @@ -115,6 +115,19 @@ async function build(packagePath) { await fs.remove(join(cwd, distDir)); // move bob/<project-name> to <project>/dist await fs.move(bobProjectDir, join(cwd, distDir)); + + // move README.md and LICENSE + await copyToDist(cwd, ['README.md', 'LICENSE']); +} + +function copyToDist(cwd, files) { + return Promise.all( + files.map(async file => { + if (await fs.exists(join(cwd, file))) { + await fs.copyFile(join(cwd, file), join(cwd, distDir, file)); + } + }) + ); } async function main() {
Copy README.md and LICENSE to dist (#<I>)
dotansimha_graphql-code-generator
train
js
3f70cc77a773fc89239635dfd7756f28e664beb1
diff --git a/test/test_supervisor.rb b/test/test_supervisor.rb index <HASH>..<HASH> 100644 --- a/test/test_supervisor.rb +++ b/test/test_supervisor.rb @@ -522,6 +522,7 @@ class SupervisorTest < ::Test::Unit::TestCase begin ENV.delete('SERVERENGINE_SOCKETMANAGER_PATH') server.before_run + sleep 0.1 if Fluent.windows? # Wait for starting windows event thread assert_not_nil(ENV['SERVERENGINE_SOCKETMANAGER_PATH']) ensure server.after_run @@ -539,6 +540,7 @@ class SupervisorTest < ::Test::Unit::TestCase begin ENV.delete('SERVERENGINE_SOCKETMANAGER_PATH') server.before_run + sleep 0.1 if Fluent.windows? # Wait for starting windows event thread assert_nil(ENV['SERVERENGINE_SOCKETMANAGER_PATH']) ensure server.after_run
Fix testing disable_shared_socket on Windows Should wait starting event thread before calling after_run.
fluent_fluentd
train
rb