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
203a5f0075c4377bfee6006af77dcdd14f3da6aa
diff --git a/lib/vagrant/util/platform.rb b/lib/vagrant/util/platform.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant/util/platform.rb +++ b/lib/vagrant/util/platform.rb @@ -554,6 +554,7 @@ module Vagrant # Get list of local mount paths that are DrvFs file systems # # @return [Array<String>] + # @todo(chrisroberts): Constantize types for check def wsl_drvfs_mounts if !defined?(@_wsl_drvfs_mounts) @_wsl_drvfs_mounts = [] @@ -561,7 +562,7 @@ module Vagrant result = Util::Subprocess.execute("mount") result.stdout.each_line do |line| info = line.match(MOUNT_PATTERN) - if info && info[:type] == "drvfs" + if info && (info[:type] == "drvfs" || info[:type] == "9p") @_wsl_drvfs_mounts << info[:mount] end end
Update filesystem type match for WSL2 Fixes shared folder on WSL2 based on #<I>
hashicorp_vagrant
train
rb
cbd689f106d41e9856c0644d4f4e16d5507a67ae
diff --git a/tests/pytests/scenarios/compat/test_with_versions.py b/tests/pytests/scenarios/compat/test_with_versions.py index <HASH>..<HASH> 100644 --- a/tests/pytests/scenarios/compat/test_with_versions.py +++ b/tests/pytests/scenarios/compat/test_with_versions.py @@ -43,7 +43,7 @@ def _get_test_versions_ids(value): @pytest.fixture( - params=("3002.8", "3003.3", "3004"), ids=_get_test_versions_ids, scope="module" + params=("3002.7", "3003.3", "3004"), ids=_get_test_versions_ids, scope="module" ) def compat_salt_version(request): return request.param
Needs to be <I>
saltstack_salt
train
py
25b4c3c2cd2cd55b5cd74312099599100a5f31da
diff --git a/src/input/device.js b/src/input/device.js index <HASH>..<HASH> 100644 --- a/src/input/device.js +++ b/src/input/device.js @@ -19,15 +19,15 @@ /** * Device Orientation. Stores angle in degrees for each axis. - * properties : tiltLeftRight, tiltFrontBack, direction + * properties : gamma, beta, alpha * @public * @name orientation * @memberOf me.device */ obj.orientation = { - tiltLeftRight: 0, - tiltFrontBack: 0, - direction: 0 + gamma: 0, + beta: 0, + alpha: 0 }; /**
renamed properties to match that of the browser API.
melonjs_melonJS
train
js
05cc5d063918d0305e6e5ceb96f437b5502a2fd9
diff --git a/nosedjango/nosedjango.py b/nosedjango/nosedjango.py index <HASH>..<HASH> 100644 --- a/nosedjango/nosedjango.py +++ b/nosedjango/nosedjango.py @@ -167,16 +167,6 @@ class NoseDjango(Plugin): # short circuit if no settings file can be found return - # This is a distinctive difference between the NoseDjango - # test runner compared to the plain Django test runner. - # Django uses the standard unittest framework and resets the - # database between each test *suite*. That usually resolves - # into a test module. - # - # The NoseDjango test runner will reset the database between *every* - # test case. This is more in the spirit of unittesting where there is - # no state information passed between individual tests. - from django.core.management import call_command from django.core.urlresolvers import clear_url_caches from django.conf import settings
Remove a false comment (thanks to Karen Tracey)
nosedjango_nosedjango
train
py
cd2a77a95b0fbe23f5bf1d3be9c525fc0ba74cbc
diff --git a/plugins/inputs/net_response/net_response.go b/plugins/inputs/net_response/net_response.go index <HASH>..<HASH> 100644 --- a/plugins/inputs/net_response/net_response.go +++ b/plugins/inputs/net_response/net_response.go @@ -223,9 +223,6 @@ func (n *NetResponse) Gather(acc telegraf.Accumulator) error { } else { return errors.New("Bad protocol") } - for key, value := range returnTags { - tags[key] = value - } // Merge the tags for k, v := range returnTags { tags[k] = v
Remove duplicate loop in net_response plugin (#<I>)
influxdata_telegraf
train
go
b1c11d807925572661d1946cf4580b11ef147dcb
diff --git a/test/basic/points.js b/test/basic/points.js index <HASH>..<HASH> 100644 --- a/test/basic/points.js +++ b/test/basic/points.js @@ -116,6 +116,9 @@ describe( 'Point', () => { assert.equal(point.collide, false); }); + it('should have order 0 by default', () => { + assert.equal(point.order, 0); + }); });
Add test checking the existence of order field
CartoDB_tangram-cartocss
train
js
9f248776cc31bdd8c357ea34753d4256ae2ba652
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -54,11 +54,6 @@ class CompileContracts(Command): # This is a workaround to stop a possibly existing invalid # precompiled `contracts.json` from preventing us from compiling a new one os.environ['_RAIDEN_CONTRACT_MANAGER_SKIP_PRECOMPILED'] = '1' - from raiden_contracts.contract_manager import ( - ContractManager, - CONTRACTS_PRECOMPILED_PATH, - CONTRACTS_SOURCE_DIRS, - ) try: from solc import compile_files # noqa @@ -66,6 +61,12 @@ class CompileContracts(Command): print('py-solc is not installed, skipping contracts compilation') return + from raiden_contracts.contract_manager import ( + ContractManager, + CONTRACTS_PRECOMPILED_PATH, + CONTRACTS_SOURCE_DIRS, + ) + try: contract_manager = ContractManager(CONTRACTS_SOURCE_DIRS) contract_manager.store_compiled_contracts(CONTRACTS_PRECOMPILED_PATH)
Skip contract compilation if solc is unavailable
raiden-network_raiden-contracts
train
py
b597bf4bfd11e751dddad5e6d38dc8e1ebbeedd2
diff --git a/test/common/http_admin.py b/test/common/http_admin.py index <HASH>..<HASH> 100644 --- a/test/common/http_admin.py +++ b/test/common/http_admin.py @@ -427,7 +427,7 @@ class ClusterAccess(object): def add_namespace(self, protocol = "memcached", name = None, port = None, primary = None, affinities = { }, check = True): if port is None: - port = random.randint(20000, 60000) + port = random.randint(10000, 20000) if name is None: name = str(random.randint(0, 1000000)) if primary is not None:
Use low port numbers for randomly-generated namespaces to avoid overflowing a <I>-bit int when added with port_offset.
rethinkdb_rethinkdb
train
py
cf06dca5ed05bb3e8e095a3c4667f91f2802a8ad
diff --git a/arcrest/gptypes.py b/arcrest/gptypes.py index <HASH>..<HASH> 100644 --- a/arcrest/gptypes.py +++ b/arcrest/gptypes.py @@ -29,7 +29,7 @@ class GPMultiValue(object): return cls @property def _json_struct(self): - return [x._json_struct for x in self._values] + return [getattr(x, '_json_struct', x) for x in self._values] @classmethod def fromJson(cls, val): return cls(val)
Allow bare values in multivalue (such as float)
jasonbot_arcrest
train
py
8eca1eaf7ecba7131e0525b7ae43f6678653f956
diff --git a/src/main/java/hu/kazocsaba/imageviewer/ImageComponent.java b/src/main/java/hu/kazocsaba/imageviewer/ImageComponent.java index <HASH>..<HASH> 100644 --- a/src/main/java/hu/kazocsaba/imageviewer/ImageComponent.java +++ b/src/main/java/hu/kazocsaba/imageviewer/ImageComponent.java @@ -467,7 +467,12 @@ class ImageComponent extends JComponent { * changed where the cursor is relative to the image. */ private void correctionalFire() { - handleMouseAt(ImageComponent.this.getMousePosition(), null); + /** + * We use our parent, LayeredImageView, to locate the mouse. If the viewer has an overlay, then + * ImageComponent.getMousePosition will return null because the mouse is over the overlay and not the image + * component. + */ + handleMouseAt(getParent().getMousePosition(true), null); } private void fireMouseAtPixel(int x, int y, MouseEvent ev) {
Fix synthetic mouse events when image has overlay. Due to the presence of the overlay, the code used to think that the mouse exited the component because getMousePosition returned null for the image component. (The overlay basically covered up the image.) Now we use the parent container (which contains the image and all the overlays) to find the mouse cursor.
kazocsaba_imageviewer
train
java
025d5f88381d8019817b72b588fe55647f710235
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,14 @@ #!/usr/bin/env python import os -from setuptools import setup, find_packages +from setuptools import setup # allow setup.py to be ran from anywhere os.chdir(os.path.dirname(os.path.abspath(__file__))) setup( name='diay', - version='0.1.1', + version='0.1.2', license='MIT', description='diay - a dependency injection library', long_description=open('README.md').read(), @@ -16,7 +16,8 @@ setup( author='Andreas Lutro', author_email='[email protected]', url='https://github.com/anlutro/diay.py', - packages=find_packages(include=('diay', 'diay.*')), + # packages does not work for single file modules + py_modules=['diay'], classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers',
have to use py_modules for single file modules
anlutro_diay.py
train
py
24add2d3932e1d03123f0e1d699a44c0b23b839c
diff --git a/src/scripts/chartist-plugin-axistitle.js b/src/scripts/chartist-plugin-axistitle.js index <HASH>..<HASH> 100644 --- a/src/scripts/chartist-plugin-axistitle.js +++ b/src/scripts/chartist-plugin-axistitle.js @@ -56,17 +56,18 @@ ); } - var xPos; - var yPos; - var title; + var xPos, + yPos, + title, + chartPadding = Chartist.normalizePadding(data.options.chartPadding); // normalize the padding in case the full padding object was not passed into the options //position axis X title if (options.axisX.axisTitle && data.axisX) { xPos = (data.axisX.axisLength / 2) + data.options.axisY.offset + - data.options.chartPadding.left; + chartPadding.left; - yPos = data.options.chartPadding.top; + yPos = chartPadding.top; if (data.options.axisY.position === 'end') { xPos -= data.options.axisY.offset; @@ -94,7 +95,7 @@ xPos = 0; - yPos = (data.axisY.axisLength / 2) + data.options.chartPadding + yPos = (data.axisY.axisLength / 2) + chartPadding .top; if (data.options.axisX.position === 'start') {
Normalize the padding This changeset normalizes the chart padding before trying to access the object's properties since it is possible to pass in an integer and not an object as the padding option.
alexstanbury_chartist-plugin-axistitle
train
js
85ae73d98ed31ead1a9d123c30c9dcb4fa72212f
diff --git a/src/java/org/apache/cassandra/tools/NodeCmd.java b/src/java/org/apache/cassandra/tools/NodeCmd.java index <HASH>..<HASH> 100644 --- a/src/java/org/apache/cassandra/tools/NodeCmd.java +++ b/src/java/org/apache/cassandra/tools/NodeCmd.java @@ -445,6 +445,7 @@ public class NodeCmd outs.println("\t\tSSTable count: " + cfstore.getLiveSSTableCount()); outs.println("\t\tSpace used (live): " + cfstore.getLiveDiskSpaceUsed()); outs.println("\t\tSpace used (total): " + cfstore.getTotalDiskSpaceUsed()); + outs.println("\t\tNumber of Keys (estimate): " + cfstore.estimateKeys()); outs.println("\t\tMemtable Columns Count: " + cfstore.getMemtableColumnsCount()); outs.println("\t\tMemtable Data Size: " + cfstore.getMemtableDataSize()); outs.println("\t\tMemtable Switch Count: " + cfstore.getMemtableSwitchCount());
Add CFS.estimatedKeys to cfstats output. Patch by Joe Stein, reviewed by brandonwilliams for CASSANDRA-<I> git-svn-id: <URL>
Stratio_stratio-cassandra
train
java
a017d01fee4fac0da855f42c1c835bdfaec897ea
diff --git a/lib/vanity/autoconnect.rb b/lib/vanity/autoconnect.rb index <HASH>..<HASH> 100644 --- a/lib/vanity/autoconnect.rb +++ b/lib/vanity/autoconnect.rb @@ -24,6 +24,7 @@ module Vanity 'db:seed', 'db:setup', 'db:structure:dump', + 'db:test:load', 'db:version', 'doc:app', 'log:clear',
Include `db:test:load` in list of blacklisted autoconnect rake tasks. This is deprecated as of Rails <I>, but may still be used (especially by rails 3 projects).
assaf_vanity
train
rb
138b2a428927991f65c31ac03285a8f999e793d6
diff --git a/pkg/engine/plan.go b/pkg/engine/plan.go index <HASH>..<HASH> 100644 --- a/pkg/engine/plan.go +++ b/pkg/engine/plan.go @@ -245,10 +245,8 @@ func stepParentIndent(b *bytes.Buffer, step deploy.Step, // least, it would be ideal to preserve the indentation. break } - if print && !shown[p] { - // If the parent isn't yet shown, print it now as a summary. - printStep(b, par, seen, shown, true, planning, indent, debug) - } + + contract.Assert(shown[p]) indent++ p = par.Res().Parent }
Replace possible dead code with an assert I believe because of the way we have structured the code, it is impossible to know a resource's parent but not printed it. I've changed the test which would print the parent resource to an assert that ensure we have printed it. The next commit is going to remove the shown array because we no longer need it, but this commit is here so that if there are display bugs as part of the larger refactoring in how we display events, we can bisect back and see this failure.
pulumi_pulumi
train
go
00c9c91ba2b46745a1b2d2278aff088568f3c455
diff --git a/src/javascript/file/FileDrop.js b/src/javascript/file/FileDrop.js index <HASH>..<HASH> 100644 --- a/src/javascript/file/FileDrop.js +++ b/src/javascript/file/FileDrop.js @@ -83,7 +83,7 @@ define('moxie/file/FileDrop', [ }); }, 999); - runtime.exec.call(self, 'FileDrop', 'init'); + runtime.exec.call(self, 'FileDrop', 'init', options); self.dispatchEvent('ready'); }); diff --git a/src/javascript/runtime/html5/file/FileDrop.js b/src/javascript/runtime/html5/file/FileDrop.js index <HASH>..<HASH> 100644 --- a/src/javascript/runtime/html5/file/FileDrop.js +++ b/src/javascript/runtime/html5/file/FileDrop.js @@ -21,8 +21,7 @@ define("moxie/runtime/html5/file/FileInput", [ var _files = []; Basic.extend(this, { - init: function() { - // TODO: Options comes from where?? + init: function(options) { var comp = this, I = this.getRuntime(), dropZone = options.container; // Safari on Windows has drag/drop problems, so we fake it by moving a input type file
FileDrop: Pass options to runtime extensions in init().
moxiecode_moxie
train
js,js
f27b09f02486e22f4180dc9c7a717f8e307a5ff6
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,3 @@ -// const bboxPolygon = require('@turf/bbox-polygon') -// const explode = require('@turf/explode') -// const inside = require('@turf/inside') const turfBBox = require('@turf/bbox') const {hash, range, lngLatToTile} = require('global-mercator') const {featureEach} = require('@turf/meta') diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -96,5 +96,7 @@ describe('slippy-grid', () => { test('fiji', () => { const tiles = slippyGrid.all(FIJI, 2, 2) expect(tiles).toEqual([[3, 1, 2], [0, 1, 2]]) + const count = slippyGrid.count(FIJI, 0, 10) + expect(count).toEqual(486) }) })
hopefully fix slippy-grid
DenisCarriere_slippy-grid
train
js,js
94c76f6a5a90d3ea1fa263ab82110a34b2c6c150
diff --git a/lxd/storage/utils.go b/lxd/storage/utils.go index <HASH>..<HASH> 100644 --- a/lxd/storage/utils.go +++ b/lxd/storage/utils.go @@ -526,7 +526,7 @@ var StorageVolumeConfigKeys = map[string]func(value string) ([]string, error){ // VolumeValidateConfig validations volume config. func VolumeValidateConfig(name string, config map[string]string, parentPool *api.StoragePool) error { // Validate volume config using the new driver interface if supported. - driver, err := drivers.Load(nil, parentPool.Driver, parentPool.Name, parentPool.Config, nil, validateVolumeCommonRules) + driver, err := drivers.Load(nil, parentPool.Driver, parentPool.Name, parentPool.Config, nil, nil, validateVolumeCommonRules) if err != drivers.ErrUnknownDriver { // Note: This legacy validation function doesn't have the concept of validating // different volumes types, so the types are hard coded as Custom and FS.
lxd/storage/utils: Updates VolumeValidateConfig to use update driver loader
lxc_lxd
train
go
34910765fbafb53bec6604b730875d010a863ae2
diff --git a/setuptools/command/test.py b/setuptools/command/test.py index <HASH>..<HASH> 100644 --- a/setuptools/command/test.py +++ b/setuptools/command/test.py @@ -138,7 +138,7 @@ class test(Command): if self.distribution.tests_require: self.distribution.fetch_build_eggs(self.distribution.tests_require) - if self.test_suite: + if True: cmd = ' '.join(self._argv) if self.dry_run: self.announce('skipping "%s" (dry run)' % cmd)
Always execute tests, even if no test_suite is supplied. Fixes #<I>.
pypa_setuptools
train
py
1ac8ed68400b04b53e0f83dc00446fcdaa70dc49
diff --git a/lfs/pointer_smudge.go b/lfs/pointer_smudge.go index <HASH>..<HASH> 100644 --- a/lfs/pointer_smudge.go +++ b/lfs/pointer_smudge.go @@ -12,6 +12,7 @@ import ( ) func PointerSmudgeToFile(filename string, ptr *Pointer, cb CopyCallback) error { + os.MkdirAll(filepath.Dir(filename), 0755) file, err := os.Create(filename) if err != nil { return fmt.Errorf("Could not create working directory file: %v", err)
Be sure to create all folders required to smudge a file
git-lfs_git-lfs
train
go
fc6f5a108b0912d8c0504c2e335bd67be8599623
diff --git a/hypercorn/trio/server.py b/hypercorn/trio/server.py index <HASH>..<HASH> 100644 --- a/hypercorn/trio/server.py +++ b/hypercorn/trio/server.py @@ -117,7 +117,7 @@ class Server: with trio.CancelScope() as cancel_scope: cancel_scope.shield = True await self.stream.send_all(event.data) - except trio.BrokenResourceError: + except (trio.BrokenResourceError, trio.ClosedResourceError): await self.protocol.handle(Closed()) elif isinstance(event, Closed): await self._close()
Bugfix Catch ClosedResourceError as well
pgjones_hypercorn
train
py
7516eb27bf6ad473164480cc6c5553955ed8fc66
diff --git a/Lib/fontbakery/specifications/googlefonts.py b/Lib/fontbakery/specifications/googlefonts.py index <HASH>..<HASH> 100644 --- a/Lib/fontbakery/specifications/googlefonts.py +++ b/Lib/fontbakery/specifications/googlefonts.py @@ -1141,7 +1141,7 @@ def check_with_msfontvalidator(font): "-file", font, "-all-tables", "-report-in-font-dir", - "+rendering-tests"] + "+raster-tests"] subprocess.check_output(fval_cmd, stderr=subprocess.STDOUT) except subprocess.CalledProcessError as e: filtered_msgs = ""
correct FVal attribute is actually +raster-tests :-) (issue #<I>)
googlefonts_fontbakery
train
py
6afb2d75f4d4e7a40965e59d059226ab44088aa0
diff --git a/graphite_api/render/glyph.py b/graphite_api/render/glyph.py index <HASH>..<HASH> 100644 --- a/graphite_api/render/glyph.py +++ b/graphite_api/render/glyph.py @@ -1751,8 +1751,6 @@ class LineGraph(Graph): labels = self.yLabelValuesL else: labels = self.yLabelValues - if self.logBase: - labels.append(self.logBase * max(labels)) for i, value in enumerate(labels): self.ctx.set_line_width(0.4)
Remove superfluous grid line for log scale
brutasse_graphite-api
train
py
c8ce42c8e3553a4a5e2adb7d1bf9cddf753c28db
diff --git a/modules/ve/ce/nodes/ve.ce.ListNode.js b/modules/ve/ce/nodes/ve.ce.ListNode.js index <HASH>..<HASH> 100644 --- a/modules/ve/ce/nodes/ve.ce.ListNode.js +++ b/modules/ve/ce/nodes/ve.ce.ListNode.js @@ -71,6 +71,16 @@ ve.ce.ListNode.prototype.onSplice = function() { this.$.css( 'height' ); }; +ve.ce.ListNode.prototype.canHaveSlugAfter = function() { + if ( this.getParent().getType() === 'listItem' ) { + // Nested lists should not have slugs after them + return false; + } else { + // Call the parent's implementation + return ve.ce.BranchNode.prototype.canHaveSlugAfter.call( this ); + } +}; + /* Registration */ ve.ce.nodeFactory.register( 'list', ve.ce.ListNode );
Do not put slugs after nested lists But still put slugs before them. Done by overriding canHaveSlugAfter() in ve.ce.ListNode. Eventually this should be configurable and MediaWiki-specific Change-Id: I5ad<I>ca<I>a2d<I>add<I>acbea<I>b<I>
wikimedia_parsoid
train
js
9cf8eb2591234b2955afd00c5b33b191f3d315fa
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -32,20 +32,25 @@ _classifiers = ( ) -if sys.version_info < (2, 7): - # pylint 1.4 dropped support for Python 2.6 - _pylint = 'pylint>=1.0,<1.4' -else: - _pylint = 'pylint>=1.0' - - _install_requires = [ - _pylint, - 'astroid>=1.0', - 'logilab-common>=0.60.0', 'pylint-plugin-utils>=0.2.1' ] + +if sys.version_info < (2, 7): + # pylint 1.4 dropped support for Python 2.6 + _install_requires += [ + 'pylint>=1.0,<1.4', + 'astroid>=1.0,<1.3.0', + 'logilab-common>=0.60.0,<0.63', + ] +else: + _install_requires += [ + 'pylint>=1.0', + 'astroid>=1.0', + 'logilab-common>=0.60.0', + ] + setup( name='pylint-django', url='https://github.com/landscapeio/pylint-django',
Conditionally excluding pylint <I>+ when using Python<I>; also astroid and logilab versions
PyCQA_pylint-django
train
py
c0e3cb183356b038f2d70983ae07af3b28ca2eb5
diff --git a/framework/core/src/Http/Controller/AbstractClientController.php b/framework/core/src/Http/Controller/AbstractClientController.php index <HASH>..<HASH> 100644 --- a/framework/core/src/Http/Controller/AbstractClientController.php +++ b/framework/core/src/Http/Controller/AbstractClientController.php @@ -312,12 +312,14 @@ abstract class AbstractClientController extends AbstractHtmlController */ protected function filterTranslations(array $translations, array $keys) { - return array_filter($translations, function ($id) use ($keys) { + $filtered = array_filter(array_keys($translations), function ($id) use ($keys) { foreach ($keys as $key) { if (substr($id, 0, strlen($key)) === $key) { return true; } } - }, ARRAY_FILTER_USE_KEY); + }); + + return array_only($translations, $filtered); } }
Don't use array_filter flag (PHP <I> only)
flarum_core
train
php
e3f1905d694e4afc2bd0c77d6620c1ac68eecdd4
diff --git a/Replicapool.php b/Replicapool.php index <HASH>..<HASH> 100644 --- a/Replicapool.php +++ b/Replicapool.php @@ -19,8 +19,8 @@ * Service definition for Replicapool (v1beta2). * * <p> - * The Google Compute Engine Instance Group Manager API provides groups of - * homogenous Compute Engine Instances.</p> + * [Deprecated. Please use Instance Group Manager in Compute API] Provides + * groups of homogenous Compute Engine instances.</p> * * <p> * For more information about this service, see the API
Autogenerated update for replicapool version v1beta2 (<I>-<I>-<I>)
googleapis_google-api-php-client-services
train
php
8eaca9ddbfd0ce6a0ed9ad63acec82f6deb7efd3
diff --git a/profiling/viewer.py b/profiling/viewer.py index <HASH>..<HASH> 100644 --- a/profiling/viewer.py +++ b/profiling/viewer.py @@ -60,10 +60,9 @@ class Formatter(object): ratio /= float(denom) except ZeroDivisionError: ratio = 0 - ratio = round(ratio, 4) - if ratio >= 1: + if round(ratio, 1) >= 1: precision = 0 - elif ratio >= 0.1: + elif round(ratio, 2) >= 0.1: precision = 1 else: precision = 2 diff --git a/test/test_viewer.py b/test/test_viewer.py index <HASH>..<HASH> 100644 --- a/test/test_viewer.py +++ b/test/test_viewer.py @@ -48,3 +48,9 @@ def test_format_time(): assert fmt.format_time(12.34567) == '12.3sec' assert fmt.format_time(123.4567) == '2min3s' assert fmt.format_time(6120.000) == '102min' + + +def test_format_percent(): + assert fmt.format_percent(1) == '100' + assert fmt.format_percent(0.999999) == '100' + assert fmt.format_percent(0.9999) == '100'
Don't format to <I>% instead of <I>%
what-studio_profiling
train
py,py
1590d813f45874334072ad183d6fdc69b6c41414
diff --git a/definitions/npm/jest_v18.x.x/flow_v0.33.x-/jest_v18.x.x.js b/definitions/npm/jest_v18.x.x/flow_v0.33.x-/jest_v18.x.x.js index <HASH>..<HASH> 100644 --- a/definitions/npm/jest_v18.x.x/flow_v0.33.x-/jest_v18.x.x.js +++ b/definitions/npm/jest_v18.x.x/flow_v0.33.x-/jest_v18.x.x.js @@ -431,6 +431,7 @@ declare var jasmine: { arrayContaining(value: Array<mixed>): void, clock(): JestClockType, createSpy(name: string): JestSpyType, + createSpyObj(baseName: string, methodNames: Array<string>): {[methodName: string]: JestSpyType}, objectContaining(value: Object): void, stringMatching(value: string): void, }
Update Jest Jasmine type declaration (#<I>)
flow-typed_flow-typed
train
js
8d06f026264d1cfbfdc43393b8f9b287e81b7855
diff --git a/lib/native-client.js b/lib/native-client.js index <HASH>..<HASH> 100644 --- a/lib/native-client.js +++ b/lib/native-client.js @@ -57,6 +57,11 @@ class NativeClient extends EventEmitter { } debug('connected!'); this.database = database; + this.readPreferenceOption = { + // https://docs.mongodb.com/manual/core/read-preference/#maxstalenessseconds + // maxStalenessMS: 25000, + readPreference: ReadPreference.PRIMARY_PREFERRED + }; this.database.admin().command({ ismaster: 1 }, (error, result) => { const ismaster = error ? {} : result; this.isWritable = this._isWritable(ismaster); @@ -108,7 +113,7 @@ class NativeClient extends EventEmitter { */ listCollections(databaseName, filter, callback) { var db = this._database(databaseName); - db.listCollections(filter, {readPreference: {mode: ReadPreference.PRIMARY_PREFERRED}}).toArray((error, data) => { + db.listCollections(filter, this.readPreferenceOption).toArray((error, data) => { if (error) { return callback(this._translateMessage(error)); }
Refactor readPreference for reusability (#<I>) * Abstract to NativeClient.readPreferenceOption Note: With and without the {mode: …} object both work, so let’s use the version without mode which is closer to documented one: <URL>, not seconds even though seconds is the more appropriate (and documented) measurement.
mongodb-js_data-service
train
js
1318d7f0caf63fed2ccf860fface1b19be183609
diff --git a/tests/test_watch.py b/tests/test_watch.py index <HASH>..<HASH> 100644 --- a/tests/test_watch.py +++ b/tests/test_watch.py @@ -137,6 +137,26 @@ def test_watch(mocker): assert next(iter_) == {'r2'} +def test_watch_watcher_args(mocker): + class FakeWatcher: + def __init__(self, path, arg1, arg2): + self._results = iter([ + {arg1}, + set(), + {arg2}, + set(), + ]) + + def check(self): + return next(self._results) + + args = ["ahoy", "borec"] + + iter_ = watch('xxx', watcher_cls=FakeWatcher, watcher_args=args, debounce=5, normal_sleep=2, min_sleep=1) + assert next(iter_) == {args[0]} + assert next(iter_) == {args[1]} + + def test_watch_stop(): class FakeWatcher: def __init__(self, path):
Add test of watch with watcher_args
samuelcolvin_watchgod
train
py
c22e59f0d7f70a6c72f24471ea38188d5e22d85a
diff --git a/vent/core/rq_worker/watch.py b/vent/core/rq_worker/watch.py index <HASH>..<HASH> 100644 --- a/vent/core/rq_worker/watch.py +++ b/vent/core/rq_worker/watch.py @@ -13,7 +13,7 @@ def gpu_queue(options): if os.path.isdir("/root/.vent"): path_dir = "/root/.vent" else: - path_dir = "/vent" + path_dir = os.path.join(os.path.expanduser("~"), template_path) print("gpu queue", str(options)) print("gpu queue", str(GpuUsage(base_dir=path_dir+"/", @@ -130,7 +130,7 @@ def gpu_queue(options): return status -def file_queue(path, template_path="/vent/", r_host="redis"): +def file_queue(path, template_path=".vent/", r_host="redis"): """ Processes files that have been added from the rq-worker, starts plugins that match the mime type for the new file. @@ -154,6 +154,7 @@ def file_queue(path, template_path="/vent/", r_host="redis"): configs = {} logger = Logger(__name__) + template_path = os.path.join(os.path.expanduser("~"), template_path) if os.path.isdir("/root/.vent"): template_path = "/root/.vent/"
paths are wrong for rq_worker
CyberReboot_vent
train
py
db46099f911c3514c6769a7314f1c0fb5d8074af
diff --git a/sbe-tool/src/main/resources/java/interfaces/CompositeDecoderFlyweight.java b/sbe-tool/src/main/resources/java/interfaces/CompositeDecoderFlyweight.java index <HASH>..<HASH> 100644 --- a/sbe-tool/src/main/resources/java/interfaces/CompositeDecoderFlyweight.java +++ b/sbe-tool/src/main/resources/java/interfaces/CompositeDecoderFlyweight.java @@ -20,7 +20,7 @@ import org.agrona.DirectBuffer; /** * A <code>sbe:composite</code> decoder flyweight. */ -public interface CompositeDecoderFlyweight<T extends CompositeStructure> extends Flyweight<T>, DecoderFlyweight<T> +public interface CompositeDecoderFlyweight<T extends CompositeStructure> extends DecoderFlyweight<T> { CompositeDecoderFlyweight<T> wrap(DirectBuffer buffer, int offset); }
[Java] Remove redundant extends clause.
real-logic_simple-binary-encoding
train
java
08045bfc870ce718f3ee78327346ab6fbf7b2bcb
diff --git a/src/function/overload.js b/src/function/overload.js index <HASH>..<HASH> 100644 --- a/src/function/overload.js +++ b/src/function/overload.js @@ -81,7 +81,7 @@ define( } if (!implementationSignature) { - implementationSignature = list("*", implementation.length); + implementationSignature = list("any", implementation.length); router = routeByLength; } else { compiledSignature = Function.compileImplementationSignature(implementationSignature);
changing "*" to "any" when building a implementation signature by length with list()
bob-gray_solv
train
js
d3e7914915c800d33f536cdb40190b1f74bed463
diff --git a/src/Radio/Radio.js b/src/Radio/Radio.js index <HASH>..<HASH> 100644 --- a/src/Radio/Radio.js +++ b/src/Radio/Radio.js @@ -14,7 +14,7 @@ export const styleSheet = createStyleSheet('MuiRadio', (theme) => { color: theme.palette.text.secondary, }, checked: { - color: theme.palette.accent[500], + color: theme.palette.primary[500], }, disabled: { color: theme.palette.action.disabled,
[Radio] Change checked color to primary. (#<I>)
mui-org_material-ui
train
js
3543d65943687dbaaf969172751db0a4c8cfd8d6
diff --git a/src/tracing/importer/trace_event_importer.js b/src/tracing/importer/trace_event_importer.js index <HASH>..<HASH> 100644 --- a/src/tracing/importer/trace_event_importer.js +++ b/src/tracing/importer/trace_event_importer.js @@ -606,6 +606,8 @@ base.exportTo('tracing.importer', function() { throw new Error(''); function handleField(object, fieldName, fieldValue) { + if (typeof fieldValue != object) + return; if (!fieldValue.id_ref && !fieldValue.idRef) return;
Recover when fieldValue is undefined
catapult-project_catapult
train
js
b3a0b1c97b336e202423d0194fb0642e26915395
diff --git a/src/main/java/com/authlete/jaxrs/UserInfoRequestHandler.java b/src/main/java/com/authlete/jaxrs/UserInfoRequestHandler.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/authlete/jaxrs/UserInfoRequestHandler.java +++ b/src/main/java/com/authlete/jaxrs/UserInfoRequestHandler.java @@ -109,8 +109,9 @@ public class UserInfoRequestHandler extends BaseHandler // If an access token is not available. if (accessToken == null) { - // Return "401 Unauthorized". - return ResponseUtil.unauthorized(null, CHALLENGE_ON_MISSING_ACCESS_TOKEN); + // Return "400 Bad Request". + return ResponseUtil.bearerError( + Status.BAD_REQUEST, CHALLENGE_ON_MISSING_ACCESS_TOKEN); } try
Modified UserInfoRequestHandler to return "<I> Bad Request" instead of "<I> Unauthorized" when an access token is not available in handle().
authlete_authlete-java-jaxrs
train
java
244919c305f910c64d13d2f75fef7328c59e88b8
diff --git a/src/DataSource/ArrayDataSource.php b/src/DataSource/ArrayDataSource.php index <HASH>..<HASH> 100644 --- a/src/DataSource/ArrayDataSource.php +++ b/src/DataSource/ArrayDataSource.php @@ -340,7 +340,11 @@ class ArrayDataSource implements IDataSource $data = []; foreach ($this->data as $item) { - $sort_by = (string) $item[$column]; + if (is_object($item[$column]) && $item[$column] instanceof \DateTime) { + $sort_by = $item[$column]->format('Y-m-d H:i:s'); + } else { + $sort_by = (string) $item[$column]; + } $data[$sort_by][] = $item; }
Fix sorting by date (#<I>) Use instanceof instead of is_a
contributte_datagrid
train
php
26e2d97c1b64157633d5e732c13ee122f43f1a77
diff --git a/src/org/jenetics/TruncationSelector.java b/src/org/jenetics/TruncationSelector.java index <HASH>..<HASH> 100644 --- a/src/org/jenetics/TruncationSelector.java +++ b/src/org/jenetics/TruncationSelector.java @@ -28,12 +28,12 @@ import org.jenetics.util.Validator; * In truncation selection individuals are sorted according to their fitness. * Only the best individuals are selected. * - * @see <a href="http://en.wikipedia.org/wiki/Truncation_selectionm"> + * @see <a href="http://en.wikipedia.org/wiki/Truncation_selection"> * Wikipedia: Truncation selection * </a> * * @author <a href="mailto:[email protected]">Franz Wilhelmstötter</a> - * @version $Id: TruncationSelector.java,v 1.1 2009-02-25 21:07:38 fwilhelm Exp $ + * @version $Id: TruncationSelector.java,v 1.2 2009-09-13 20:43:14 fwilhelm Exp $ */ public class TruncationSelector<G extends Gene<?, G>, C extends Comparable<C>> implements Selector<G, C>
Fix Wikipedia link for Trunctation selection.
jenetics_jenetics
train
java
8088519f67763b84220943c99c9c369f5c38fbf2
diff --git a/src/Test/WebTest/WebTestBase.php b/src/Test/WebTest/WebTestBase.php index <HASH>..<HASH> 100644 --- a/src/Test/WebTest/WebTestBase.php +++ b/src/Test/WebTest/WebTestBase.php @@ -67,14 +67,23 @@ class WebTestBase extends WebTestCase } elseif ($newClient) { self::$client->restart(); } + static::prepareNextRequest(); + return self::$client; + } + + /** + * Prepares environment for next (test) request. + * + * Empties global $_GET variable. + */ + public static function prepareNextRequest() + { if ($_GET) { /* knp_paginator pas problem when it is set from a previous run (it sets it when only a default sorting is set, on the next run it does not match */ $_GET = array(); } - - return self::$client; } /**
[Test] split out method for preparing a request, in WebTestBase
EmchBerger_cube-common-develop
train
php
c2be2d95f907e91b4780007f1bc7fd9adcd8e595
diff --git a/Classes/Updates/ConvertTemplatesToUppercase.php b/Classes/Updates/ConvertTemplatesToUppercase.php index <HASH>..<HASH> 100644 --- a/Classes/Updates/ConvertTemplatesToUppercase.php +++ b/Classes/Updates/ConvertTemplatesToUppercase.php @@ -57,7 +57,7 @@ class ConvertTemplatesToUppercase implements UpgradeWizardInterface public function updateNecessary(): bool { - return count($this->getTemplates()) > 0; + return count($this->getTemplates() ?: []) > 0; } public function getPrerequisites(): array @@ -65,9 +65,14 @@ class ConvertTemplatesToUppercase implements UpgradeWizardInterface return []; } - protected function getTemplates(): Finder + protected function getTemplates(): ?Finder { $settings = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('mask'); + + if (($settings['content'] ?? '') === '') { + return null; + } + if (strpos($settings['content'], 'EXT:') === 0) { $absolutePath = MaskUtility::getFileAbsFileName($settings['content']); } else {
[BUGFIX] Prevent ConvertTemplates wizard from renaming every file There is now a check, to verify the template path is not empty. If it is empty, there is nothing to do for the Update Wizard. Fixes: #<I>
Gernott_mask
train
php
5422c2f10a473153951c13c58aa039cc2a71891a
diff --git a/src/discoursegraphs/readwrite/generic.py b/src/discoursegraphs/readwrite/generic.py index <HASH>..<HASH> 100644 --- a/src/discoursegraphs/readwrite/generic.py +++ b/src/discoursegraphs/readwrite/generic.py @@ -7,7 +7,7 @@ import sys import argparse from networkx import write_dot -from discoursegraphs.util import ensure_ascii +from discoursegraphs.util import ensure_utf8, ensure_ascii def generic_converter_cli(docgraph_class, file_descriptor=''):
readwrite.generic: fixed import
arne-cl_discoursegraphs
train
py
ef4529e504693d45ef04e2ebb9958b2a62f1c68f
diff --git a/nexus/sites.py b/nexus/sites.py index <HASH>..<HASH> 100644 --- a/nexus/sites.py +++ b/nexus/sites.py @@ -97,7 +97,7 @@ class NexusSite(object): def inner(request, *args, **kwargs): if not self.has_permission(request, extra_permission): # show login pane - return self.login(request, *args, **kwargs) + return self.login(request) return view(request, *args, **kwargs) # Mark it as never_cache
Removes args and kwargs to self.login in as_view If you visited a nexus url that has args or kwargs while not logged in as a user with permission, those args or kwargs were getting passed to self.login, which doesn't accept arbitrary args and kwargs, leading to a <I>, so I removed them from the call to self.login
disqus_nexus
train
py
5c0bef5d4632fca9fd5dfbaff95a4773cc2cf6d7
diff --git a/lib/moodlelib.php b/lib/moodlelib.php index <HASH>..<HASH> 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -437,11 +437,14 @@ function get_records_sql($sql) { if (!$rs) return false; if ( $rs->RecordCount() > 0 ) { - $records = $rs->GetAssoc(true); - foreach ($records as $key => $record) { - $objects[$key] = (object) $record; + if ($records = $rs->GetAssoc(true)) { + foreach ($records as $key => $record) { + $objects[$key] = (object) $record; + } + return $objects; + } else { + return false; } - return $objects; } else { return false; } @@ -555,7 +558,7 @@ function update_record($table, $dataobject) { global $db; - if (! $dataobject->id) { + if (! isset($dataobject->id) ) { return false; } @@ -565,7 +568,7 @@ function update_record($table, $dataobject) { // Pull out data matching these fields foreach ($columns as $column) { - if ($column->name <> "id" && $data[$column->name] ) { + if ($column->name <> "id" && isset($data[$column->name]) ) { $ddd[$column->name] = $data[$column->name]; } }
Fixed buglets in get_records_sql and insert_record
moodle_moodle
train
php
6a45cc488e0a997e97be581f0e97dd59b92ab6c8
diff --git a/thoth/solver/python/python.py b/thoth/solver/python/python.py index <HASH>..<HASH> 100644 --- a/thoth/solver/python/python.py +++ b/thoth/solver/python/python.py @@ -201,7 +201,8 @@ def _do_resolve_index(solver: PythonSolver, all_solvers: typing.List[PythonSolve _LOGGER.warning("No versions were resolved for dependency %r in version %r", dependency.name, version_spec) unresolved.append({ 'package_name': dependency.name, - 'version_spec': version_spec + 'version_spec': version_spec, + 'index': index_url }) else: for version in resolved_versions:
Unresolvable packages have also index assigned
thoth-station_solver
train
py
d0334b8f017eb63b37359c738860046fb4daa710
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index <HASH>..<HASH> 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -409,7 +409,8 @@ module Rails # The secret_key_base is used as the input secret to the application's key generator, which in turn # is used to create all MessageVerifiers/MessageEncryptors, including the ones that sign and encrypt cookies. # - # In test and development, this is simply derived as a MD5 hash of the application's name. + # In development and test, this is randomly generated and stored in a + # temporary file in <tt>tmp/development_secret.txt</tt>. # # In all other environments, we look for it first in ENV["SECRET_KEY_BASE"], # then credentials.secret_key_base, and finally secrets.secret_key_base. For most applications,
Update comment for how secret key is calculated This updates the comment to reflect how the secret key is generated since 4c<I>ad6a<I>ab<I>e<I>d<I>d<I>e<I> Fixes #<I>
rails_rails
train
rb
e8000597671f2e81db664f504c7d0fc25d32cf12
diff --git a/jplephem/jplephem/test.py b/jplephem/jplephem/test.py index <HASH>..<HASH> 100644 --- a/jplephem/jplephem/test.py +++ b/jplephem/jplephem/test.py @@ -11,7 +11,10 @@ smaller and more feature-oriented suite can be run with:: import numpy as np from functools import partial from jplephem import Ephemeris, DateError -from unittest import SkipTest, TestCase +try: + from unittest import SkipTest, TestCase +except ImportError: + from unittest2 import SkipTest, TestCase class Tests(TestCase):
Try to make tests importable under Python <I>
brandon-rhodes_python-jplephem
train
py
3c0046437a2d43900888cd65c7d6f3dd9786629d
diff --git a/ui/src/components/stepper/QStep.js b/ui/src/components/stepper/QStep.js index <HASH>..<HASH> 100644 --- a/ui/src/components/stepper/QStep.js +++ b/ui/src/components/stepper/QStep.js @@ -70,7 +70,7 @@ export default createComponent({ const isActive = computed(() => $stepper.value.modelValue === props.name) const scrollEvent = computed(() => ( - ($q.platform.is.ios !== true && $q.platform.is.safari !== true) + ($q.platform.is.ios !== true && $q.platform.is.chrome === true) || isActive.value !== true || $stepper.value.vertical !== true ? {}
fix(QStepper): prevent dot line to create scrollable panels - firefox #<I>, #<I> (#<I>) #<I>, #<I>
quasarframework_quasar
train
js
2fac1973aa77381813e35ba22d326d2db2f4df35
diff --git a/test/unit/TypesFinder/FindPropertyTypeTest.php b/test/unit/TypesFinder/FindPropertyTypeTest.php index <HASH>..<HASH> 100644 --- a/test/unit/TypesFinder/FindPropertyTypeTest.php +++ b/test/unit/TypesFinder/FindPropertyTypeTest.php @@ -101,11 +101,23 @@ class FindPropertyTypeTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue($class)); $property->expects($this->any())->method('getDocComment') - ->will($this->returnValue('')); + ->will($this->returnValue('Nothing here...')); /* @var ReflectionProperty $property */ $foundTypes = (new FindPropertyType())->__invoke($property); $this->assertSame([], $foundTypes); } + + public function testFindPropertyTypeReturnsEmptyArrayWhenNoDocBlockIsPresent() + { + $property = $this->createMock(ReflectionProperty::class); + + $property->expects(self::once())->method('getDocComment') + ->will(self::returnValue('')); + + $foundTypes = (new FindPropertyType())->__invoke($property); + + self::assertEmpty($foundTypes); + } }
restore previous test and add new one to test absence of doc block
Roave_BetterReflection
train
php
7d7deca1b355103944a0249de6833367ab2df9c0
diff --git a/examples/with-redux/store.js b/examples/with-redux/store.js index <HASH>..<HASH> 100644 --- a/examples/with-redux/store.js +++ b/examples/with-redux/store.js @@ -32,7 +32,7 @@ export const serverRenderClock = (isServer) => dispatch => { } export const startClock = () => dispatch => { - return setInterval(() => dispatch({ type: actionTypes.TICK, light: true, ts: Date.now() }), 800) + return setInterval(() => dispatch({ type: actionTypes.TICK, light: true, ts: Date.now() }), 1000) } export const addCount = () => dispatch => {
With redux example clock interval fix (#<I>)
zeit_next.js
train
js
027f29f689814219f8223df4cb379c6d19e5c1eb
diff --git a/lib/nexpose/device.rb b/lib/nexpose/device.rb index <HASH>..<HASH> 100644 --- a/lib/nexpose/device.rb +++ b/lib/nexpose/device.rb @@ -109,6 +109,21 @@ module Nexpose end end + # Retrieve a list of assets which are incomplete in a given scan. If called + # during a scan, this method returns currently incomplete assets which may + # be in progress. + # + # @param [Fixnum] scan_id Unique identifier of a scan. + # @return [Array[IncompleteAsset]] List of incomplete assets. + # + def incomplete_assets(scan_id) + uri = "/data/asset/scan/#{scan_id}/incomplete-assets" + AJAX.preserving_preference(self, 'scan-incomplete-assets') do + data = DataTable._get_json_table(self, uri, {}, 500, nil, false) + data.map(&IncompleteAsset.method(:parse_json)) + end + end + def delete_device(device_id) r = execute(make_xml('DeviceDeleteRequest', { 'device-id' => device_id })) r.success @@ -188,4 +203,9 @@ module Nexpose end end end + + # Summary object of an incomplete asset for a scan. + # + class IncompleteAsset < CompletedAsset + end end
Add incomplete_assets method Use this method to get some information about assets currently being scanned, or were not completed in a past scan.
rapid7_nexpose-client
train
rb
9023ff972d84599c2f73220ead8026ccafd10df9
diff --git a/collection.go b/collection.go index <HASH>..<HASH> 100644 --- a/collection.go +++ b/collection.go @@ -132,6 +132,9 @@ type CollectionProperties struct { // This attribute specifies the name of the sharding strategy to use for the collection. // Can not be changed after creation. ShardingStrategy ShardingStrategy `json:"shardingStrategy,omitempty"` + // This attribute specifies that the sharding of a collection follows that of another + // one. + DistributeShardsLike string `json:"distributeShardsLike,omitempty"` } const (
Add property DistributeShardsLike to Collection Properties.
arangodb_go-driver
train
go
22330e955b4dd7517cd960fadf5850e855411fdc
diff --git a/src/main/java/com/threerings/presents/dobj/CompoundEvent.java b/src/main/java/com/threerings/presents/dobj/CompoundEvent.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/threerings/presents/dobj/CompoundEvent.java +++ b/src/main/java/com/threerings/presents/dobj/CompoundEvent.java @@ -53,6 +53,12 @@ public class CompoundEvent extends DEvent _events = StreamableArrayList.newList(); } + /** Used when unserializing. */ + public CompoundEvent () + { + super(0, Transport.DEFAULT); + } + /** * Posts an event to this transaction. The event will be delivered as part of the entire * transaction if it is committed or discarded if the transaction is cancelled.
The CompoundEvent needs a zero-arg ctor, as its non-zero-arg ctor does lots of crazy stuff. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1
threerings_narya
train
java
53e69e0be18037ee144130b25cceeeaf48847d41
diff --git a/deployutils/__init__.py b/deployutils/__init__.py index <HASH>..<HASH> 100644 --- a/deployutils/__init__.py +++ b/deployutils/__init__.py @@ -22,4 +22,4 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -__version__ = '0.6.2' +__version__ = '0.6.3-dev'
bumps version number to <I>-dev
djaodjin_djaodjin-deployutils
train
py
8aaa736bf24b657aa002d714bfe793ea3add1bde
diff --git a/lib/logger.js b/lib/logger.js index <HASH>..<HASH> 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -289,7 +289,7 @@ var proto = { trace: function trace(msg) { var args; if (this.isEnabledFor(LEVELS.TRACE)) { - var obj = new Error(); + var obj = {}; Error.captureStackTrace(obj, trace); obj[STACK_SYMBOL] = true; diff --git a/test/logger.js b/test/logger.js index <HASH>..<HASH> 100644 --- a/test/logger.js +++ b/test/logger.js @@ -280,6 +280,7 @@ module.exports = { assert.equal(record.level, Logger.TRACE); assert.equal(record.message, "intrusion"); assert(record.stack); + assert(!record.exception); a.trace(); var record = spyA.getLastArgs()[0];
fix: logger.trace() should not set record.exception
seanmonstar_intel
train
js,js
5b8c21e1cede001c60b3e68dad34f79f77603626
diff --git a/src/org/nutz/mvc/upload/Uploads.java b/src/org/nutz/mvc/upload/Uploads.java index <HASH>..<HASH> 100644 --- a/src/org/nutz/mvc/upload/Uploads.java +++ b/src/org/nutz/mvc/upload/Uploads.java @@ -67,7 +67,10 @@ public abstract class Uploads { * 请求对象 */ public static void removeInfo(HttpServletRequest req) { - req.removeAttribute(UploadInfo.SESSION_NAME); + HttpSession sess = req.getSession(false); + if (null != sess) { + sess.removeAttribute(UploadInfo.SESSION_NAME); + } } }
fix:UploadInfo should remove from session not from request
nutzam_nutz
train
java
85aabf734b1f129a935b7970945be763f3d7f1eb
diff --git a/internal/ui/window_glfw.go b/internal/ui/window_glfw.go index <HASH>..<HASH> 100644 --- a/internal/ui/window_glfw.go +++ b/internal/ui/window_glfw.go @@ -113,10 +113,11 @@ func (w *glfwWindow) IsMaximized() bool { func (w *glfwWindow) Maximize() { // Do not allow maximizing the window when the window is not resizable. // On Windows, it is possible to restore the window from being maximized by mouse-dragging, - // and this can be an unexpected behavior. + // and this can be an unexpected behavior (#1990). if w.ResizingMode() != WindowResizingModeEnabled { - panic("ui: a window to maximize must be resizable") + return } + if !w.ui.isRunning() { w.ui.setInitWindowMaximized(true) return
internal/ui: remove panic at (*glfwWindow).Maximize Just doing nothing is more consistent with other functions. Updates #<I>
hajimehoshi_ebiten
train
go
f9c650c34455d1f3ec2fbdd89fedcf392f618ced
diff --git a/test/integration/options.spec.js b/test/integration/options.spec.js index <HASH>..<HASH> 100644 --- a/test/integration/options.spec.js +++ b/test/integration/options.spec.js @@ -505,14 +505,12 @@ describe('options', function() { }); }); - describe('--watch', function() { - describe('with watch enabled', function() { - it('should show the cursor and signal correct exit code, when watch process is terminated', function(done) { - if (process.platform === 'win32') { - // Windows: Feature works but SIMULATING the signal (ctr+c), via child process, does not work - // due to lack of *nix signal compliance. - done(); - } else { + if (process.platform !== 'win32') { + // Windows: Feature works but SIMULATING the signal (ctr+c), via child process, does not work + // due to lack of *nix signal compliance. + describe('--watch', function() { + describe('with watch enabled', function() { + it('should show the cursor and signal correct exit code, when watch process is terminated', function(done) { this.timeout(0); this.slow(3000); // executes Mocha in a subprocess @@ -536,8 +534,8 @@ describe('options', function() { // kill the child process mocha.kill('SIGINT'); }, 500); - } + }); }); }); - }); + } });
only run test on non-windws
mochajs_mocha
train
js
1bca28ad12478dc2bbefb759bde00c337e0783f9
diff --git a/pkg/api/dtos/apps.go b/pkg/api/dtos/apps.go index <HASH>..<HASH> 100644 --- a/pkg/api/dtos/apps.go +++ b/pkg/api/dtos/apps.go @@ -31,6 +31,7 @@ func NewAppSettingsDto(def *plugins.AppPlugin, data *models.AppSettings) *AppSet dto.Enabled = data.Enabled dto.Pinned = data.Pinned dto.Info = &def.Info + dto.JsonData = data.JsonData } return dto
include the jsonData in the AppSettings DTO
grafana_grafana
train
go
e8798c4dd4d0f52bbc88a858545389260cf9c941
diff --git a/test/support/configs.js b/test/support/configs.js index <HASH>..<HASH> 100644 --- a/test/support/configs.js +++ b/test/support/configs.js @@ -118,4 +118,4 @@ module.exports.merged = { }, target2 : passedin.task2.target2 } -} \ No newline at end of file +}; \ No newline at end of file
chore: jshint complains about missing ;
creynders_load-grunt-configs
train
js
596df14a2faf7f3a24152d5382da29036bc4ee29
diff --git a/tests/framework/validators/FileValidatorTest.php b/tests/framework/validators/FileValidatorTest.php index <HASH>..<HASH> 100644 --- a/tests/framework/validators/FileValidatorTest.php +++ b/tests/framework/validators/FileValidatorTest.php @@ -417,7 +417,7 @@ class FileValidatorTest extends TestCase ['test.txt', 'text/*', 'txt'], // Disabled for PHP 7.2 RC because of regression: // https://bugs.php.net/bug.php?id=75380 - version_compare(PHP_VERSION, '7.2.0.RC.1', '>=') && version_compare(PHP_VERSION, '7.2.0.RC.5', '<=') + version_compare(PHP_VERSION, '7.2.0.RC.1', '>=') && version_compare(PHP_VERSION, '7.2.0.RC.6', '<=') ? null : ['test.xml', '*/xml', 'xml'], ['test.odt', 'application/vnd*', 'odt'],
Fixed tests for PHP <I> #<I> (#<I>)
yiisoft_yii-core
train
php
4ded2206847297afcd2e30899958b1fe88d177f8
diff --git a/tests/Probability/Distribution/Continuous/StudentTTest.php b/tests/Probability/Distribution/Continuous/StudentTTest.php index <HASH>..<HASH> 100644 --- a/tests/Probability/Distribution/Continuous/StudentTTest.php +++ b/tests/Probability/Distribution/Continuous/StudentTTest.php @@ -69,4 +69,23 @@ class StudentTTest extends \PHPUnit_Framework_TestCase $this->setExpectedException('\Exception'); StudentT::CDF(5, -1); } + + /** + * @dataProvider dataProviderForMean + */ + public function testMean($p, $ν, $μ) + { + $this->assertEquals($μ, StudentT::mean($p, $ν)); + } + + public function dataProviderForMean() + { + return [ + [2, -1, null], + [2, 0, null], + [2, 1, null], + [2, 2, 0], + [2, 3, 0], + ]; + } }
Add unit tests for StudentT mean.
markrogoyski_math-php
train
php
f2ec2f1d1e73d49d44322697f2042b6aff88b4b2
diff --git a/test/end.js b/test/end.js index <HASH>..<HASH> 100644 --- a/test/end.js +++ b/test/end.js @@ -43,7 +43,7 @@ test('End function processes Esri Failure', function (t) { t.plan(1) var promise = esriFail() end(promise).catch(function (err) { - t.throws(err) + t.ok(err, 'End promise should catch error') }) })
change throws to check if error catches
Esri_node-arcgis
train
js
72b4904652c3329776c39fd87876ddc601e46ad4
diff --git a/functions.go b/functions.go index <HASH>..<HASH> 100644 --- a/functions.go +++ b/functions.go @@ -91,7 +91,7 @@ func isLinted() bool { } func isVetted() bool { - _, err := exec.Command("go", "vet", sourcePath).Output() + _, err := exec.Command("go", "vet", sourceGoPath).Output() return err == nil } diff --git a/goprove.go b/goprove.go index <HASH>..<HASH> 100644 --- a/goprove.go +++ b/goprove.go @@ -2,6 +2,7 @@ package goprove import ( + "strings" "sync" "github.com/fatih/structs" @@ -14,8 +15,9 @@ const ( ) var ( - sourcePath string - checkList []checkItem + sourcePath string + sourceGoPath string + checkList []checkItem ) //go:generate jsonenums -type=itemCategory @@ -107,6 +109,7 @@ func init() { func RunTasks(path string, tasksToExlude []string) (successTasks []map[string]interface{}, failedTasks []map[string]interface{}) { var wg sync.WaitGroup sourcePath = path + sourceGoPath = strings.Replace(sourcePath, os.Getenv("GOPATH")+"/src/", "", 1) excludeTasks(&checkList, tasksToExlude)
Fix issues with go vet when used as a library (#<I>) * Export JSON fields in lowercase * Added structs annotation (json not supported) * Fix issues with go vet when used as a library
karolgorecki_goprove
train
go,go
5e02fa945c339d3c80ff544dfb7d5220c12b0aa6
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -1342,7 +1342,7 @@ function runTests(options) { changeSpy.should.have.been.calledWith(testPath); done(); }); - }, 1500); + }, 2000); })(); }.bind(this)) });
Increase delay on await test Trying to knock out annoying sporadic failure on this test that’s been occurring only on appveyor, node <I>, in polling mode
paulmillr_chokidar
train
js
7a4b1c064f9adf7de29d63a47363b4ceba141c0e
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/testutils/MiniClusterResource.java b/flink-runtime/src/test/java/org/apache/flink/runtime/testutils/MiniClusterResource.java index <HASH>..<HASH> 100644 --- a/flink-runtime/src/test/java/org/apache/flink/runtime/testutils/MiniClusterResource.java +++ b/flink-runtime/src/test/java/org/apache/flink/runtime/testutils/MiniClusterResource.java @@ -94,8 +94,6 @@ public class MiniClusterResource extends ExternalResource { @Override public void after() { - temporaryFolder.delete(); - Exception exception = null; if (miniCluster != null) { @@ -147,6 +145,8 @@ public class MiniClusterResource extends ExternalResource { if (exception != null) { log.warn("Could not properly shut down the MiniClusterResource.", exception); } + + temporaryFolder.delete(); } private void startMiniCluster() throws Exception {
[hotfix][tests] Delete tmp directory after cluster has shut down
apache_flink
train
java
041d5ee194389cb3f4454547d024a0b10c23d013
diff --git a/odl/test/space/tensors_test.py b/odl/test/space/tensors_test.py index <HASH>..<HASH> 100644 --- a/odl/test/space/tensors_test.py +++ b/odl/test/space/tensors_test.py @@ -212,6 +212,24 @@ def test_properties(odl_tspace_impl): assert x.nbytes == 4 * 3 * 4 +def test_size(odl_tspace_impl): + """Test that size handles corner cases appropriately.""" + impl = odl_tspace_impl + space = odl.tensor_space((3, 4), impl=impl) + assert space.size == 12 + assert type(space.size) == int + + # Size 0 + space = odl.tensor_space((), impl=impl) + assert space.size == 0 + assert type(space.size) == int + + # Overflow test + large_space = odl.tensor_space((10000,) * 3, impl=impl) + assert large_space.size == 10000 ** 3 + assert type(space.size) == int + + def test_element(tspace, odl_elem_order): """Test creation of space elements.""" order = odl_elem_order
ENH: Add test for size of tensor
odlgroup_odl
train
py
8bfe7ddad220e9da208c907bcf3542fbc44650c2
diff --git a/adclient.py b/adclient.py index <HASH>..<HASH> 100644 --- a/adclient.py +++ b/adclient.py @@ -177,6 +177,11 @@ class ADClient: """ _adclient.CreateUser_adclient(self.obj, cn, container, short_name) + def CreateGroup(self, cn, container, short_name): + """ It creates user with given common name and short name in given container. + """ + _adclient.CreateGroup_adclient(self.obj, cn, container, short_name) + def DeleteDN(self, dn): """ It deletes given DN. """
added CreateGroup to python
paleg_libadclient
train
py
7aa5b911cfc1c23ea4a24216238fbc78b6fa0bfa
diff --git a/lib/iseq_rails_tools/railtie.rb b/lib/iseq_rails_tools/railtie.rb index <HASH>..<HASH> 100644 --- a/lib/iseq_rails_tools/railtie.rb +++ b/lib/iseq_rails_tools/railtie.rb @@ -15,7 +15,7 @@ module IseqRailsTools end directories = - app.config.iseq_compile_paths.map { |path| [path, 'rb'] }.to_h + app.config.iseq_compile_paths.map { |path| [path.to_s, 'rb'] }.to_h reloader = app.config.file_watcher.new(files, directories) do
If the autoload paths are pathnames, cast to string
kddeisz_iseq-rails-tools
train
rb
eb65e4ef9d15beffc87abd861f4ab5860dbd3d42
diff --git a/src/ondrs/UploadManager/Utils.php b/src/ondrs/UploadManager/Utils.php index <HASH>..<HASH> 100644 --- a/src/ondrs/UploadManager/Utils.php +++ b/src/ondrs/UploadManager/Utils.php @@ -70,7 +70,7 @@ class Utils $path .= $subDir; - if (!is_dir($path)) { + if (!@is_dir($path)) { @mkdir($path); @chmod($path, 0777); }
makeDirectoryRecursive: suppress warning from is_dir Can raise PHP Warning: is_dir(): open_basedir restriction in effect
ondrs_upload-manager
train
php
1374e9c4933735f11a76d57f05f52fcdcadb639d
diff --git a/src/Nymph.php b/src/Nymph.php index <HASH>..<HASH> 100644 --- a/src/Nymph.php +++ b/src/Nymph.php @@ -45,7 +45,7 @@ class Nymph { * @return boolean Whether the entity data passes the given selectors. */ public static function checkData(&$data, &$sdata, $selectors, $guid = null, $tags = null, $typesAlreadyChecked = [], $dataValsAreadyChecked = []) { - return RequirePHP::_('Nymph')->checkData(&$data, &$sdata, $selectors, $guid, $tags, $typesAlreadyChecked, $dataValsAreadyChecked); + return RequirePHP::_('Nymph')->checkData($data, $sdata, $selectors, $guid, $tags, $typesAlreadyChecked, $dataValsAreadyChecked); } /**
Removed accidental call time pass by reference.
sciactive_nymph-server
train
php
1f11da2f2c55bbe13d4c54f71c998ffedf01737c
diff --git a/kitchen-tests/cookbooks/end_to_end/metadata.rb b/kitchen-tests/cookbooks/end_to_end/metadata.rb index <HASH>..<HASH> 100644 --- a/kitchen-tests/cookbooks/end_to_end/metadata.rb +++ b/kitchen-tests/cookbooks/end_to_end/metadata.rb @@ -15,7 +15,6 @@ depends "resolver" depends "selinux" depends "ubuntu" depends "users" -depends "cron" depends "git" supports "ubuntu" diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/default.rb b/kitchen-tests/cookbooks/end_to_end/recipes/default.rb index <HASH>..<HASH> 100644 --- a/kitchen-tests/cookbooks/end_to_end/recipes/default.rb +++ b/kitchen-tests/cookbooks/end_to_end/recipes/default.rb @@ -63,12 +63,18 @@ include_recipe "nscd" include_recipe "logrotate" -include_recipe "cron" - include_recipe "git" directory "/etc/ssl" +cron_access "bob" + +cron_d "some random cron job" do + minute 0 + hour 23 + command "/usr/bin/true" +end + # Generate new key and certificate openssl_dhparam "/etc/ssl/dhparam.pem" do key_length 1024
Replace cron cookbook with new cron resources Test chef not the cookbook
chef_chef
train
rb,rb
905c4567a2bfb7a0f0c3103cc3f024c053359771
diff --git a/blocks/admin/block_admin.php b/blocks/admin/block_admin.php index <HASH>..<HASH> 100644 --- a/blocks/admin/block_admin.php +++ b/blocks/admin/block_admin.php @@ -207,11 +207,6 @@ class block_admin extends block_list { $this->content->items[]='<a href="http://docs.moodle.org/'.$lang.'/Teacher_documentation">'.get_string('help').'</a>'; $this->content->icons[]='<img src="'.$CFG->modpixpath.'/resource/icon.gif" alt="" />'; - if ($teacherforum = forum_get_course_forum($this->instance->pageid, 'teacher')) { - $this->content->items[]='<a href="'.$CFG->wwwroot.'/mod/forum/view.php?f='.$teacherforum->id.'">'.get_string('nameteacher', 'forum').'</a>'; - $this->content->icons[]='<img src="'.$CFG->modpixpath.'/forum/icon.gif" alt="" />'; - } - } else if (!isguest()) { // Students menu if ($course->showgrades) {
Removed forum_get_course_forum for forum type teacher.
moodle_moodle
train
php
cdfbc4a032d97af2a59361e6cb88162ec2f5e167
diff --git a/visidata/addons/editlog.py b/visidata/addons/editlog.py index <HASH>..<HASH> 100644 --- a/visidata/addons/editlog.py +++ b/visidata/addons/editlog.py @@ -83,7 +83,9 @@ class EditLog(Sheet): EditLog.currentReplayRow = r if beforeSheet: - vs = self.sheetmap[beforeSheet] + vs = self.sheetmap.get(beforeSheet) + if not vs: + vs = [x for x in vd().sheets if x.name == beforeSheet][0] else: vs = self diff --git a/visidata/vd.py b/visidata/vd.py index <HASH>..<HASH> 100755 --- a/visidata/vd.py +++ b/visidata/vd.py @@ -595,6 +595,7 @@ class VisiData: def push(self, vs): 'Move given sheet `vs` to index 0 of list `sheets`.' if vs: + vs.vd = self if vs in self.sheets: self.sheets.remove(vs) self.sheets.insert(0, vs) @@ -1333,7 +1334,7 @@ class Column: @type.setter def type(self, t): - 'Set `_type`.' + 'Sets `_type` from t as either a typename or a callable. Revert to anytype if not callable.' if isinstance(t, str): t = globals()[t]
Use existing sheet by name when replaying
saulpw_visidata
train
py,py
8cd7936ab0548008042d44367af5b3c3bf0d631f
diff --git a/gwpy/timeseries/timeseries.py b/gwpy/timeseries/timeseries.py index <HASH>..<HASH> 100644 --- a/gwpy/timeseries/timeseries.py +++ b/gwpy/timeseries/timeseries.py @@ -1474,9 +1474,7 @@ class TimeSeries(TimeSeriesBase): iend = istart + stridesamp idx = numpy.arange(istart, iend) mixed = numpy.exp(-1j * phasearray[idx]) * self.value[idx] - if singlesided: - mixed *= 2 - out.value[step] = mixed.mean() + out.value[step] = 2 * mixed.mean() if singlesided else mixed.mean() if exp: return out mag = out.abs()
timesseries.py: try reducing complexity of heterodyne method
gwpy_gwpy
train
py
e4bce8c1a4e2f5795f741dad6ef58e7c9c62fc6d
diff --git a/swauth/middleware.py b/swauth/middleware.py index <HASH>..<HASH> 100644 --- a/swauth/middleware.py +++ b/swauth/middleware.py @@ -151,9 +151,10 @@ class Swauth(object): # user's key self.auth_type = conf.get('auth_type', 'Plaintext').title() self.auth_encoder = getattr(swauth.authtypes, self.auth_type, None) - self.auth_encoder.salt = conf.get('auth_type_salt', 'swauthsalt') if self.auth_encoder is None: - self.auth_encoder = authtypes.Plaintext + raise Exception('Invalid auth_type in config file: %s' + % self.auth_type) + self.auth_encoder.salt = conf.get('auth_type_salt', 'swauthsalt') def __call__(self, env, start_response): """
Raise an exception when the user-specified auth_type is not found
openstack_swauth
train
py
02a313b025cd1d4d426c73f9a4b041ab4f8e95ba
diff --git a/js/exmo.js b/js/exmo.js index <HASH>..<HASH> 100644 --- a/js/exmo.js +++ b/js/exmo.js @@ -348,6 +348,8 @@ module.exports = class exmo extends Exchange { parseOrder (order, market = undefined) { let id = this.safeString (order, 'order_id'); let timestamp = this.safeInteger (order, 'created'); + if (typeof timestamp !== 'undefined') + timestamp *= 1000; let iso8601 = undefined; let symbol = undefined; let side = this.safeString (order, 'type');
updated open order timestamp calculation @ exmo.parseOrder
ccxt_ccxt
train
js
237040752f74e41ece96641620ce3c1a704d6874
diff --git a/spyder/widgets/reporterror.py b/spyder/widgets/reporterror.py index <HASH>..<HASH> 100644 --- a/spyder/widgets/reporterror.py +++ b/spyder/widgets/reporterror.py @@ -142,6 +142,7 @@ class SpyderErrorDialog(QDialog): self.main_label.setOpenExternalLinks(True) self.main_label.setWordWrap(True) self.main_label.setAlignment(Qt.AlignJustify) + self.main_label.setStyleSheet('font-size: 11pt;') # Field to input the description of the problem self.input_description = DescriptionWidget(self) @@ -212,8 +213,9 @@ class SpyderErrorDialog(QDialog): QApplication.clipboard().setText(issue_text) # Submit issue to Github - issue_body = ("<!--- IMPORTANT: Paste the contents of your clipboard " - "here to complete reporting the problem. --->\n\n") + issue_body = ( + " \n<!--- *** BEFORE SUBMITTING: PASTE CLIPBOARD HERE TO " + "COMPLETE YOUR REPORT *** ---!>\n") main.report_issue(body=issue_body, title="Automatic error report")
Make error dialog and paste clipboard text even harder to miss
spyder-ide_spyder
train
py
1b9a356a07f2bf1a35664113570f00ae03552156
diff --git a/DbalProducer.php b/DbalProducer.php index <HASH>..<HASH> 100644 --- a/DbalProducer.php +++ b/DbalProducer.php @@ -75,10 +75,11 @@ class DbalProducer implements PsrProducer )); } + $hasNativeGuid = $this->context->getDbalConnection()->getDatabasePlatform()->hasNativeGuidType(); $uuid = Uuid::uuid4(); $dbalMessage = [ - 'id' => $uuid->getBytes(), + 'id' => $hasNativeGuid ? $uuid->toString() : $uuid->getBytes(), 'human_id' => $uuid->toString(), 'published_at' => (int) microtime(true) * 10000, 'body' => $body,
[dbal] store string if dbal supports guid natively.
php-enqueue_dbal
train
php
c0e445ac51b5936300095922464b60f68aa2ee91
diff --git a/resources/views/dashboard/templates/add.blade.php b/resources/views/dashboard/templates/add.blade.php index <HASH>..<HASH> 100644 --- a/resources/views/dashboard/templates/add.blade.php +++ b/resources/views/dashboard/templates/add.blade.php @@ -9,13 +9,14 @@ <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.8.0/mode/twig/twig.min.js"></script> <script> -(function() { - var editor = CodeMirror.fromTextArea(document.getElementById('cm-editor'), { - lineNumbers: true, - mode: 'twig', - lineWrapping: true - }); -}()); +//Initializes the editor only once the DOM is loaded. +window.addEventListener("DOMContentLoaded", function(e) { + var editor = CodeMirror.fromTextArea(document.getElementById('cm-editor'), { + lineNumbers: true, + mode: 'twig', + lineWrapping: true + }); +}); </script> @stop
Makes the editor focusable. It's related to CachetHQ/Cachet#<I> On the incident template creation the editor was not focusable, now it is. The problem was the initialization of the editor that was done before the DOM is fully loaded. Using addEventListener and DOMContentListener fixes the problem and is compatible from IE9.
CachetHQ_Cachet
train
php
983c36c08510bfe062f6ac6d8047d40f7f4cfb97
diff --git a/function/function.go b/function/function.go index <HASH>..<HASH> 100644 --- a/function/function.go +++ b/function/function.go @@ -782,7 +782,10 @@ func (f *Function) configChanged(config *lambda.GetFunctionOutput) bool { Role: *config.Configuration.Role, Runtime: *config.Configuration.Runtime, Handler: *config.Configuration.Handler, - KMSKeyArn: *config.Configuration.KMSKeyArn, + } + + if config.Configuration.KMSKeyArn != nil { + remoteConfig.KMSKeyArn = *config.Configuration.KMSKeyArn } if config.Configuration.Environment != nil {
Fix KMS Bug (#<I>)
apex_apex
train
go
696149ad6977f5bbe618bd38d95f3028d96a8342
diff --git a/spec/docker_connection_spec.rb b/spec/docker_connection_spec.rb index <HASH>..<HASH> 100644 --- a/spec/docker_connection_spec.rb +++ b/spec/docker_connection_spec.rb @@ -14,10 +14,10 @@ describe Percheron::DockerConnection do describe '#setup!' do context "when ENV['DOCKER_CERT_PATH'] is defined" do - let(:expected_options) { {:client_cert=>"/Users/ash/src/personal/percheron/spec/fixtures/cert.pem", :client_key=>"/Users/ash/src/personal/percheron/spec/fixtures/key.pem", :ssl_ca_file=>"/Users/ash/src/personal/percheron/spec/fixtures/ca.pem", :scheme=>"https", :connect_timeout=>10} } + let(:expected_options) { {:client_cert=>"/tmp/cert.pem", :client_key=>"/tmp/key.pem", :ssl_ca_file=>"/tmp/ca.pem", :scheme=>"https", :connect_timeout=>10} } before do - ENV['DOCKER_CERT_PATH'] = './spec/fixtures' + ENV['DOCKER_CERT_PATH'] = '/tmp' end it 'sets Docker url' do
Fixed DockerConnection non deterministic pathing
ashmckenzie_percheron
train
rb
97b315f2ec993e8c636469766415d493936b54f5
diff --git a/modules/orionode/lib/update.js b/modules/orionode/lib/update.js index <HASH>..<HASH> 100644 --- a/modules/orionode/lib/update.js +++ b/modules/orionode/lib/update.js @@ -34,7 +34,7 @@ module.exports.router = function(options) { .use(responseTime({digits: 2, header: "X-Update-Response-Time", suffix: true})) .post('/downloadUpdates', function (req, res) { var allPrefs = prefs.readElectronPrefs(); - var updateChannel = allPrefs.user && allPrefs.user.updateChannel && allPrefs.user.updateChannel.name ? allPrefs.user.updateChannel.name : configParams["orion.autoUpdater.defaultChannel"]; + var updateChannel = (allPrefs.Properties && allPrefs.Properties["updateChannel/name"]) || configParams["orion.autoUpdater.defaultChannel"]; var task = new tasks.Task(res, false, true, 0, true); if (platform === "linux") { electron.shell.openExternal(feedURL + '/download/channel/' + updateChannel + '/linux');
Bug <I> - Electron app update not working in latest fix update channel
eclipse_orion.client
train
js
892f7c890526055cd63055446f32144f0fbc618e
diff --git a/salt/renderers/jinja.py b/salt/renderers/jinja.py index <HASH>..<HASH> 100644 --- a/salt/renderers/jinja.py +++ b/salt/renderers/jinja.py @@ -130,15 +130,20 @@ strftime Converts any time related object into a time based string. It requires a valid :ref:`strftime directives <python2:strftime-strptime-behavior>`. An :ref:`exhaustive list <python2:strftime-strptime-behavior>` can be found in - the official Python documentation. Fuzzy dates are parsed by `timelib`_ python - module. Some examples are available on this pages. + the official Python documentation. + + .. code-block:: yaml + + {% set curtime = None | strftime() %} + + Fuzzy dates require the `timelib`_ Python module is installed. .. code-block:: yaml {{ "2002/12/25"|strftime("%y") }} {{ "1040814000"|strftime("%Y-%m-%d") }} {{ datetime|strftime("%u") }} - {{ "now"|strftime }} + {{ "tomorrow"|strftime }} sequence Ensure that parsed data is a sequence.
Separated fuzzy dates from non-fuzzy in strftime Jinja example
saltstack_salt
train
py
41c399e63c1c1ec7ca189806eef722dab6597c84
diff --git a/proxy_mount.go b/proxy_mount.go index <HASH>..<HASH> 100644 --- a/proxy_mount.go +++ b/proxy_mount.go @@ -128,8 +128,8 @@ func (self *ProxyMount) OpenWithType(name string, req *http.Request, requestBody } else if err == io.EOF { log.Debugf(" fixed-length request body (%d bytes)", buf.Len()) newReq.Body = ioutil.NopCloser(&buf) - newReq.Header.Set(`Content-Length`, fmt.Sprintf("%d", buf.Len())) - newReq.Header.Set(`Transfer-Encoding`, `identity`) + newReq.ContentLength = int64(buf.Len()) + newReq.TransferEncoding = []string{`identity`} } else { return nil, err }
proxy: Fixing transfer-encoding/content-length
ghetzel_diecast
train
go
41d438b47e8ee83a66705f6c04106662e6ea922f
diff --git a/lib/linguist/repository.rb b/lib/linguist/repository.rb index <HASH>..<HASH> 100644 --- a/lib/linguist/repository.rb +++ b/lib/linguist/repository.rb @@ -126,12 +126,13 @@ module Linguist end protected + MAX_TREE_SIZE = 100_000 def compute_stats(old_commit_oid, cache = nil) - old_tree = old_commit_oid && Rugged::Commit.lookup(repository, old_commit_oid).tree + return {} if current_tree.count_recursive(MAX_TREE_SIZE) >= MAX_TREE_SIZE + old_tree = old_commit_oid && Rugged::Commit.lookup(repository, old_commit_oid).tree read_index - diff = Rugged::Tree.diff(repository, old_tree, current_tree) # Clear file map and fetch full diff if any .gitattributes files are changed
repository: Do not attempt to scan large repos
github_linguist
train
rb
45c597309274bd4502c66e75087ac9a2108d89ce
diff --git a/concrete/config/concrete.php b/concrete/config/concrete.php index <HASH>..<HASH> 100644 --- a/concrete/config/concrete.php +++ b/concrete/config/concrete.php @@ -1140,4 +1140,12 @@ return [ 'class' => Concrete\Core\System\Mutex\FileLockMutex::class, ], ], + + 'social' => [ + 'additional_services' => [ + // Add here a list of arrays like this: + // ['service_handle', 'Service Name', 'icon'] + // Where 'icon' is the handle of a FontAwesome 4 icon (see https://fontawesome.com/v4.7.0/icons/ ) + ], + ], ];
Add some comments about how to add/customize Social links
concrete5_concrete5
train
php
1926f8c9307ea4b24882afc71a096a74b9e376d4
diff --git a/src/Visitor/Polyfill/CustomOperators.php b/src/Visitor/Polyfill/CustomOperators.php index <HASH>..<HASH> 100644 --- a/src/Visitor/Polyfill/CustomOperators.php +++ b/src/Visitor/Polyfill/CustomOperators.php @@ -52,7 +52,7 @@ trait CustomOperators private function getOperator($operator) { if (false === $this->operatorExists($operator)) { - throw new OperatorNotFoundException($operator, 'Operator "%s" does not exist.'); + throw new OperatorNotFoundException($operator, sprintf('Operator "%s" does not exist.', $operator)); } $handle = &$this->operators[$operator];
Fix CustomOperators when the operator isn't found
K-Phoen_rulerz
train
php
bb8990e8d0373b3b8b723a0d02539da084c96a38
diff --git a/redisson/src/main/java/org/redisson/misc/URIBuilder.java b/redisson/src/main/java/org/redisson/misc/URIBuilder.java index <HASH>..<HASH> 100644 --- a/redisson/src/main/java/org/redisson/misc/URIBuilder.java +++ b/redisson/src/main/java/org/redisson/misc/URIBuilder.java @@ -70,10 +70,17 @@ public class URIBuilder { throw new IOException(e); } } - + + private static String trimIpv6Brackets(String host) { + if (host.startsWith("[") && host.endsWith("]")) { + return host.substring(1, host.length() - 1); + } + return host; + } + public static boolean compare(InetSocketAddress entryAddr, URI addr) { - if (((entryAddr.getHostName() != null && entryAddr.getHostName().equals(addr.getHost())) - || entryAddr.getAddress().getHostAddress().equals(addr.getHost())) + if (((entryAddr.getHostName() != null && entryAddr.getHostName().equals(trimIpv6Brackets(addr.getHost()))) + || entryAddr.getAddress().getHostAddress().equals(trimIpv6Brackets(addr.getHost()))) && entryAddr.getPort() == addr.getPort()) { return true; }
Fix URIBuilder compare method for IPv6 hosts
redisson_redisson
train
java
ef95387fedbd634c730ffd5fc813a75fcfee2e88
diff --git a/src/main/java/org/jfrog/hudson/release/gradle/GradleReleaseAction.java b/src/main/java/org/jfrog/hudson/release/gradle/GradleReleaseAction.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jfrog/hudson/release/gradle/GradleReleaseAction.java +++ b/src/main/java/org/jfrog/hudson/release/gradle/GradleReleaseAction.java @@ -175,6 +175,10 @@ public class GradleReleaseAction extends ReleaseAction { if (StringUtils.isBlank(version)) { version = extractNumericVersion(nextIntegProps.values()); } + if (StringUtils.isBlank(version)) { + return releaseProps.values().isEmpty() ? + releaseProps.values().iterator().next() : nextIntegProps.values().iterator().next(); + } return version; }
HAP-<I>: Properties should be split to release and next development properties
jenkinsci_artifactory-plugin
train
java
20c012c9accec67957447dc50bffb7b2c1427f77
diff --git a/spyderlib/widgets/browser.py b/spyderlib/widgets/browser.py index <HASH>..<HASH> 100644 --- a/spyderlib/widgets/browser.py +++ b/spyderlib/widgets/browser.py @@ -107,9 +107,8 @@ class WebBrowser(QWidget): self.find_widget.set_editor(self.webview) self.find_widget.hide() - find_button = create_toolbutton(self, + find_button = create_toolbutton(self, icon='find.png', tip=translate("FindReplace", "Find text"), - shortcut="Ctrl+F", icon='find.png', toggled=self.toggle_find_widget) self.connect(self.find_widget, SIGNAL("visibility_changed(bool)"), find_button.setChecked)
Web browser widget/bugfix with Spyder's main window: solved shortcut conflict
spyder-ide_spyder
train
py
818d737f0c1a308fe29d1c81dcb1aff31b852761
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -110,10 +110,13 @@ todo_include_todos = False # -- Options for HTML output ---------------------------------------------- +# docs say setting this will enable the standard RTD theme and that it +# doesn't matter what it was set to. +html_style = 'sphinx_rtd_theme' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'alabaster' +html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the
Enhancement: Default RTD theming
TestInABox_stackInABox
train
py
f8dedd53b04304234199505855f7e958d0a94c02
diff --git a/sharding-core/src/main/java/io/shardingjdbc/core/parsing/parser/sql/dml/insert/InsertStatement.java b/sharding-core/src/main/java/io/shardingjdbc/core/parsing/parser/sql/dml/insert/InsertStatement.java index <HASH>..<HASH> 100644 --- a/sharding-core/src/main/java/io/shardingjdbc/core/parsing/parser/sql/dml/insert/InsertStatement.java +++ b/sharding-core/src/main/java/io/shardingjdbc/core/parsing/parser/sql/dml/insert/InsertStatement.java @@ -46,7 +46,7 @@ import java.util.List; */ @Getter @Setter -@ToString +@ToString(callSuper = true) public final class InsertStatement extends DMLStatement { private final Collection<Column> columns = new LinkedList<>();
for #<I>, add toString with super with InsertStatement
apache_incubator-shardingsphere
train
java
e6a09567cc2755976eda3a55599c4d50d28a29ad
diff --git a/docs/components/Header.js b/docs/components/Header.js index <HASH>..<HASH> 100644 --- a/docs/components/Header.js +++ b/docs/components/Header.js @@ -13,6 +13,7 @@ class Header extends React.Component { <nav style={styles.nav}> <Link style={styles.navLink} to='/'>Home</Link> + <Link style={styles.navLink} to='/components/'>Change Log</Link> <Link style={styles.navLink} to='/components'>Components</Link> <a href='http://github.com/mxenabled/mx-react-components' style={styles.navLink}>Github</a> </nav>
Adds link to Change log in header
mxenabled_mx-react-components
train
js
4111de4e152d678de30afb7f87dcec9d65ab0756
diff --git a/activerecord/lib/active_record/type/value.rb b/activerecord/lib/active_record/type/value.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/type/value.rb +++ b/activerecord/lib/active_record/type/value.rb @@ -3,8 +3,7 @@ module ActiveRecord class Value # :nodoc: attr_reader :precision, :scale, :limit - # Valid options are +precision+, +scale+, and +limit+. They are only - # used when dumping schema. + # Valid options are +precision+, +scale+, and +limit+. def initialize(options = {}) options.assert_valid_keys(:precision, :scale, :limit) @precision = options[:precision]
Remove incorrect comment in ActiveRecord::Type::Value Says it's only used for the schema, but they are in fact used for other things. Integer verifies against the limit during casting, and Decimal uses precision during casting. It may be true that scale is only used for the schema.
rails_rails
train
rb
73c53299dd5f60198faf49fc882af3d586e4a8d7
diff --git a/gormigrate_test.go b/gormigrate_test.go index <HASH>..<HASH> 100644 --- a/gormigrate_test.go +++ b/gormigrate_test.go @@ -7,6 +7,7 @@ import ( "github.com/jinzhu/gorm" _ "github.com/joho/godotenv/autoload" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) var databases []database @@ -318,7 +319,7 @@ func forEachDatabase(t *testing.T, fn func(database *gorm.DB)) { for _, database := range databases { db, err := gorm.Open(database.name, os.Getenv(database.connEnv)) - assert.NoError(t, err, "Could not connect to database %s, %v", database.name, err) + require.NoError(t, err, "Could not connect to database %s, %v", database.name, err) defer db.Close()
Require a connection to the DB in tests
go-gormigrate_gormigrate
train
go
ca499633d40478535e9a605ddae3a63badd0b63f
diff --git a/pysat/_instrument.py b/pysat/_instrument.py index <HASH>..<HASH> 100644 --- a/pysat/_instrument.py +++ b/pysat/_instrument.py @@ -3032,6 +3032,14 @@ class Instrument(object): kwargs["start"] = start kwargs["stop"] = stop + # Add the user-supplied kwargs + rtn_key = 'list_remote_files' + if rtn_key in self.kwargs.keys(): + for user_key in self.kwargs[rtn_key].keys(): + # Don't overwrite kwargs supplied directly to this routine + if user_key not in kwargs.keys(): + kwargs[user_key] = self.kwargs[rtn_key][user_key] + # Return the function call return self._list_remote_files_rtn(self.tag, self.inst_id, **kwargs)
BUG: re-added application of user kwargs Re-added the assignment of user kwargs at the Instrument level to the downstream methods.
rstoneback_pysat
train
py
6a755548e97362d781b1f154607c02fd03fc5727
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ extras = { setup( name="AtomicPuppy", - version="0.4.1", + version="0.5.0", packages=find_packages(), dependency_links=[ "git+https://github.com/OddBloke/HTTPretty.git@f899d1bda8234658c2cec5aab027cb5b7c42203c#egg=HTTPretty" @@ -34,7 +34,6 @@ setup( install_requires=install_requires, tests_require=tests_require, url='https://github.com/madedotcom/atomicpuppy', - download_url='https://github.com/madedotcom/atomicpuppy/tarball/0.3.pre', description='A service-activator component for eventstore', author='Bob Gregory', author_email='[email protected]',
Bumping version for the unclosed session error fix by palankai
madedotcom_atomicpuppy
train
py
db74e4785e2982d0a66f3c740490fabe00888c30
diff --git a/Library/Call.php b/Library/Call.php index <HASH>..<HASH> 100644 --- a/Library/Call.php +++ b/Library/Call.php @@ -249,7 +249,8 @@ class Call throw new CompilerException('Named parameter "' . $parameter['name'] . '" is not a valid parameter name, available: ' . join(', ', array_keys($positionalParameters)), $parameter['parameter']); } } - for ($i = 0; $i < count($parameters); $i++) { + $parameters_count = count($parameters); + for ($i = 0; $i < $parameters_count; $i++) { if (!isset($orderedParameters[$i])) { $orderedParameters[$i] = array('parameter' => array('type' => 'null')); }
Improves performance of the getResolveParamsAsExp method
phalcon_zephir
train
php
feee0b2f69aee89ff6992cfcb66273129238b477
diff --git a/lib/whiskers.js b/lib/whiskers.js index <HASH>..<HASH> 100644 --- a/lib/whiskers.js +++ b/lib/whiskers.js @@ -27,17 +27,26 @@ var whiskers = (function() { return getValue(obj, key) || []; }; + var getPartial = function(partials, key) { + // drop trailing whitespace in partial + var partial = getValue(partials, key).replace(/\s+$/, ''); + //delete partials[key]; + return partial; + }; + // expand all partials + // XXX expanding partials at compile time means recursion is impossible + // but i think it's worth it to have them compiled var expand = function(template, partials) { var partial; - template = template.replace(/(\\*){>([\w.]+)}/g, function(str, escapeChar, partialKey) { + template = template.replace(/(\\*){>([\w.]+)}/g, function(str, escapeChar, key) { // if tag is escaped return it untouched with first backslash removed if (escapeChar) return str.replace('\\', ''); // drop trailing whitespace in partial - partial = getValue(partials, partialKey).replace(/\s+$/, ''); - // send back to expand to recurse - //return expand(partial, partials); - return partial; + //partial = getValue(partials, key).replace(/\s+$/, ''); + partial = getPartial(partials, key); + // send back to expand in case there are partials in this partial + return expand(partial, partials); }); return template; };
Deep partials supported, but recursion not so much
gsf_whiskers.js
train
js