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
e31ff8ce2b4780d067a021010f383232350918f9
diff --git a/src/tuwien/auto/calimero/cemi/CEMILDataEx.java b/src/tuwien/auto/calimero/cemi/CEMILDataEx.java index <HASH>..<HASH> 100644 --- a/src/tuwien/auto/calimero/cemi/CEMILDataEx.java +++ b/src/tuwien/auto/calimero/cemi/CEMILDataEx.java @@ -406,6 +406,8 @@ public class CEMILDataEx extends CEMILData implements Cloneable final StringBuilder buf = new StringBuilder(s.length() + 30); final int split = s.indexOf(','); buf.append(s.substring(0, split + 1)); + if ((ctrl2 & 0x04) == 0x04) + buf.append(" LTE"); for (int i = 0; i < addInfo.length; ++i) { final byte[] info = addInfo[i]; if (info != null)
Indicate lte frame in toString()
calimero-project_calimero-core
train
java
b075eb8e61858d861d45309a676c09c0ff232ca2
diff --git a/lib/weblib.php b/lib/weblib.php index <HASH>..<HASH> 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1580,7 +1580,7 @@ function get_emoticons_list_for_help_file() { * @global object * @param string $text The string to convert. * @param boolean $smiley Convert any smiley characters to smiley images? - * @param boolean $para If true then the returned string will be wrapped in paragraph tags + * @param boolean $para If true then the returned string will be wrapped in div tags * @param boolean $newlines If true then lines newline breaks will be converted to HTML newline breaks. * @return string */ @@ -1609,9 +1609,10 @@ function text_to_html($text, $smiley=true, $para=true, $newlines=true) { replace_smilies($text); } -/// Wrap the whole thing in a paragraph tag if required +/// Wrap the whole thing in a div if required if ($para) { - return '<p>'.$text.'</p>'; + //return '<p>'.$text.'</p>'; //1.9 version + return '<div class="text_to_html">'.$text.'</div>'; } else { return $text; }
user profiles MDL-<I> prevent ul tags in user profiles leading to invalid xhtml
moodle_moodle
train
php
c234d1e32ad7f9c85ef85b5a43c944ddc2c79535
diff --git a/src/Nether/Database/Query.php b/src/Nether/Database/Query.php index <HASH>..<HASH> 100755 --- a/src/Nether/Database/Query.php +++ b/src/Nether/Database/Query.php @@ -291,17 +291,21 @@ class Query { return $this; } - public function Where() { + public function Where($cond) { /*// @argv string Condition, ... @return object mark down a condition for the WHERE clause. //*/ - $this->Conditions = array_merge( - $this->Conditions, - func_get_args() - ); + if(!is_array($cond)) { + $this->Conditions[] = $cond; + } else { + $this->Conditions = array_merge( + $this->Conditions, + $cond + ); + } return $this; }
testing modified Where method. now instead of accepting an infinite long list because that was stupid, it accepts 1 item. if you give it just a string it will append the condition like before. but if you give it an array, and more specifically, an associative array, we can have array merge change where conditions that you may have named and want to overwrite later in some crazy ass plugin system or something
netherphp_database
train
php
1bf8bb3c22f435b8b7a68db6e7dcb60bb03a53ba
diff --git a/.versionrc.js b/.versionrc.js index <HASH>..<HASH> 100644 --- a/.versionrc.js +++ b/.versionrc.js @@ -20,8 +20,8 @@ module.exports = { tag: true, }, scripts: { - prerelease: - 'node utils/remove_version_suffix.js && node utils/generate_version_file.js', - postbump: 'IS_RELEASE=true npm run doc && git add --update', + prerelease: 'node utils/remove_version_suffix.js', + postbump: + 'node utils/generate_version_file.js && IS_RELEASE=true npm run doc && git add --update', }, };
chore: fix version generation during release (#<I>)
GoogleChrome_puppeteer
train
js
52c6c93a757a19ea955d2ade2ce20d7b6baf1312
diff --git a/revuo/tests.py b/revuo/tests.py index <HASH>..<HASH> 100644 --- a/revuo/tests.py +++ b/revuo/tests.py @@ -18,5 +18,4 @@ class PortalTest(LiveServerTestCase): home page test at / """ self.browser.get(self.live_server_url + '/') - title = self.browser.find_element_by_tag_name('title') - self.assertIn('Home', title.text) + self.assertIn('Home', self.browser.title)
fix: getting page title in home test
Lasanha_revuo
train
py
a916a8a8e33812f4aaa5aa21004e08f431aad4f0
diff --git a/zap/src/main/java/org/parosproxy/paros/db/RecordAlert.java b/zap/src/main/java/org/parosproxy/paros/db/RecordAlert.java index <HASH>..<HASH> 100644 --- a/zap/src/main/java/org/parosproxy/paros/db/RecordAlert.java +++ b/zap/src/main/java/org/parosproxy/paros/db/RecordAlert.java @@ -25,6 +25,7 @@ // ZAP: 2016/10/11 Issue 2592: Differentiate the source of alerts // ZAP: 2019/06/01 Normalise line endings. // ZAP: 2019/06/05 Normalise format/style. +// ZAP: 2019/10/10 Remove old alert update that split the param/attack. package org.parosproxy.paros.db; public class RecordAlert { @@ -92,12 +93,6 @@ public class RecordAlert { setCweId(cweId); setWascId(wascId); setSourceId(sourceId); - - if ((attack == null || attack.length() == 0) && param.indexOf("=") > 0) { - // 'old' alerts will have attack in the param field - setAttack(param.substring(param.indexOf("=") + 1)); - setParam(param.substring(0, param.indexOf("="))); - } } /** @return Returns the alert. */
Remove old alert update No longer split the parameter into parameter/attack as the alerts are now raised with both fields. Fix #<I> - Alert parameter might not be properly loaded
zaproxy_zaproxy
train
java
ff8601e9af1b271c3fc6d087386f374dd2df20a6
diff --git a/manager/allocator/networkallocator/networkallocator.go b/manager/allocator/networkallocator/networkallocator.go index <HASH>..<HASH> 100644 --- a/manager/allocator/networkallocator/networkallocator.go +++ b/manager/allocator/networkallocator/networkallocator.go @@ -434,7 +434,7 @@ func (na *NetworkAllocator) allocatePools(n *api.Network) (map[string]string, er } if ipamConfigs == nil { - ipamConfigs = append(ipamConfigs, &api.IPAMConfig{}) + ipamConfigs = append(ipamConfigs, &api.IPAMConfig{Family: api.IPAMConfig_IPV4}) } }
Update the family field correctly for auto subnets For networks which are created without a subnets, a default subnet in ipv4 is auto-generated. The auto-generated IPAM config needs to populate the address family with the right value which this PR addresses.
docker_swarmkit
train
go
80e033eb16a786a882039a651dc40b6b29d27f51
diff --git a/builtin/providers/chef/provider_test.go b/builtin/providers/chef/provider_test.go index <HASH>..<HASH> 100644 --- a/builtin/providers/chef/provider_test.go +++ b/builtin/providers/chef/provider_test.go @@ -19,12 +19,12 @@ import ( // tests work: // CHEF_SERVER_URL to the base URL as described above. // CHEF_CLIENT_NAME to the name of the client object you created. -// CHEF_PRIVATE_KEY_FILE to the path to the private key file you created. +// CHEF_KEY_MATERIAL the key file contents. // // You will probably need to edit the global permissions on your Chef // Server account to allow this client (or all clients, if you're lazy) // to have both List and Create access on all types of object: -// https://manage.chef.io/organizations/saymedia/global_permissions +// https://manage.chef.io/organizations/yourorg/global_permissions // // With all of that done, you can run like this: // make testacc TEST=./builtin/providers/chef
provider/chef: Updating the provider_test comments to remove a company name (#<I>)
hashicorp_terraform
train
go
9ddf76952d010c5e9de8ab29a48130a599627d40
diff --git a/lib/mdspell.rb b/lib/mdspell.rb index <HASH>..<HASH> 100644 --- a/lib/mdspell.rb +++ b/lib/mdspell.rb @@ -15,10 +15,10 @@ module MdSpell # Spell-check each file. cli.files.each do |filename| - verbose "Spell-checking #{filename}..." - spell_checker = SpellChecker.new(filename) + verbose "Spell-checking #{spell_checker.filename}..." + spell_checker.typos.each do |typo| error "#{spell_checker.filename}:#{typo.line.location}: #{typo.word}" end
Display verbose messages after reading from stdin.
mtuchowski_mdspell
train
rb
ffc2c1d3b3c7274d20019deb5e21d833556e7d56
diff --git a/src/WindowBase.js b/src/WindowBase.js index <HASH>..<HASH> 100644 --- a/src/WindowBase.js +++ b/src/WindowBase.js @@ -315,7 +315,7 @@ parentPort.on('message', m => { case 'runAsync': { let result, err; try { - result = window.onrunasync ? window.onrunasync(m.jsString) : null; + result = window.onrunasync ? window.onrunasync(m.request) : null; } catch(e) { err = e.stack; }
Bugfix tickAnimationFrame handling in WindowBase
exokitxr_exokit
train
js
3ffb8118b8bdc9f97b44dd288b5d782f983e335b
diff --git a/src/main/java/com/turn/ttorrent/common/AnnounceableTorrentImpl.java b/src/main/java/com/turn/ttorrent/common/AnnounceableTorrentImpl.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/turn/ttorrent/common/AnnounceableTorrentImpl.java +++ b/src/main/java/com/turn/ttorrent/common/AnnounceableTorrentImpl.java @@ -30,7 +30,7 @@ public class AnnounceableTorrentImpl implements AnnounceableFileTorrent { } @Override - public String getRealFilePath() { + public String getDownloadDirPath() { return myRealFilePath; } diff --git a/src/main/java/com/turn/ttorrent/common/FileTorrent.java b/src/main/java/com/turn/ttorrent/common/FileTorrent.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/turn/ttorrent/common/FileTorrent.java +++ b/src/main/java/com/turn/ttorrent/common/FileTorrent.java @@ -2,7 +2,7 @@ package com.turn.ttorrent.common; public interface FileTorrent { - String getRealFilePath(); + String getDownloadDirPath(); String getDotTorrentFilePath();
TW-<I> Artifacts of old builds cannot be downloaded via torrent (limit on the number of seeded artifacts) renamed interface method
mpetazzoni_ttorrent
train
java,java
23eee56c0ac4a9a55f4801364e684c0db62370c6
diff --git a/lib/puppet/resource_api/version.rb b/lib/puppet/resource_api/version.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/resource_api/version.rb +++ b/lib/puppet/resource_api/version.rb @@ -1,5 +1,5 @@ module Puppet module ResourceApi - VERSION = '1.8.13'.freeze + VERSION = '1.8.14'.freeze end end
(packaging) Bump to version '<I>' [no-promote]
puppetlabs_puppet-resource_api
train
rb
7ed5bd3b4dc9c2ca03564069402b1d74d9d6078e
diff --git a/src/cli/init.js b/src/cli/init.js index <HASH>..<HASH> 100644 --- a/src/cli/init.js +++ b/src/cli/init.js @@ -79,5 +79,23 @@ module.exports = function() { fs.writeFileSync('data/bot.log', '') fs.writeFileSync('data/notification.json', '[]') + const install = spawn('npm', ['install']) + + install.stdout.on('data', (data) => { + process.stdout.write(data.toString()) + }) + + install.stderr.on('data', (data) => { + process.stdout.write(data.toString()) + }) + + install.on('close', (code) => { + if(code > 0) { + console.log(chalk.red('FAILED')) + } else { + console.log(chalk.green('SUCCESS')) + console.log(nextStepText) + } + }) }) }
running npm install in init
botpress_botpress
train
js
16c1887f4c55eba9625bf655a7813bb7b463cdd4
diff --git a/protocol-designer/src/step-forms/reducers/index.js b/protocol-designer/src/step-forms/reducers/index.js index <HASH>..<HASH> 100644 --- a/protocol-designer/src/step-forms/reducers/index.js +++ b/protocol-designer/src/step-forms/reducers/index.js @@ -194,8 +194,8 @@ export const savedStepForms = ( // migrate old kebab-case keys to camelCase const cleanedLoadedStepForms = mapValues(loadedStepForms, (stepForm) => ({ ...omit(stepForm, ['step-name', 'step-details']), - stepName: stepForm['step-name'], - stepDetails: stepForm['step-details'], + stepName: stepForm.stepName || stepForm['step-name'], + stepDetails: stepForm.stepDetails || stepForm['step-details'], })) return mapValues(cleanedLoadedStepForms, stepForm => ({
fix(protocol-designer): migrate old and new step names and descriptions (#<I>)
Opentrons_opentrons
train
js
37c865687b64866b9295e5a3347e5747853db937
diff --git a/packages/cloudapi-gql/src/schema/resolvers.js b/packages/cloudapi-gql/src/schema/resolvers.js index <HASH>..<HASH> 100644 --- a/packages/cloudapi-gql/src/schema/resolvers.js +++ b/packages/cloudapi-gql/src/schema/resolvers.js @@ -115,7 +115,7 @@ const resolvers = { networks: ({ networks }) => Promise.all(networks.map(id => resolvers.Query.network(null, { id }))), // eslint-disable-next-line camelcase - package: (root) => resolvers.Query.package(null, { name: root.package }), + package: root => resolvers.Query.package(null, { name: root.package }), snapshots: ({ id }, { name }) => resolvers.Query.snapshots(null, { machine: id, name }), // eslint-disable-next-line camelcase
feat(cloudapi-gql): resolve Machine package
yldio_joyent-portal
train
js
c2a40ac11aa260c70064225f26892455f06d2dc2
diff --git a/src/Response.php b/src/Response.php index <HASH>..<HASH> 100644 --- a/src/Response.php +++ b/src/Response.php @@ -7,8 +7,12 @@ namespace Dietcube; +use Dietcube\Components\LoggerAwareTrait; + class Response { + use LoggerAwareTrait; + /** @const array Map of standard HTTP status code/reason phrases */ const PHRASES = [ 100 => 'Continue',
Fix: Response should be LoggerAware
mercari_dietcube
train
php
6d40a2cf65ddbed4542b2519a1589f32ef6cf450
diff --git a/spyder/plugins/editor.py b/spyder/plugins/editor.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/editor.py +++ b/spyder/plugins/editor.py @@ -2799,13 +2799,12 @@ class Editor(SpyderPluginWidget): index_first_file = filenames.index(cfname) filenames.pop(index_first_file) filenames.insert(0, cfname) + clines_first_file = clines[index_first_file] + clines.pop(index_first_file) + clines.insert(0, clines_first_file) else: cfname = filenames[0] index_first_file = 0 - if index_first_file != 0: - clines_0 = clines[0] - clines.pop(index_first_file) - clines.insert(0, clines_0) reordered_splitsettings.append((is_vertical, cfname, clines)) layout['splitsettings'] = reordered_splitsettings self.set_option('layout_settings', layout)
Rearrange the line count when opening files.
spyder-ide_spyder
train
py
4adc5b66dfe42dc0ce49b50df61058f81aaa1ae0
diff --git a/test/ember_extension/promise_test.js b/test/ember_extension/promise_test.js index <HASH>..<HASH> 100644 --- a/test/ember_extension/promise_test.js +++ b/test/ember_extension/promise_test.js @@ -230,8 +230,14 @@ test("Chained promises", function() { andThen(function() { var rows = findByLabel('promise-item'); - equal(rows.length, 2); + equal(rows.length, 1, 'Collpased by default'); equal(findByLabel('promise-label', rows.eq(0)).text().trim(), 'Parent'); + return clickByLabel('promise-label', rows.eq(0)); + }); + + andThen(function() { + var rows = findByLabel('promise-item'); + equal(rows.length, 2, 'Chain now expanded'); equal(findByLabel('promise-label', rows.eq(1)).text().trim(), 'Child'); }); });
Fix test after collapsing fulfilled promises by default
emberjs_ember-inspector
train
js
cd44b29023443ae9d83312930b69d6b6572c7054
diff --git a/packages-api/webiny-api/tests/entityEndpoint.test.js b/packages-api/webiny-api/tests/entityEndpoint.test.js index <HASH>..<HASH> 100644 --- a/packages-api/webiny-api/tests/entityEndpoint.test.js +++ b/packages-api/webiny-api/tests/entityEndpoint.test.js @@ -105,7 +105,7 @@ describe("Entity endpoint test", () => { .get("/crud/users") .query({}) .then(({ body }) => { - const search = body.data.meta.search; + expect(body.data.meta.search).to.equal(null); }); await request(app)
test(entity endpoint): improve test coverage for search feature. affects: webiny-api ISSUES CLOSED: #<I>
Webiny_webiny-js
train
js
bb92527c3f57feaa5081cea0d3dc7c428c0c7c31
diff --git a/libkbfs/folder_branch_ops.go b/libkbfs/folder_branch_ops.go index <HASH>..<HASH> 100644 --- a/libkbfs/folder_branch_ops.go +++ b/libkbfs/folder_branch_ops.go @@ -3341,6 +3341,10 @@ func (fbo *folderBranchOps) Truncate( fbo.blockLock.Lock(lState) defer fbo.blockLock.Unlock(lState) + if err := fbo.maybeWaitOnDeferredWritesLocked(ctx, lState); err != nil { + return err + } + filePath, err := fbo.pathFromNodeForWriteLocked(file) if err != nil { return err
folder_branch_ops: maybe wait on truncates too Suggested by @akalin-keybase Issue: #<I>
keybase_client
train
go
33825666b7995a81e497f08716972f35d393e4de
diff --git a/cmsplugin_cascade/widgets.py b/cmsplugin_cascade/widgets.py index <HASH>..<HASH> 100644 --- a/cmsplugin_cascade/widgets.py +++ b/cmsplugin_cascade/widgets.py @@ -24,7 +24,7 @@ class JSONMultiWidget(widgets.MultiWidget): values = json.loads(values or '{}') for field in self.glossary_fields: if isinstance(field.widget, widgets.MultiWidget): - values[field.name] = field.widget.decompress(values.get(field.name)) + values[field.name] = field.widget.decompress(values.get(field.name, field.initial)) else: values.setdefault(field.name, field.initial) return values
MultiValueWidget can be initialized
jrief_djangocms-cascade
train
py
8d94ad621ecc759a0f7d26ec1a4583a9ac320fa5
diff --git a/tests/unit/summary/test_NextKeyComposer.py b/tests/unit/summary/test_NextKeyComposer.py index <HASH>..<HASH> 100644 --- a/tests/unit/summary/test_NextKeyComposer.py +++ b/tests/unit/summary/test_NextKeyComposer.py @@ -28,6 +28,11 @@ class MockBinningSameNext(object): ##__________________________________________________________________|| class TestNextKeyComposer(unittest.TestCase): + def test_repr(self): + binnings = (MockBinningPlusOneNext(), MockBinningPlusOneNext(), MockBinningPlusOneNext()) + keyComposer = summary.NextKeyComposer(binnings) + repr(keyComposer) + def test_call(self): binnings = (MockBinningPlusOneNext(), MockBinningPlusOneNext(), MockBinningPlusOneNext()) keyComposer = summary.NextKeyComposer(binnings)
update TestNextKeyComposer, making coverage <I>%
alphatwirl_alphatwirl
train
py
6beca2f7ef176096f80bce3d4cc75bbe594b8f6a
diff --git a/glue/pipeline.py b/glue/pipeline.py index <HASH>..<HASH> 100644 --- a/glue/pipeline.py +++ b/glue/pipeline.py @@ -192,7 +192,7 @@ class CondorJob: """ return self.__short_options - def add_ini_opts(self, cp, section): + def add_ini_opts(self, cp, section, doZip=False): """ Parse command line options from a given section in an ini file and pass to the executable. @@ -202,6 +202,8 @@ class CondorJob: for opt in cp.options(section): arg = string.strip(cp.get(section,opt)) self.__options[opt] = arg + if doZip: + self.__options['write-compress'] = None def set_notification(self, value): """
Adding a doZip option to CondorJob:add_ini_options() to add a --write-compress option when doZip is True. Merging changes between <I> and <I> on cbc_s5_1yr_<I> branch onto head.
gwastro_pycbc-glue
train
py
02714085444fe4ce47f1243925cddc343801bd4c
diff --git a/Classes/Hooks/PageRenderer/FontLoaderHook.php b/Classes/Hooks/PageRenderer/FontLoaderHook.php index <HASH>..<HASH> 100644 --- a/Classes/Hooks/PageRenderer/FontLoaderHook.php +++ b/Classes/Hooks/PageRenderer/FontLoaderHook.php @@ -57,6 +57,7 @@ class FontLoaderHook if (count($urls) > 0 || count($families) > 0) { $config['custom']['urls'] = $urls; $config['custom']['families'] = $families; + $config['timeout'] = 2000; $params['headerData'][] = '<style>' . $this->generateCss() . '</style>'; $params['headerData'][] = '<script>' . $this->generateJavaScript($config) . '</script>'; }
[TASK] Reduce timeout for font loading
benjaminkott_bootstrap_package
train
php
85625cb1a45e187eb22a8d74b52f9661baa7e6bc
diff --git a/openquake/risk/job/general.py b/openquake/risk/job/general.py index <HASH>..<HASH> 100644 --- a/openquake/risk/job/general.py +++ b/openquake/risk/job/general.py @@ -325,6 +325,13 @@ class RiskJobMixin(mixins.Mixin): return result.items() def asset_bcr_per_site(self): + """ + Fetch and return Benefit-Cost Ratio results computed by workers. + + :return: + List of two-item tuples: site object and lists of BCR values per + asset in that site. See :func:`compute_bcr_for_block`. + """ data = [] for block_id in self.blocks_keys: key = kvs.tokens.bcr_block_key(self.job_id, block_id)
risk/job/general: documented asset_bcr_per_site()
gem_oq-engine
train
py
17888358dde4ae800a7e30608ed0ce97658bf2ce
diff --git a/doc/source/conf.py b/doc/source/conf.py index <HASH>..<HASH> 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -49,9 +49,9 @@ copyright = u'2013, The Echo Nest' # built documents. # # The short X.Y version. -version = '7.1.1' +version = '8.0.0' # The full version, including alpha/beta/rc tags. -release = '7.1.1' +release = '8.0.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.
Touch versions in conf.py
echonest_pyechonest
train
py
6569af223a6f4b6cba05d77856421161fdefac14
diff --git a/lib/jammit/compressor.rb b/lib/jammit/compressor.rb index <HASH>..<HASH> 100644 --- a/lib/jammit/compressor.rb +++ b/lib/jammit/compressor.rb @@ -135,6 +135,7 @@ module Jammit i = paths[$1] ||= "#{index += 1}-#{File.basename($1)}" "url(mhtml:#{asset_url}!#{i})" end + paths = paths.sort mhtml = paths.map do |path, identifier| mime, contents = mime_type(path), encoded_contents(path) [MHTML_SEPARATOR, "Content-Location: #{identifier}\r\n", "Content-Type: #{mime}\r\n", "Content-Transfer-Encoding: base64\r\n\r\n", contents, "\r\n"]
don't rely on hash ordering
documentcloud_jammit
train
rb
79b98fe1ca041091bb0c292274c7096f0370a5ab
diff --git a/src/Illuminate/Database/Eloquent/Relations/MorphTo.php b/src/Illuminate/Database/Eloquent/Relations/MorphTo.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Database/Eloquent/Relations/MorphTo.php +++ b/src/Illuminate/Database/Eloquent/Relations/MorphTo.php @@ -164,7 +164,7 @@ class MorphTo extends BelongsTo ? array_keys($this->dictionary[$type]) : array_map(function ($modelId) { return (string) $modelId; - }, array_keys($this->dictionary[$type])); + }, array_filter(array_keys($this->dictionary[$type]))); } /**
[8.x] Fix Eager loading partially nullable morphTo relations (#<I>) * Filter non-empty keys by type * Fix failed style check * Remove unnecessary callback
laravel_framework
train
php
7b4acb9b8366aa8966d192beeaad5e2a86303b1d
diff --git a/server/php/upload.class.php b/server/php/upload.class.php index <HASH>..<HASH> 100644 --- a/server/php/upload.class.php +++ b/server/php/upload.class.php @@ -229,7 +229,12 @@ class UploadHandler } protected function orient_image($file_path) { - $exif = exif_read_data($file_path); + $exif = @exif_read_data($file_path); + + if ($exif === false) { //if not exif exists, we don't need to continue + return false; + } + $orientation = intval(@$exif['Orientation']); if (!in_array($orientation, array(3, 6, 8))) { return false;
Prevent crash when orient_image = true and not exif image type issue #<I>
blueimp_jQuery-File-Upload
train
php
f2d84ec86941cb9b49175f12493be6848f1def5f
diff --git a/lib/utils.js b/lib/utils.js index <HASH>..<HASH> 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -43,7 +43,9 @@ var reservedWords = toObject([ '_replication_state', '_replication_state_time', '_replication_state_reason', - '_replication_stats' + '_replication_stats', + // Specific to Couchbase Sync Gateway + '_removed' ]); // List of reserved words that should end up the document
(#<I>) - Ignore _removed field This is needed to support Couchbase Sync Gateway, which adds this field when a document previously accessible by a user in a channel isn’t accessible anymore. A complete implementation of this feature would effectively delete the document locally.
pouchdb_pouchdb
train
js
aedaca0f5a0160ab72db9e0379cc6680a70e273d
diff --git a/src/Models/ObjectMap/Entities/Associations/AssociationStubBase.php b/src/Models/ObjectMap/Entities/Associations/AssociationStubBase.php index <HASH>..<HASH> 100644 --- a/src/Models/ObjectMap/Entities/Associations/AssociationStubBase.php +++ b/src/Models/ObjectMap/Entities/Associations/AssociationStubBase.php @@ -196,14 +196,15 @@ abstract class AssociationStubBase public function isOk(): bool { $required = [ - $this->multiplicity, $this->relationName, $this->keyFieldName, $this->baseType, $this->throughFieldChain ]; + $requireResult = array_filter($required, [$this, 'checkStringInput']); + $isOk = true; - $isOk &= empty(array_filter($required, 'is_null')); + $isOk &= $required == $requireResult; $isOk &= (null === $this->targType) === (null === $this->foreignFieldName); return boolval($isOk);
change isOk as felds can not be null
Algo-Web_POData-Laravel
train
php
bdbd0683c09b0928222b6299dd1e0b964f4f3038
diff --git a/karma-unit.conf.js b/karma-unit.conf.js index <HASH>..<HASH> 100644 --- a/karma-unit.conf.js +++ b/karma-unit.conf.js @@ -23,6 +23,7 @@ module.exports = function(config) { // needed for elem.find() lookup by other than tag name 'bower_components/jquery/jquery.js', + 'bower_components/marked/lib/marked.js', 'bower_components/angular/angular.js', 'bower_components/angular-mocks/angular-mocks.js',
Load marked when unit testing.
yaru22_angular-md
train
js
1ee3baf06ef59d13971a213647fafca386f62f2a
diff --git a/lib/ostatus/salmon.js b/lib/ostatus/salmon.js index <HASH>..<HASH> 100644 --- a/lib/ostatus/salmon.js +++ b/lib/ostatus/salmon.js @@ -31,6 +31,7 @@ var Sys = require('sys'), Path = require('path'), Mu = require('mu'); Base64 = require('base64'); + Crypto = require('crypto'); Buffer = require('buffer').Buffer; function unpack(body, callback) { @@ -62,7 +63,7 @@ function unpack(body, callback) { function verify_signature(data, data_type, encoding, alg, cert, signature) { var m = data + "." + base64url_encode(data_type) + "." + base64url_encode(encoding) + "." + base64url_encode(alg); - var v = crypto.createVerify('RSA-SHA256'); + var v = Crypto.createVerify('RSA-SHA256'); v.update(m); return v.verify(cert, signature); }
Fix - Salmon.js was missing crypto package
eschnou_node-ostatus
train
js
b43241bcbd547594b88311e3ea229ad1decac29f
diff --git a/src/provider.js b/src/provider.js index <HASH>..<HASH> 100644 --- a/src/provider.js +++ b/src/provider.js @@ -4,11 +4,6 @@ import {compileRoute} from './compile-route' export function provider(app) { - app.use((req, res, next) => { - res.setHeader('Access-Control-Allow-Origin', '*') - next() - }) - app.get('/swagger.json', (req, res) => { const router = app._router const stack = router ? router.stack : null
Removed CORS middleware from all calls
grindjs_swagger
train
js
2ae3d9ba5542bd8f6710e9574206dce4c749ee4f
diff --git a/app/models/manager_refresh/save_collection/saver/concurrent_safe_batch.rb b/app/models/manager_refresh/save_collection/saver/concurrent_safe_batch.rb index <HASH>..<HASH> 100644 --- a/app/models/manager_refresh/save_collection/saver/concurrent_safe_batch.rb +++ b/app/models/manager_refresh/save_collection/saver/concurrent_safe_batch.rb @@ -132,7 +132,7 @@ module ManagerRefresh::SaveCollection def map_ids_to_inventory_objects(inventory_collection, indexed_inventory_objects, hashes) inventory_collection.model_class.where( build_multi_selection_query(inventory_collection, hashes) - ).find_each do |inserted_record| + ).each do |inserted_record| inventory_object = indexed_inventory_objects[inventory_collection.unique_index_columns.map { |x| inserted_record.public_send(x) }] inventory_object.id = inserted_record.id if inventory_object end
We don't need find_each on already limited query We don't need find_each on already limited query. We limit it using array of unique indexes. (transferred from ManageIQ/manageiq@<I>d3c<I>a<I>eb0dc7e8f<I>ab4b<I>)
ManageIQ_inventory_refresh
train
rb
775406fc3f07a6f6187cbf7f6f339e7bf1ec3c56
diff --git a/src/org/opencms/search/solr/CmsSolrIndex.java b/src/org/opencms/search/solr/CmsSolrIndex.java index <HASH>..<HASH> 100644 --- a/src/org/opencms/search/solr/CmsSolrIndex.java +++ b/src/org/opencms/search/solr/CmsSolrIndex.java @@ -1228,7 +1228,7 @@ public class CmsSolrIndex extends CmsSearchIndex { resourceDocumentList, start, new Integer(rows), - end, + Math.min(end, (start + solrDocumentList.size())), rows > 0 ? (start / rows) + 1 : 0, //page - but matches only in case of equally sized pages and is zero for rows=0 (because this was this way before!?!) visibleHitCount, finalMaxScore,
Fixed issue with wrong "end" value for solr searches.
alkacon_opencms-core
train
java
1f92078ff10e48607488400f16c1e647823c0a4e
diff --git a/salt/auth/file.py b/salt/auth/file.py index <HASH>..<HASH> 100644 --- a/salt/auth/file.py +++ b/salt/auth/file.py @@ -142,6 +142,7 @@ def _get_file_auth_config(): return config + def _text(username, password, **kwargs): ''' The text file function can authenticate plaintext and digest methods
Add additional newline to pass linter
saltstack_salt
train
py
a9902795e5db07e9537416f8b9aebec27a9209bb
diff --git a/app/resonant-laboratory/scripts/populateGirder.py b/app/resonant-laboratory/scripts/populateGirder.py index <HASH>..<HASH> 100755 --- a/app/resonant-laboratory/scripts/populateGirder.py +++ b/app/resonant-laboratory/scripts/populateGirder.py @@ -180,7 +180,7 @@ if __name__ == '__main__': ignoredFiles += 1 else: fileSize = os.stat('./' + folder + '/' + item + '/' + fileName).st_size - if (fileSize > int(args.databaseThreshold)): + if (fileSize > int(args.databaseThreshold)) or os.path.splitext(fileName)[1] == '.json': createMongoCollection(args, './' + folder + '/' + item + '/', fileName) gc.sendRestRequest('POST', 'item/' + itemSpec['_id'] + '/database', {}, json.dumps({ 'url': args.mongoHost + ':' + args.mongoPort,
Temporarily force all JSON example datasets to be mongo DB items
Kitware_candela
train
py
4f091ca7d09e32bc4c5b319ce26e3dabbf0c8968
diff --git a/src/Controller/AbstractCrudController.php b/src/Controller/AbstractCrudController.php index <HASH>..<HASH> 100644 --- a/src/Controller/AbstractCrudController.php +++ b/src/Controller/AbstractCrudController.php @@ -523,12 +523,12 @@ abstract class AbstractCrudController extends AbstractController implements Crud return $responseParameters; } - private function getContext(): ?AdminContext + protected function getContext(): ?AdminContext { return $this->get(AdminContextProvider::class)->getContext(); } - private function ajaxEdit(EntityDto $entityDto, ?string $propertyName, bool $newValue): AfterCrudActionEvent + protected function ajaxEdit(EntityDto $entityDto, ?string $propertyName, bool $newValue): AfterCrudActionEvent { $this->get(EntityUpdater::class)->updateProperty($entityDto, $propertyName, $newValue);
Update ajaxEdit visility
EasyCorp_EasyAdminBundle
train
php
9f2e0ef8063d41eda6e5c369945f0b89a3e7a74e
diff --git a/lib/svtplay_dl/service/viaplay.py b/lib/svtplay_dl/service/viaplay.py index <HASH>..<HASH> 100644 --- a/lib/svtplay_dl/service/viaplay.py +++ b/lib/svtplay_dl/service/viaplay.py @@ -44,6 +44,9 @@ class Viaplay(Service, OpenGraphThumbMixin): match = re.search(r'data-videoid="([0-9]+)', html_data) if match: return match.group(1) + match = re.search(r'"mediaGuid":"([0-9]+)"', html_data) + if match: + return match.group(1) clips = False slug = None
Viaplay: Fix video-id extraction
spaam_svtplay-dl
train
py
eac5cc2e01183af9bd24b5ba9c8096c537a79ed8
diff --git a/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java b/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java index <HASH>..<HASH> 100644 --- a/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java +++ b/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java @@ -1,5 +1,5 @@ // -// $Id: SpotSceneManager.java,v 1.47 2003/11/24 20:42:22 mdb Exp $ +// $Id: SpotSceneManager.java,v 1.48 2003/12/09 20:57:14 mdb Exp $ package com.threerings.whirled.spot.server; @@ -483,7 +483,9 @@ public class SpotSceneManager extends SceneManager return; } - body.startTransaction(); + if (body.isActive()) { + body.startTransaction(); + } try { _ssobj.startTransaction(); try { @@ -499,7 +501,9 @@ public class SpotSceneManager extends SceneManager _ssobj.commitTransaction(); } } finally { - body.commitTransaction(); + if (body.isActive()) { + body.commitTransaction(); + } } // Log.debug("Removed " + bodyOid + " from "+ this + ".");
The body object might have already been destroyed by the time we get here. If so, don't start a transaction on it just let the events quietly float off into the ether. 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
c1d14e894b4e129057427fddf7ccc9ae207af7d8
diff --git a/Tests/Functional/Tools/Mapper/MapperTest.php b/Tests/Functional/Tools/Mapper/MapperTest.php index <HASH>..<HASH> 100644 --- a/Tests/Functional/Tools/Mapper/MapperTest.php +++ b/Tests/Functional/Tools/Mapper/MapperTest.php @@ -194,7 +194,7 @@ class MapperTest extends BaseTestCase ]); $this->mapper->map( - new SerializableArray(['k' => 5,]), + new SerializableArray(['k' => 5]), 'example_mapping' ); }
Remove a comma in the array of a single element
smartboxgroup_integration-framework-bundle
train
php
95cc375dbb161dc58b610fce1f139e2d582c5f50
diff --git a/src/saveSvgAsPng.js b/src/saveSvgAsPng.js index <HASH>..<HASH> 100644 --- a/src/saveSvgAsPng.js +++ b/src/saveSvgAsPng.js @@ -1,6 +1,6 @@ (function() { const out$ = typeof exports != 'undefined' && exports || typeof define != 'undefined' && {} || this || window; - if (typeof define !== 'undefined') define(() => out$); + if (typeof define !== 'undefined') define('save-svg-as-png', [], () => out$); const xmlns = 'http://www.w3.org/2000/xmlns/'; const doctype = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [<!ENTITY nbsp "&#160;">]>';
update amd module definition to not be anonymous (#<I>) older ember versions don't support anonymous amd modules, and this resolves the issue by naming the module definition and providing an empty dependency array.
exupero_saveSvgAsPng
train
js
1062b873984e7d670fa2a38f5090b8f17ae0088a
diff --git a/Kwf/Model/Tree/Row.php b/Kwf/Model/Tree/Row.php index <HASH>..<HASH> 100644 --- a/Kwf/Model/Tree/Row.php +++ b/Kwf/Model/Tree/Row.php @@ -45,7 +45,8 @@ class Kwf_Model_Tree_Row extends Kwf_Model_Proxy_Row public function getRecursiveIds() { - return $this->getModel()->getRecursiveIds($this->id); + $pk = $this->getModel()->getPrimaryKey(); + return $this->getModel()->getRecursiveIds($this->$pk); } public function getParentNode()
Support primary key other than 'id'
koala-framework_koala-framework
train
php
323695eb91d715b43d5ccfb3509cf615a9925ed9
diff --git a/addon/constants/links.js b/addon/constants/links.js index <HASH>..<HASH> 100644 --- a/addon/constants/links.js +++ b/addon/constants/links.js @@ -3,7 +3,7 @@ export default [{ name: 'Docs', type: 'dropdown', items: [{ - href: 'https://guides.emberjs.com', + href: 'https://guides.emberjs.com/release/', name: 'Ember.js Guides', type: 'link' }, {
Update the link to the guides to include release
ember-learn_ember-styleguide
train
js
f05df57c9a50c832b485c7ea38ba820273ab3da0
diff --git a/remoto/tests/test_connection.py b/remoto/tests/test_connection.py index <HASH>..<HASH> 100644 --- a/remoto/tests/test_connection.py +++ b/remoto/tests/test_connection.py @@ -92,6 +92,11 @@ class TestMakeConnectionString(object): conn_string = conn._make_connection_string('localhost', _needs_ssh=lambda x: True) assert conn_string == 'ssh=localhost//python=sudo python' + def test_makes_sudo_python_with_ssh_options(self): + conn = connection.Connection('localhost', sudo=True, eager=False, interpreter='python', ssh_options='-F vagrant_ssh_config') + conn_string = conn._make_connection_string('localhost', _needs_ssh=lambda x: True) + assert conn_string == 'ssh=-F vagrant_ssh_config localhost//python=sudo python' + def test_makes_python_no_ssh(self): conn = connection.Connection('localhost', sudo=False, eager=False, interpreter='python') conn_string = conn._make_connection_string('localhost', _needs_ssh=lambda x: False)
tests verify ssh_config options are passed in'
alfredodeza_remoto
train
py
53ac6ebbd0829a2f5b8d423255afe53b98e0ba09
diff --git a/test/GitWrapper/Test/GitCommandTest.php b/test/GitWrapper/Test/GitCommandTest.php index <HASH>..<HASH> 100644 --- a/test/GitWrapper/Test/GitCommandTest.php +++ b/test/GitWrapper/Test/GitCommandTest.php @@ -118,6 +118,8 @@ class GitCommandTest extends GitWrapperTestCase $message = $this->randomString(); $git = $this->getWorkingCopy(); + $git->config('user.email', 'opensource@chrispliakas.com'); + $git->config('user.name', 'Chris Pliakas'); $git->commit($message); $last_log = $this->_wrapper->git('log -n 1', self::WORKING_DIR);
Fixed #<I>: Fixed failing test due to missing identity.
cpliakas_git-wrapper
train
php
9685d0ff815737cd8ad308a86ce8c3cf1b4a679a
diff --git a/S3ClientStub.php b/S3ClientStub.php index <HASH>..<HASH> 100644 --- a/S3ClientStub.php +++ b/S3ClientStub.php @@ -60,6 +60,8 @@ class S3ClientStub implements S3ClientInterface $this->exceptionForUpload = null; throw $throwable; } + + return $this->actualClient->upload($bucket, $key, $bucket, $acl, $options); } public function failOnNextCopy(): void
Don't forget to forward the call
thephpleague_flysystem-aws-s3-v3
train
php
7b88832420582fe060fbaa629568bb9d917e4e67
diff --git a/validator/sawtooth_validator/journal/block_manager.py b/validator/sawtooth_validator/journal/block_manager.py index <HASH>..<HASH> 100644 --- a/validator/sawtooth_validator/journal/block_manager.py +++ b/validator/sawtooth_validator/journal/block_manager.py @@ -139,9 +139,9 @@ class _BlockIterator: block = ctypes.py_object() - _pylibexec("{}_next".format(self.name), - self._c_iter_ptr, - ctypes.byref(block)) + _libexec("{}_next".format(self.name), + self._c_iter_ptr, + ctypes.byref(block)) if block.value is None: raise StopIteration()
Release GIL before calling next on rust iters The GIL must be released before calling next on iterators, so as not to cause deadlocks with the block manager's lock, if it needs to call to a BlockStore implementation backed by python.
hyperledger_sawtooth-core
train
py
67ba9661c5a2737045a839f80e084b03125bf24c
diff --git a/lib/Doctrine/ORM/Query/ResultSetMapping.php b/lib/Doctrine/ORM/Query/ResultSetMapping.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ORM/Query/ResultSetMapping.php +++ b/lib/Doctrine/ORM/Query/ResultSetMapping.php @@ -192,14 +192,5 @@ class ResultSetMapping { return count($this->_aliasMap); } - - - - /* TEMP */ - public function getRootAlias() - { - reset($this->_aliasMap); - return key($this->_aliasMap); - } }
[<I>] Some cleanups.
doctrine_annotations
train
php
22ab8c3df53a84ac0b12663597eaeeb9a5c1b4f3
diff --git a/spec/unit/provider/user/useradd_spec.rb b/spec/unit/provider/user/useradd_spec.rb index <HASH>..<HASH> 100755 --- a/spec/unit/provider/user/useradd_spec.rb +++ b/spec/unit/provider/user/useradd_spec.rb @@ -138,13 +138,6 @@ describe Puppet::Type.type(:user).provider(:useradd) do end end - describe "when adding properties" do - it "should get the valid properties" - it "should not add the ensure property" - it "should add the flag and value to an array" - it "should return and array of flags and values" - end - describe "#addcmd" do before do resource[:allowdupe] = :true
(Maint) Remove unimplemented tests
puppetlabs_puppet
train
rb
1d6ebe8dd8140bc4aec4e0ef78e72471cf69c9ee
diff --git a/.buildkite/pipeline.py b/.buildkite/pipeline.py index <HASH>..<HASH> 100644 --- a/.buildkite/pipeline.py +++ b/.buildkite/pipeline.py @@ -387,8 +387,6 @@ def dagit_tests(): tests.append( StepBuilder("dagit tests ({ver})".format(ver=TOX_MAP[version])) .run( - "apt-get update", - "apt-get install -y xdg-utils", "pushd python_modules", "make rebuild_dagit", "popd",
remove apt-get steps from dagit Summary: Do we need this? Test Plan: Lets find out Reviewers: #ft, natekupp Reviewed By: #ft, natekupp Differential Revision: <URL>
dagster-io_dagster
train
py
95696162ba2373e02d97b2d6eea3d04cb228103e
diff --git a/lib/travis/api/v1/http/repository.rb b/lib/travis/api/v1/http/repository.rb index <HASH>..<HASH> 100644 --- a/lib/travis/api/v1/http/repository.rb +++ b/lib/travis/api/v1/http/repository.rb @@ -20,8 +20,8 @@ module Travis 'public_key' => repository.key.public_key, 'last_build_id' => repository.last_build_id, 'last_build_number' => repository.last_build_number, - 'last_build_status' => repository.last_build_result_on(options), - 'last_build_result' => repository.last_build_result_on(options), + 'last_build_status' => repository.last_build_result, + 'last_build_result' => repository.last_build_result, 'last_build_duration' => repository.last_build_duration, 'last_build_language' => repository.last_build_language, 'last_build_started_at' => format_date(repository.last_build_started_at),
stop respecting the branch param on the repo api (inconsistent anyway)
travis-ci_travis-core
train
rb
cbee67934c689b4fb6a2abeb1ef5b010f99c796c
diff --git a/src/LdapTools/Query/LdapQueryBuilder.php b/src/LdapTools/Query/LdapQueryBuilder.php index <HASH>..<HASH> 100644 --- a/src/LdapTools/Query/LdapQueryBuilder.php +++ b/src/LdapTools/Query/LdapQueryBuilder.php @@ -370,9 +370,7 @@ class LdapQueryBuilder */ public function addControl(LdapControl ...$controls) { - foreach ($controls as $control) { - $this->operation->addControl($control); - } + $this->operation->addControl(...$controls); return $this; }
Add controls using variadics in the Query Builder.
ldaptools_ldaptools
train
php
8b347e000722d8e082729406d41bcfd6a41b0060
diff --git a/es/ae/contract.js b/es/ae/contract.js index <HASH>..<HASH> 100644 --- a/es/ae/contract.js +++ b/es/ae/contract.js @@ -59,7 +59,8 @@ async function call (code, abi, address, name, { args = '()', options = {}, call callData: await this.contractEncodeCall(code, abi, name, args, call) })) - const { hash } = await this.send(tx, opt) + const txFromChain = await this.send(tx, opt) + const hash = typeof txFromChain === 'string' ? txFromChain : txFromChain.hash const result = await this.getTxInfo(hash) if (result.returnType === 'ok') { @@ -85,7 +86,9 @@ async function deploy (code, abi, { initState = '()', options = {} } = {}) { ownerId })) - const { hash } = await this.send(tx, opt) + const txFromChain = await this.send(tx, opt) + const hash = typeof txFromChain === 'string' ? txFromChain : txFromChain.hash + return Object.freeze({ owner: ownerId, transaction: hash,
deploy with waitMined = false
aeternity_aepp-sdk-js
train
js
14134e9738ea908b18c010dfed01b7a2364ff953
diff --git a/lib/rules/require-input-label.js b/lib/rules/require-input-label.js index <HASH>..<HASH> 100644 --- a/lib/rules/require-input-label.js +++ b/lib/rules/require-input-label.js @@ -2,7 +2,7 @@ const Rule = require('./base'); const AstNodeInfo = require('../helpers/ast-node-info'); -const iterateParents = require('../helpers/iterate-parents'); +// const iterateParents = require('../helpers/iterate-parents'); const ERROR_MESSAGE = 'Input elements require an associated label.'; @@ -25,11 +25,9 @@ module.exports = class RequireInputLabel extends Rule { // OR: // Parental validation (descriptive elements) - for (let parentPath of iterateParents(path)) { - let parentNode = parentPath.node; - if (parentNode.type === 'ElementNode' && parentNode.tag === 'label') { - return; - } + let parents = Array.from(path.parents()); + if( parents.some(parent => parent.node.type === 'ElementNode' && parent.node.tag === 'label' )){ + return; } this.log({
updating due to changes in glimmer as per review
ember-template-lint_ember-template-lint
train
js
71fa6194cf60ac9209d60802c911d552379f5bab
diff --git a/galpy/actionAngle_src/actionAngleStaeckelGrid.py b/galpy/actionAngle_src/actionAngleStaeckelGrid.py index <HASH>..<HASH> 100644 --- a/galpy/actionAngle_src/actionAngleStaeckelGrid.py +++ b/galpy/actionAngle_src/actionAngleStaeckelGrid.py @@ -241,6 +241,15 @@ class actionAngleStaeckelGrid(): order=3, prefilter=False)*(numpy.exp(self._jzLzInterp(Lz[indxc]))-10.**-5.) if numpy.sum(indx) > 0: + jrindiv, lzindiv, jzindiv= self._aA(R[indx], + vR[indx], + vT[indx], + z[indx], + vz[indx], + **kwargs) + jr[indx]= jrindiv + jz[indx]= jzindiv + """ jrindiv= numpy.empty(numpy.sum(indx)) jzindiv= numpy.empty(numpy.sum(indx)) for ii in range(numpy.sum(indx)): @@ -259,6 +268,7 @@ class actionAngleStaeckelGrid(): jzindiv[ii]= numpy.nan jr[indx]= jrindiv jz[indx]= jzindiv + """ else: jr,Lz, jz= self(numpy.array([R]), numpy.array([vR]),
better off-the-grid evaluations for staeckel potential
jobovy_galpy
train
py
165b1751e0193a9d0354ce0d592de9b295a0263d
diff --git a/utp.go b/utp.go index <HASH>..<HASH> 100644 --- a/utp.go +++ b/utp.go @@ -1345,12 +1345,11 @@ func (c *Conn) writeFin() { } func (c *Conn) destroy(reason error) { - if c.closed { - return - } c.closed = true c.event.Broadcast() - c.err = reason + if c.err == nil { + c.err = reason + } } func (c *Conn) Close() (err error) {
Rework conn.destroy method
anacrolix_utp
train
go
06d8b956c62fea49002073bc6a51aa5d5c3ac3a8
diff --git a/lib/node-progress.js b/lib/node-progress.js index <HASH>..<HASH> 100644 --- a/lib/node-progress.js +++ b/lib/node-progress.js @@ -98,7 +98,7 @@ ProgressBar.prototype.tick = function(len, tokens){ // progress complete if (this.curr >= this.total) { - this.render(); + this.render(undefined, true); this.complete = true; this.terminate(); this.callback(this); @@ -114,14 +114,14 @@ ProgressBar.prototype.tick = function(len, tokens){ * @api public */ -ProgressBar.prototype.render = function (tokens) { +ProgressBar.prototype.render = function (tokens, force = false) { if (tokens) this.tokens = tokens; if (!this.stream.isTTY) return; var now = Date.now(); var delta = now - this.lastRender; - if (delta < this.renderThrottle) { + if (!force && (delta < this.renderThrottle)) { return; } else { this.lastRender = now;
Add force option to render and use it on complete
visionmedia_node-progress
train
js
2102ae4b31f6aeb9f9f773c3e5b8c7e7afcc93e8
diff --git a/core-bundle/src/Resources/contao/classes/Theme.php b/core-bundle/src/Resources/contao/classes/Theme.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/classes/Theme.php +++ b/core-bundle/src/Resources/contao/classes/Theme.php @@ -495,6 +495,10 @@ class Theme extends \Backend $intNextPid = $objModel->id; } + else + { + $intNextPid = $objParent->id; // see #4952 + } } $this->syncNewFolder($strFolder, $intNextPid);
[Core] Handle existing folders during a theme import (see #<I>)
contao_contao
train
php
6174dfdb252ceda613cdcf58a6f939349c02bec3
diff --git a/lib/Addr/Client.php b/lib/Addr/Client.php index <HASH>..<HASH> 100644 --- a/lib/Addr/Client.php +++ b/lib/Addr/Client.php @@ -216,13 +216,13 @@ class Client } if ($addr !== null) { - foreach ($request['lookups'] as $id => $lookup) { - $this->completePendingLookup($id, $addr, $type); - } - if ($request['cache_store']) { call_user_func($request['cache_store'], $name, $addr, $type, $ttl); } + + foreach ($request['lookups'] as $id => $lookup) { + $this->completePendingLookup($id, $addr, $type); + } } else { foreach ($request['lookups'] as $id => $lookup) { $this->processPendingLookup($id);
Call cache store callback before lookup callbacks
amphp_dns
train
php
8d3a268cb0fa59645c9293484bc517f5e3f45f5a
diff --git a/aiohttp/formdata.py b/aiohttp/formdata.py index <HASH>..<HASH> 100644 --- a/aiohttp/formdata.py +++ b/aiohttp/formdata.py @@ -107,7 +107,7 @@ class FormData: part = payload.get_payload( value, headers=headers, encoding=self._charset) except Exception as exc: - raise ValueError( + raise TypeError( 'Can not serialize value type: %r\n ' 'headers: %r\n value: %r' % ( type(value), headers, value)) from exc diff --git a/tests/test_formdata.py b/tests/test_formdata.py index <HASH>..<HASH> 100644 --- a/tests/test_formdata.py +++ b/tests/test_formdata.py @@ -23,6 +23,13 @@ def writer(buf): return writer +def test_invalid_formdata_payload(): + form = FormData() + form.add_field('test', object(), filename='test.txt') + with pytest.raises(TypeError): + form() + + def test_invalid_formdata_params(): with pytest.raises(TypeError): FormData('asdasf')
TypeError is better for this case
aio-libs_aiohttp
train
py,py
ef063917aad769d02c89bcdaf51d27c547daefa1
diff --git a/go/vt/sqlparser/ast.go b/go/vt/sqlparser/ast.go index <HASH>..<HASH> 100644 --- a/go/vt/sqlparser/ast.go +++ b/go/vt/sqlparser/ast.go @@ -811,12 +811,12 @@ func (node *AlterView) GetIfExists() bool { // GetIfExists implements the DDLStatement interface func (node *DropTable) GetIfExists() bool { - return false + return node.IfExists } // GetIfExists implements the DDLStatement interface func (node *DropView) GetIfExists() bool { - return false + return node.IfExists } // GetTableSpec implements the DDLStatement interface
implementing GetIfExists for DropTable and DropView
vitessio_vitess
train
go
7cc9aa36ffcb22a8a7f1577cc52781e72ed088ec
diff --git a/builder/amazon/common/step_security_group.go b/builder/amazon/common/step_security_group.go index <HASH>..<HASH> 100644 --- a/builder/amazon/common/step_security_group.go +++ b/builder/amazon/common/step_security_group.go @@ -88,11 +88,12 @@ func (s *StepSecurityGroup) Cleanup(state map[string]interface{}) { var err error for i := 0; i < 5; i++ { _, err = ec2conn.DeleteSecurityGroup(ec2.SecurityGroup{Id: s.createdGroupId}) - if err != nil { - log.Printf("Error deleting security group: %s", err) - time.Sleep(5 * time.Second) - continue + if err == nil { + break } + + log.Printf("Error deleting security group: %s", err) + time.Sleep(5 * time.Second) } if err != nil {
builder/amazon/common: correct logic in deleting secutiry group
hashicorp_packer
train
go
20641f1a7b19b1cc798cecad055306037a89f52f
diff --git a/drools-planner-core/src/main/java/org/drools/planner/core/heuristic/selector/variable/PlanningValueWalker.java b/drools-planner-core/src/main/java/org/drools/planner/core/heuristic/selector/variable/PlanningValueWalker.java index <HASH>..<HASH> 100644 --- a/drools-planner-core/src/main/java/org/drools/planner/core/heuristic/selector/variable/PlanningValueWalker.java +++ b/drools-planner-core/src/main/java/org/drools/planner/core/heuristic/selector/variable/PlanningValueWalker.java @@ -87,6 +87,10 @@ public class PlanningValueWalker implements SolverPhaseLifecycleListener { public void initWalk(Object planningEntity) { this.planningEntity = planningEntity; planningValueIterator = planningValueSelector.iterator(planningEntity); + if (!planningValueIterator.hasNext()) { + throw new IllegalStateException("The planningEntity (" + planningEntity + ") has a planning variable (" + + planningVariableDescriptor.getVariablePropertyName() + ") which has no planning values."); + } Object value = planningValueIterator.next(); planningVariableDescriptor.setValue(planningEntity, value); isFirstValue = true;
JBRULES-<I>: quick fix for devlist reported bug
kiegroup_optaplanner
train
java
9c587b6f1db8756c4502e7df7ae082a685adc636
diff --git a/test/RedisCommandsTest.php b/test/RedisCommandsTest.php index <HASH>..<HASH> 100644 --- a/test/RedisCommandsTest.php +++ b/test/RedisCommandsTest.php @@ -1289,6 +1289,24 @@ class RedisCommandTestSuite extends PHPUnit_Framework_TestCase { }); } + function testZsetReverseRank() { + $zset = RC::zsetAddAndReturn($this->redis, 'zset', RC::getZSetArray()); + + $this->assertEquals(5, $this->redis->zrevrank('zset', 'a')); + $this->assertEquals(4, $this->redis->zrevrank('zset', 'b')); + $this->assertEquals(1, $this->redis->zrevrank('zset', 'e')); + + $this->redis->zrem('zset', 'e'); + $this->assertEquals(1, $this->redis->zrevrank('zset', 'd')); + + $this->assertNull($this->redis->zrevrank('zset', 'x')); + + RC::testForServerException($this, RC::EXCEPTION_WRONG_TYPE, function($test) { + $test->redis->set('foo', 'bar'); + $test->redis->zrevrank('foo', 'a'); + }); + } + /* multiple databases handling commands */ function testSelectDatabase() {
Test suite: added ZREVRANK.
imcj_predis
train
php
d655f35ac9c69dbe3133bc0dfe65d98294ecd5cc
diff --git a/lib/neo4j/active_node/query/query_proxy.rb b/lib/neo4j/active_node/query/query_proxy.rb index <HASH>..<HASH> 100644 --- a/lib/neo4j/active_node/query/query_proxy.rb +++ b/lib/neo4j/active_node/query/query_proxy.rb @@ -220,6 +220,12 @@ module Neo4j end end + # Give ability to call `#find` on associations to get a scoped find + # Doesn't pass through via `method_missing` because Enumerable has a `#find` method + def find(*args) + scoping { @model.find(*args) } + end + def optional? @optional == true end diff --git a/spec/e2e/query_spec.rb b/spec/e2e/query_spec.rb index <HASH>..<HASH> 100644 --- a/spec/e2e/query_spec.rb +++ b/spec/e2e/query_spec.rb @@ -172,6 +172,10 @@ describe 'Query API' do end end + it 'allows for finds on associations' do + expect(samuels.lessons_teaching.find(ss101.id)).to eq(ss101) + end + context 'samuels taught math 101 lesson' do before(:each) { samuels.lessons_taught << math101 }
Allow for `#find` on associations
neo4jrb_neo4j
train
rb,rb
76082334c74a88088c99bb011c30250f54c1019c
diff --git a/lib/geoengineer/cli/geo_cli.rb b/lib/geoengineer/cli/geo_cli.rb index <HASH>..<HASH> 100644 --- a/lib/geoengineer/cli/geo_cli.rb +++ b/lib/geoengineer/cli/geo_cli.rb @@ -140,7 +140,10 @@ class GeoCLI @environment.execute_lifecycle(:before, action_name.to_sym) errs = @environment.errors.flatten.sort - return print_validation_errors(errs) unless errs.empty? + unless errs.empty? + print_validation_errors(errs) + exit 1 + end yield args, options @environment.execute_lifecycle(:after, action_name.to_sym)
Ensure exit status is 1 if validations fail
coinbase_geoengineer
train
rb
0c7cf9a8e83ce275136f5545a51d857a47390153
diff --git a/hazelcast/src/main/java/com/hazelcast/multimap/impl/operations/MultiMapOperationFactory.java b/hazelcast/src/main/java/com/hazelcast/multimap/impl/operations/MultiMapOperationFactory.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/multimap/impl/operations/MultiMapOperationFactory.java +++ b/hazelcast/src/main/java/com/hazelcast/multimap/impl/operations/MultiMapOperationFactory.java @@ -57,10 +57,8 @@ public class MultiMapOperationFactory implements OperationFactory { } public Operation createOperation() { - //TODO: Don't use a if/else, but use a switch case. - switch(operationFactoryType) - { + switch(operationFactoryType) { case KEY_SET: return new KeySetOperation(name); case VALUES:
Removed TODO from the source code
hazelcast_hazelcast
train
java
8cead10f225da1e69f0237c9ab215c721f2dbab9
diff --git a/test/lib/smtpapi_header.test.js b/test/lib/smtpapi_header.test.js index <HASH>..<HASH> 100644 --- a/test/lib/smtpapi_header.test.js +++ b/test/lib/smtpapi_header.test.js @@ -96,7 +96,11 @@ describe('SmtpapiHeader', function() { header.addUniqueArgs({foo: 'bar'}); header.addFilterSetting('footer', 'enable', 1); header.addFilterSetting('footer', 'text/html', '<b>boo</b>'); - JSON.parse(header.toJson()).should.eql(header); + + var parse = JSON.parse(header.toJson()); + parse.to.should.eql(header.to); + parse.unique_args.should.eql(header.unique_args); + parse.filters.should.eql(header.filters); }); it('should not include the "to" parameter when there are none', function() {
fixed json comparison to match the new handling of toJson
sendgrid_sendgrid-nodejs
train
js
9ec6fa1daf68d3e2341c01d655065f42bc5b8528
diff --git a/test/unit/dtable.js b/test/unit/dtable.js index <HASH>..<HASH> 100644 --- a/test/unit/dtable.js +++ b/test/unit/dtable.js @@ -495,6 +495,7 @@ module.exports = function (mocks, lib) { dtable._loadAOF(dtable._aofPath, (err) => { assert.notOk(err); assert.ok(_.isEqual(dtable._table, new Map([["key", "val"]]))); + assert.equal(dtable._queue.size(), 0); fs.stat.restore(); fs.createReadStream.restore(); done();
and add check that queue size is 0 after loading AOF file
azuqua_notp
train
js
b9d4495fef00fe36aa8fd8f34b68edac87816680
diff --git a/visidata/shell.py b/visidata/shell.py index <HASH>..<HASH> 100644 --- a/visidata/shell.py +++ b/visidata/shell.py @@ -230,8 +230,16 @@ DirSheet.addCommand('gy', 'copy-selected', 'copy_files(selectedRows, inputPath(" @DirSheet.api @asyncthread def copy_files(sheet, paths, dest): - dest = Path(dest) - dest.is_dir() or vd.fail('target must be directory') - vd.status('copying %s %s to %s' % (len(paths), sheet.rowtype, dest)) - for p in Progress(paths, gerund='copying'): - shutil.copyfile(p, dest/(p.parts[-1])) + destdir = Path(dest) + destdir.is_dir() or vd.fail('target must be directory') + vd.status('copying %s %s to %s' % (len(paths), sheet.rowtype, destdir)) + for srcpath in Progress(paths, gerund='copying'): + try: + if not srcpath.is_dir(): + destpath = destdir/str(srcpath) + os.makedirs(destpath.parent, exist_ok=True) + shutil.copyfile(srcpath, destpath) + else: + os.makedirs(p, exist_ok=True) + except Exception as e: + vd.exceptionCaught(e)
[DirSheet-] continue after exception in copyfile
saulpw_visidata
train
py
e90303b9bafdad16e0c18e025a3252c675bfd167
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,9 +1,6 @@ lib = File.expand_path("../../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'codeclimate-test-reporter' -CodeClimate::TestReporter.start - require 'simplecov' SimpleCov.start
removed codeclimate-test-reporter gem dependency
nukeproof_oanda_api
train
rb
bebd01f0782109e1a6912da3ead3a42e72079fb7
diff --git a/timber.php b/timber.php index <HASH>..<HASH> 100644 --- a/timber.php +++ b/timber.php @@ -464,6 +464,8 @@ class Timber { $args = array_merge( $args, $prefs ); } $data = array(); + $data['current'] = $args['current']; + $data['total'] = $args['total']; $data['pages'] = TimberHelper::paginate_links( $args ); $next = get_next_posts_page_link( $args['total'] ); if ( $next ) {
added current and total to pagination array
timber_timber
train
php
314bb7d114ca436ef4645603c8b393ea3b5a8a9a
diff --git a/falafel/mappers/tests/test_lvs.py b/falafel/mappers/tests/test_lvs.py index <HASH>..<HASH> 100644 --- a/falafel/mappers/tests/test_lvs.py +++ b/falafel/mappers/tests/test_lvs.py @@ -1,4 +1,4 @@ -from falafel.mappers.lvm import Lvs +from falafel.mappers.lvm import Lvs, map_keys from falafel.tests import context_wrap LVS_INFO = """ @@ -94,3 +94,17 @@ class TestLVS(object): "Region": None } assert lvs_list["swap"]["LSize"] == "5.75g" + + def test_map_keys(self): + pvs = [{'LVM2_LV_NAME': 'lv1'}] + name = self._get_value_after_map_keys(pvs, 'LV') + assert name == 'lv1' + + pvs = [{'LVM2_LV_FULL_NAME': 'lv1'}] + name = self._get_value_after_map_keys(pvs, 'LV') + assert name == 'lv1' + + def _get_value_after_map_keys(self, pvs, key): + pvs = map_keys(pvs, Lvs.KEYS) + for pv in pvs: + return pv[key]
Add unit test for lvm#map_keys function - this test cover the case where 2 key in Lvs.KEYS that have the same value. The value is preserved after the map_keys function
RedHatInsights_insights-core
train
py
3db2cfad79a3fab5fda9c13175b88231f0f5f661
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -48,15 +48,17 @@ export function syncHistory(history) { let connected = false, syncing = false function middleware(store) { - unsubscribeHistory = history.listen(location => { - currentKey = location.key - if (syncing) { - // Don't dispatch a new action if we're replaying location. - return - } + setTimeout(() => { + unsubscribeHistory = history.listen(location => { + currentKey = location.key + if (syncing) { + // Don't dispatch a new action if we're replaying location. + return + } - store.dispatch(updateLocation(location)) - }) + store.dispatch(updateLocation(location)) + }) + }, 0) connected = true
Delay first listen until after middleware setup. No other way to do this outside of a setTimeout. Because history.listen is synchronous, it can dispatch an action before the middleware is finished being set up and points to a vanilla dispatch function. Fixes #<I>
reactjs_react-router-redux
train
js
de8162fba89b0c2fc428f90dee6d3236a1f87592
diff --git a/dark/titles.py b/dark/titles.py index <HASH>..<HASH> 100644 --- a/dark/titles.py +++ b/dark/titles.py @@ -290,10 +290,12 @@ class TitlesAlignments(dict): maxTitles) else: # There are too many titles. Make a sorted list of them so - # we loop through them in the desired order and can break - # early in the for loop below. We can't just take the first - # maxTitles titles from the sorted list as some of those - # titles may be discarded by the filter. + # we loop through them (below) in the desired order and can + # break when/if we've reached the maximum. We can't just + # take the first maxTitles titles from the sorted list now, + # as some of those titles might later be discarded by the + # filter and then we'd return a result with fewer titles + # than we should. titles = self.sortTitles(sortOn) else: titles = self.keys()
Improved maxTitles explanatory comment.
acorg_dark-matter
train
py
0287077e063cfff85328a994720f55bd697d10d6
diff --git a/src/Crawler/SearchResultAdCrawler.php b/src/Crawler/SearchResultAdCrawler.php index <HASH>..<HASH> 100644 --- a/src/Crawler/SearchResultAdCrawler.php +++ b/src/Crawler/SearchResultAdCrawler.php @@ -60,7 +60,9 @@ class SearchResultAdCrawler extends CrawlerAbstract return $this->getFieldValue( $this->node->filter('*[itemprop=price]'), 0, - PrixSanitizer::class . '::clean' + function ($value) { + return PrixSanitizer::clean($value); + } ); }
Fix php<I> support for dynamic closure
rfussien_leboncoin-crawler
train
php
a4ff5e8ea657d28358be3784a5cb4e103efcd6c3
diff --git a/src/EntityManager.php b/src/EntityManager.php index <HASH>..<HASH> 100644 --- a/src/EntityManager.php +++ b/src/EntityManager.php @@ -221,7 +221,7 @@ class $daoBaseClassName extends EntityRepository implements DAOInterface { /** * Returns the lis of beans - * @return array[".$entityName."] array of bean objects + * @return ".$entityName."[] array of bean objects */ public function getList(){ return \$this->findAll();
Fix annotation issue in the Dao generation
thecodingmachine_database.doctrine-orm-wrapper
train
php
9224ba964fa8a2ee95d04e385c7d8b8c62256b5f
diff --git a/idtype/idtype.go b/idtype/idtype.go index <HASH>..<HASH> 100644 --- a/idtype/idtype.go +++ b/idtype/idtype.go @@ -53,13 +53,17 @@ var ( Credential Type = 0x191 // Billing objects - BillingProfile Type = 0x1F4 + BillingProfile Type = 0x1F4 + Trial Type = 0x1F5 SubscriptionEvent Type = 0x1F6 Invoice Type = 0x1F7 // Charges for users InvoiceEvent Type = 0x1F8 // record of payment or failure to pay - Payout Type = 0x1F9 // Payouts for providers - PayoutEvent Type = 0x1FA // record of payout of failure to payout + + // A copy of a SubscriptionEvent recorded in the provider's event stream + ProviderSubscriptionEvent Type = 0x1F9 + Payout Type = 0x1FA // Payouts for providers + PayoutEvent Type = 0x1FB // record of payout of failure to payout // Values from 0xF00 to 0x1000 are reserved for Manifold private internal // only use. @@ -170,6 +174,8 @@ func init() { Register(SubscriptionEvent, false, "subscription_event") Register(Invoice, false, "invoice") Register(InvoiceEvent, false, "invoice_event") + + Register(ProviderSubscriptionEvent, false, "provider_subscription_event") Register(Payout, false, "payout") Register(PayoutEvent, false, "payout_event") }
Add a provider subscription event type This will be a copy of and a reference to any subscription events that would affect the provider, so we can keep a signed list of these, and operate on them without inspecting all users.
manifoldco_go-manifold
train
go
6e5541d2e47b79d92fcdc96bac5be1ddf984180b
diff --git a/test/write-files.js b/test/write-files.js index <HASH>..<HASH> 100644 --- a/test/write-files.js +++ b/test/write-files.js @@ -14,11 +14,9 @@ function getPathsAndOptions() { } test('Writes files', async t => { - t.plan(2); - const { paths, options } = getPathsAndOptions(); - await t.notThrows(() => writeFiles(options.allModules)); + await writeFiles(options.allModules); const expectedFiles = [ '.babelrc', @@ -36,7 +34,6 @@ test('Writes files', async t => { 'tests', 'webpack.config.js' ]; - console.log(fs.readdirSync(paths.build)); t.deepEqual( expectedFiles,
Removes 'notThrows' assertion
Creuna-Oslo_create-react-app
train
js
26db528da30bfbfe0071616cf79efa6fc0c7299c
diff --git a/pkg/cloudprovider/providers/vsphere/vsphere.go b/pkg/cloudprovider/providers/vsphere/vsphere.go index <HASH>..<HASH> 100644 --- a/pkg/cloudprovider/providers/vsphere/vsphere.go +++ b/pkg/cloudprovider/providers/vsphere/vsphere.go @@ -252,7 +252,7 @@ func readInstance(cfg *VSphereConfig) (string, string, error) { var rp mo.ResourcePool err = s.Properties(ctx, *vm.ResourcePool, []string{"parent"}, &rp) if err == nil { - var ccr mo.ClusterComputeResource + var ccr mo.ComputeResource err = s.Properties(ctx, *rp.Parent, []string{"name"}, &ccr) if err == nil { cluster = ccr.Name
Fix panic in vSphere when deploying on a single ESX node. Use ComputeResource instead of ClusterComputeResource when initializing the vSphere Cloud Provider
kubernetes_kubernetes
train
go
891c30f9230a7a76fe2e741a19dcf24504aedb5a
diff --git a/buuid.go b/buuid.go index <HASH>..<HASH> 100644 --- a/buuid.go +++ b/buuid.go @@ -6,9 +6,8 @@ import ( "encoding/binary" "fmt" - "code.google.com/p/go-uuid/uuid" - "github.com/getlantern/golog" + "github.com/getlantern/uuid" ) const (
Switched to our fork of go-uuid
getlantern_buuid
train
go
666c996f8e33fd91bba13c3f90a94b4d395e573c
diff --git a/src/ol/interaction/Translate.js b/src/ol/interaction/Translate.js index <HASH>..<HASH> 100644 --- a/src/ol/interaction/Translate.js +++ b/src/ol/interaction/Translate.js @@ -47,7 +47,7 @@ const TranslateEventType = { * @property {import("../events/condition.js").Condition} [condition] A function that * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a * boolean to indicate whether that event should be handled. - * Default is {@link module:ol/events/condition~always}. + * Default is {@link module:ol/events/condition.always}. * @property {Collection<import("../Feature.js").default>} [features] Only features contained in this collection will be able to be translated. If * not specified, all features on the map will be able to be translated. * @property {Array<import("../layer/Layer.js").default>|function(import("../layer/Layer.js").default): boolean} [layers] A list of layers from which features should be
Update src/ol/interaction/Translate.js
openlayers_openlayers
train
js
f75f10be3371e295f50327faeb5531cb8b523333
diff --git a/multidict/__init__.py b/multidict/__init__.py index <HASH>..<HASH> 100644 --- a/multidict/__init__.py +++ b/multidict/__init__.py @@ -10,7 +10,7 @@ import os __all__ = ('MultiDictProxy', 'CIMultiDictProxy', 'MultiDict', 'CIMultiDict', 'upstr', '__version__') -__version__ = '0.0.1' +__version__ = '1.0.0a0' if bool(os.environ.get('MULTIDICT_NO_EXTENSIONS')):
Let's publish <I> release -- I believe multidict is pretty stable package now
aio-libs_multidict
train
py
e60550b894e882abb4be0ff8b69b33fd8596c35e
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -5,7 +5,8 @@ extensions = [ master_doc = 'index' project = 'cairocffi' copyright = '2013-2019, Simon Sapin' -release = (Path(__file__).parent / 'cairocffi' / 'VERSION').read_text().strip() +release = ( + Path(__file__).parent.parent / 'cairocffi' / 'VERSION').read_text().strip() version = '.'.join(release.split('.')[:2]) exclude_patterns = ['_build'] autodoc_member_order = 'bysource'
Fix the VERSION path for doc
Kozea_cairocffi
train
py
05e065d026bc02c088a2bb6c1a6ae09ab86ee5ee
diff --git a/hub.go b/hub.go index <HASH>..<HASH> 100644 --- a/hub.go +++ b/hub.go @@ -30,6 +30,9 @@ type HubReq struct { // DataInterface returns the underlying data as interface{} func (hr HubReq) DataInterface() interface{} { + if hr.data == nil { + return nil + } return hr.data } @@ -117,7 +120,12 @@ func (h *Hub) DrawCh() chan HubReq { // SendDraw sends a request to redraw the terminal display func (h *Hub) SendDraw(matches []Match) { - send(h.DrawCh(), HubReq{matches, nil}, h.isSync) + // to make sure interface is nil, I need to EXPLICITLY set nil + req := HubReq{nil, nil} + if matches != nil { + req.data = matches + } + send(h.DrawCh(), req, h.isSync) } // StatusMsgCh returns the channel to update the status message
Try very hard to keep data == nil when it's nil
peco_peco
train
go
219fec6410197187df9bff8ca31c9a9b0ed5c105
diff --git a/packages/math/twoD.js b/packages/math/twoD.js index <HASH>..<HASH> 100644 --- a/packages/math/twoD.js +++ b/packages/math/twoD.js @@ -22,6 +22,13 @@ exports.subtract = function(pt, dx, dy) { }; } +exports.scale = function(s, pt) { + return { + x: pt.x * s, + y: pt.y * s + }; +} + exports.addMagnitude = function(pt, m) { return exports.setMagnitude(pt, exports.getMagnitude(pt) + m); }
add a scale function which multiplies a 2D vector by a scalar
gameclosure_js.io
train
js
069a38dfe1f7e076639021abe4b8794f0dbb2aad
diff --git a/lib/active_interaction/filters/hash_filter.rb b/lib/active_interaction/filters/hash_filter.rb index <HASH>..<HASH> 100644 --- a/lib/active_interaction/filters/hash_filter.rb +++ b/lib/active_interaction/filters/hash_filter.rb @@ -36,8 +36,11 @@ module ActiveInteraction end def default - if options[:default].is_a?(Hash) && !options[:default].empty? - fail InvalidDefaultError, "#{name}: #{options[:default].inspect}" + # TODO: Don't repeat yourself! This same logic exists in Filter#default. + value = options[:default] + value = value.call if value.is_a?(Proc) + if value.is_a?(Hash) && !value.empty? + fail InvalidDefaultError, "#{name}: #{value.inspect}" end super
Complain if the hash inside a proc isn't empty
AaronLasseigne_active_interaction
train
rb
323f2286d87f616bef8349af5079ef2b002b08e1
diff --git a/spec/unit/pops/parser/lexer2_spec.rb b/spec/unit/pops/parser/lexer2_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/pops/parser/lexer2_spec.rb +++ b/spec/unit/pops/parser/lexer2_spec.rb @@ -345,10 +345,25 @@ describe 'Lexer2' do [:RENDER_STRING, " This is "], [:RENDER_EXPR, nil], [:VARIABLE, "x"], + [:EPP_END, "%>"], [:RENDER_STRING, " just text\n"] ) end + it 'epp can contain text with trimmed interpolated rendered expressions' do + code = <<-CODE + This is <%= $x -%> just text + CODE + epp_tokens_scanned_from(code).should match_tokens2( + :EPP_START, + [:RENDER_STRING, " This is "], + [:RENDER_EXPR, nil], + [:VARIABLE, "x"], + [:EPP_END_TRIM, "-%>"], + [:RENDER_STRING, "just text\n"] + ) + end + it 'epp can contain text with expressions that are not rendered' do code = <<-CODE This is <% $x=10 %> just text
(PUP-<I>) Fix failing lexer2 test, and update with additional tests Tests were failing due to additional token marking the end of an EPP render expression.
puppetlabs_puppet
train
rb
98f5916dd79d34b755e48f7a71bb29280311c187
diff --git a/lib/dotenv/environment.rb b/lib/dotenv/environment.rb index <HASH>..<HASH> 100644 --- a/lib/dotenv/environment.rb +++ b/lib/dotenv/environment.rb @@ -2,7 +2,7 @@ module Dotenv class Environment < Hash def initialize(filename) @filename = filename - load + load if File.exists? @filename end def load
don't attempt to load if file does not exist
bkeepers_dotenv
train
rb
e192dfc6d7c7bfea6ed392b521e9cf8dc9a4f4f8
diff --git a/libs/resource.js b/libs/resource.js index <HASH>..<HASH> 100644 --- a/libs/resource.js +++ b/libs/resource.js @@ -104,7 +104,10 @@ module.exports = function (base) { }); fs.readdirSync(crons_path).forEach(function (name) { - crons.push(require(path.join(crons_path, name))); + let base_name = path.basename(name, '.js'), + job = require(path.join(crons_path, name)); + job.name = base_name; + crons.push(job); }); global['utils'] = _;
Modified to use cron file name as cron name for easy identification
steveesamson_slicks-bee
train
js
b5fd28a3d498239f8ea06cd215502b6ebf6b2a30
diff --git a/hearthstone/cardxml.py b/hearthstone/cardxml.py index <HASH>..<HASH> 100644 --- a/hearthstone/cardxml.py +++ b/hearthstone/cardxml.py @@ -168,11 +168,12 @@ class CardXML(object): e.text = value for tag, value in sorted(self.tags.items()): - e = _make_tag_element(ret, "Tag", tag, value) + if value: + e = _make_tag_element(ret, "Tag", tag, value) - if tag == GameTag.HERO_POWER and self.hero_power: - e.attrib["type"] = "Card" - e.attrib["cardID"] = self.hero_power + if tag == GameTag.HERO_POWER and self.hero_power: + e.attrib["type"] = "Card" + e.attrib["cardID"] = self.hero_power for tag, value in sorted(self.referenced_tags.items()): e = _make_tag_element(ret, "ReferencedTag", tag, value)
cardxml: Only write out tag values if they are nonzero
HearthSim_python-hearthstone
train
py
2fec118637c9bd704b00b75b5a35d1c19ad7f057
diff --git a/app/scripts/configs/tracks-info.js b/app/scripts/configs/tracks-info.js index <HASH>..<HASH> 100644 --- a/app/scripts/configs/tracks-info.js +++ b/app/scripts/configs/tracks-info.js @@ -201,7 +201,7 @@ export const TRACKS_INFO = [ trackBorderWidth: 0, trackBorderColor: 'black', labelTextOpacity: 0.4, - showMousePosition: true, + showMousePosition: false, mousePositionColor: '#999999' }, }, @@ -604,7 +604,7 @@ export const TRACKS_INFO = [ 'mousePositionColor', ], defaultOptions: { - showMousePosition: true, + showMousePosition: false, mousePositionColor: '#999999' }, }, @@ -621,7 +621,7 @@ export const TRACKS_INFO = [ 'mousePositionColor', ], defaultOptions: { - showMousePosition: true, + showMousePosition: false, mousePositionColor: '#999999' }, },
Don't show mouse location on default
higlass_higlass
train
js
5b53ac09ede7cde2b227b009ad37c2d8aa3cf6d7
diff --git a/packages/micro-journeys/src/two-character-layout.js b/packages/micro-journeys/src/two-character-layout.js index <HASH>..<HASH> 100644 --- a/packages/micro-journeys/src/two-character-layout.js +++ b/packages/micro-journeys/src/two-character-layout.js @@ -78,8 +78,10 @@ class BoltTwoCharacterLayout extends withLitHtml() { this.isInitialRender ) { setTimeout(() => { - this.charactersAreReadyInitialization(); - this.isInitialRender = false; + window.requestAnimationFrame(() => { + this.charactersAreReadyInitialization(); + this.isInitialRender = false; + }); }); } }
fix(micro-journeys): make bolt-character render happen in two-character-layout in requestAnimationFrame
bolt-design-system_bolt
train
js
d4e4be33972cf7b82cc29ae7d05930aac03d3cd4
diff --git a/pymc/distributions/continuous.py b/pymc/distributions/continuous.py index <HASH>..<HASH> 100644 --- a/pymc/distributions/continuous.py +++ b/pymc/distributions/continuous.py @@ -374,6 +374,7 @@ class Pareto(Continuous): super(Pareto, self).__init__(*args, **kwargs) self.alpha = alpha self.m = m + # Mean and variance return inf when parameter constraint not satisfied self.mean = (alpha>1) * alpha * m / (alpha - 1.) or inf self.variance = ((alpha>2) * (alpha * m**2) / ((alpha - 2.) * (alpha - 1.)**2) or inf) @@ -520,6 +521,7 @@ class InverseGamma(Continuous): self.beta = beta self.mean = (alpha > 1) * beta / (alpha - 1.) or inf self.mode = beta / (alpha + 1.) + # Variance returns inf when parameter constraint not satisfied self.variance = (alpha > 2) * (beta ** 2) / (alpha * (alpha - 1.)**2) or inf def logp(self, value):
Added comment to describe switch statements for Pareto and InverseGamma mean and variance
pymc-devs_pymc
train
py
405ffed173eae9eea616acbad33565b5a5a035c0
diff --git a/controller/examples/config.go b/controller/examples/config.go index <HASH>..<HASH> 100644 --- a/controller/examples/config.go +++ b/controller/examples/config.go @@ -3,7 +3,6 @@ package main import ( "fmt" "io" - "io/ioutil" "os" ) @@ -25,12 +24,13 @@ func loadConfigFromEnv() (*config, error) { } c.ourPort = port - logPath := os.Getenv("LOGFILE") - c.logOut = ioutil.Discard - if logPath != "" { + if logPath := os.Getenv("LOGFILE"); logPath != "" { if f, err := os.OpenFile(logPath, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666); err == nil { c.logOut = f } } + if c.logOut == nil { + c.logOut = os.Stderr + } return c, nil }
controller/examples: Send log output to STDERR by default The previous default was to discard any messages, which will suppress errors.
flynn_flynn
train
go
ad36fe3cb1e604831ec70bb937ac7770d2b31f75
diff --git a/detox/test/e2e/03.actions-scroll.test.js b/detox/test/e2e/03.actions-scroll.test.js index <HASH>..<HASH> 100644 --- a/detox/test/e2e/03.actions-scroll.test.js +++ b/detox/test/e2e/03.actions-scroll.test.js @@ -103,4 +103,26 @@ describe('Actions - Scroll', () => { await element(by.id('ScrollView161')).scrollToIndex(7); await expect(element(by.text('Text8'))).toBeVisible(); }); + + it('should not scroll horizontally when scroll view is covered', async () => { + await element(by.id('toggleScrollOverlays')).tap(); + await expect(element(by.text('HText1'))).toBeVisible(1); + + try { + await element(by.id('ScrollViewH')).scrollTo('right'); + } catch {} + + await expect(element(by.text('HText1'))).toBeVisible(1); + }); + + it('should not scroll vertically when scroll view is covered', async () => { + await element(by.id('toggleScrollOverlays')).tap(); + await expect(element(by.text('Text1'))).toBeVisible(1); + + try { + await element(by.id('ScrollView161')).scrollTo('down'); + } catch {} + + await expect(element(by.text('Text1'))).toBeVisible(1); + }); });
<I>.actions-scroll.test.js: add tests for covered scroll view.
wix_Detox
train
js
0adb19f272267c5d0009ca92cb35b0d348c4f59d
diff --git a/Command/WarmupImagineCacheCommand.php b/Command/WarmupImagineCacheCommand.php index <HASH>..<HASH> 100644 --- a/Command/WarmupImagineCacheCommand.php +++ b/Command/WarmupImagineCacheCommand.php @@ -72,7 +72,15 @@ class WarmupImagineCacheCommand extends Command $qb = $this->em->getRepository(AbstractImage::class)->createQueryBuilder('o'); $countQb = clone $qb; - $io->progressStart($countQb->select($countQb->expr()->count('o'))->getQuery()->getSingleScalarResult()); + $count = (int)$countQb->select($countQb->expr()->count('o'))->getQuery()->getSingleScalarResult(); + + if (0 === $count) { + $io->comment('No images found, exiting.'); + + return; + } + + $io->progressStart($count); $iterator = $qb->getQuery()->iterate();
Warmup Imagine cache command: check if there are images.
DarvinStudio_DarvinImageBundle
train
php
b98694426274c60e3fcd18c8c1871dc26c860c7d
diff --git a/spec/basic/handling_spec.js b/spec/basic/handling_spec.js index <HASH>..<HASH> 100644 --- a/spec/basic/handling_spec.js +++ b/spec/basic/handling_spec.js @@ -2,7 +2,7 @@ describe('handling timeout errors', function() { it('should call error handler on a timeout', function() { - browser.get('dummyUrl', 1).then(function() { + browser.get('http://dummyUrl', 1).then(function() { throw 'did not handle error'; }, function(err) { expect(err).toBeDefined();
chore(tests): fix test when dummyUrl resolves When there is a baseUrl, and a router that routes unrecognized paths to the default page, then baseUrl/dummyUrl could actually resolve to a correct page, and this will not fail.
angular_protractor
train
js