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
1c29309e3164865ac0119dfdb895ce01f4e5dc85
diff --git a/aegean.py b/aegean.py index <HASH>..<HASH> 100644 --- a/aegean.py +++ b/aegean.py @@ -52,7 +52,7 @@ VOBS = 0.00000000000E+00 / BTYPE = 'intensity' / RMS = 1 /""" -header="""#Tesla version {0} +header="""#Aegean version {0} # on dataset: {1} #isl,src bkg err RA DEC RA err DEC err Peak err S_int err a err b err pa err flags # Jy/beam Jy/beam deg deg deg deg Jy/beam Jy/beam Jy Jy '' '' '' '' deg deg CPES @@ -766,7 +766,8 @@ def find_sources_in_image(filename, hdu_index=0, outfile=None,rms=None, max_summ num_isle=0 sources = [] - print >>outfile,header.format(version,filename) + if outfile: + print >>outfile,header.format(version,filename) for i,xmin,xmax,ymin,ymax in gen_flood_wrap(data,rmsimg,innerclip,outerclip,expand=False): logging.debug("=====") logging.debug("Island ({0})".format(num_isle) )
Aegean: don't print header to stdout when no outfile provided. Change 'tesla' to 'aegean' in header
PaulHancock_Aegean
train
py
5c0f896a0a5007025d75973ba19a15c3060f08cd
diff --git a/src/Configuration.php b/src/Configuration.php index <HASH>..<HASH> 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -57,10 +57,6 @@ class Configuration * @var string */ protected $originalURL = 'http://fakehost'; - /** - * @var LoggerInterface - */ - protected $logger = null; /** * @return LoggerInterface
Remove logger declaration inside the Configuration
andreskrey_readability.php
train
php
5638c4ba87c82fa6531833337f60256c4c8a0000
diff --git a/cmd/syncthing/gui.go b/cmd/syncthing/gui.go index <HASH>..<HASH> 100644 --- a/cmd/syncthing/gui.go +++ b/cmd/syncthing/gui.go @@ -255,7 +255,7 @@ func restGetNeed(m *model.Model, w http.ResponseWriter, r *http.Request) { var qs = r.URL.Query() var repo = qs.Get("repo") - files := m.NeedFilesRepoLimited(repo, 100, 250) // max 100 files or 2500 blocks + files := m.NeedFilesRepoLimited(repo, 100, 2500) // max 100 files or 2500 blocks w.Header().Set("Content-Type", "application/json; charset=utf-8") json.NewEncoder(w).Encode(files)
Woops (fixup of previous)
syncthing_syncthing
train
go
2fb0cc607e9fa9f15f81c650720306269efcf790
diff --git a/sphinx_gallery/gen_rst.py b/sphinx_gallery/gen_rst.py index <HASH>..<HASH> 100644 --- a/sphinx_gallery/gen_rst.py +++ b/sphinx_gallery/gen_rst.py @@ -643,7 +643,8 @@ def generate_file_rst(fname, target_dir, src_dir, gallery_conf): example_nb.add_markdown_cell(text2string(bcontent)) # Writes md5 checksum if example has build correctly - if src_file not in gallery_conf['failing_examples']: + # not failed and was initially meant to run(no-plot shall not cache md5sum) + if src_file not in gallery_conf['failing_examples'] and execute_script: with open(example_file + '.md5', 'w') as file_checksum: file_checksum.write(get_md5sum(example_file)) diff --git a/sphinx_gallery/tests/test_gen_rst.py b/sphinx_gallery/tests/test_gen_rst.py index <HASH>..<HASH> 100644 --- a/sphinx_gallery/tests/test_gen_rst.py +++ b/sphinx_gallery/tests/test_gen_rst.py @@ -262,3 +262,5 @@ def test_save_figures(): # TODO: test that broken thumbnail does appear when needed # TODO: test that examples are not executed twice +# TODO: test that examples are executed after a no-plot and produce +# the correct image in the thumbnail
[Fix BUG] no-plot caches the md5sum files If running under no-plot all files are generated correctly and no example is assumed to fail. Thus md5sum files where written and on next builds of the project no example would be executed to generate the images. TODO test reminder added
sphinx-gallery_sphinx-gallery
train
py,py
f919d5f1d9bfd9dac92b46f841f522dab59112af
diff --git a/tests/test_interpolation.py b/tests/test_interpolation.py index <HASH>..<HASH> 100644 --- a/tests/test_interpolation.py +++ b/tests/test_interpolation.py @@ -319,4 +319,18 @@ def test_order_zero_3d_with_key_col(): index=[10, 4, 7, 0, 9]) result = interp(interpolants) - assert result.equals(pd.DataFrame({'value': [3.0, 5.0, 2.0, 7.0, 3.0]}, index=[10, 4, 7, 0, 9])) \ No newline at end of file + assert result.equals(pd.DataFrame({'value': [3.0, 5.0, 2.0, 7.0, 3.0]}, index=[10, 4, 7, 0, 9])) + + +def test_order_zero_diff_bin_sizes(): + data = pd.DataFrame({'year_start': [1990, 1995, 1996, 2005, 2005.5,], + 'year_end': [1995, 1996, 2005, 2005.5, 2010], + 'value': [1, 5, 2.3, 6, 100]}) + + i = Interpolation(data, tuple(), [('year', 'year_start', 'year_end')], 0, False) + + query = pd.DataFrame({'year': [2007, 1990, 2005.4, 1994, 2004, 1995, 2002, 1995.5, 1996]}) + + expected_result = pd.DataFrame({'value': [100, 1, 6, 1, 2.3, 5, 2.3, 5, 2.3]}) + + assert i(query).equals(expected_result) \ No newline at end of file
adding test for interpolation with different bin sizes
ihmeuw_vivarium
train
py
aa74c7aba3d227e1ea53a294d3e61d0864d51f5e
diff --git a/src/example-types/facet.js b/src/example-types/facet.js index <HASH>..<HASH> 100644 --- a/src/example-types/facet.js +++ b/src/example-types/facet.js @@ -43,7 +43,7 @@ module.exports = { terms: _.extendAll([ { field, - size: context.size || 10, + size: _.isNil(context.size) ? 10 : context.size, order: { term: { _term: 'asc' }, count: { _count: 'desc' },
Facet wasn't allowing size 0 Not it will! :D
smartprocure_contexture-elasticsearch
train
js
44afa93dbf5510ed26512999ed47f6611f4e4251
diff --git a/src/share/classes/com/sun/tools/javac/comp/Attr.java b/src/share/classes/com/sun/tools/javac/comp/Attr.java index <HASH>..<HASH> 100644 --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java @@ -3372,12 +3372,16 @@ public class Attr extends JCTree.Visitor { } public void visitTypeParameter(JCTypeParameter tree) { chk.validateTypeAnnotations(tree.annotations, true); - // don't call super. skip type annotations + // Don't call super. Skip type annotations. + // WMD: why can we skip them? scan(tree.bounds); } public void visitMethodDef(JCMethodDecl tree) { - // need to check static methods - if ((tree.sym.flags() & Flags.STATIC) != 0) { + // Static methods cannot have receiver type annotations. + // In test case FailOver15.java, the nested method getString has + // a null sym, because an unknown class is instantiated. + // I would say it's safe to skip. + if (tree.sym!=null && (tree.sym.flags() & Flags.STATIC) != 0) { for (JCTypeAnnotation a : tree.receiverAnnotations) { if (chk.isTypeAnnotation(a, false)) log.error(a.pos(), "annotation.type.not.applicable");
Ensure that tree.sym is non-null. In test case FailOver<I>.java, the nested method getString has a null sym, because an unknown class is instantiated.
wmdietl_jsr308-langtools
train
java
043c88a3b9ff5ebeed59cd6f1da4a81e88e7922c
diff --git a/src/plugin.js b/src/plugin.js index <HASH>..<HASH> 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -2,7 +2,7 @@ // Make our own plugin main interface an event emitter. // This can be used to communicate and subscribe to others plugins events. -import { EventEmitter } from 'events'; +var EventEmitter = require('events').EventEmitter; /** * Plugin Interface @@ -18,7 +18,7 @@ import { EventEmitter } from 'events'; * @property {UIFacade} ui * */ -export default class extends EventEmitter { +module.exports = class extends EventEmitter { /** * Construct the plugin. @@ -61,4 +61,4 @@ export default class extends EventEmitter { this.plugins = app.plugins; this.ui = app.ui; } -} +};
Convert to native es6
ManiaJS_plugins
train
js
bffd7e6ce7920765e9aca85ceba29261ead67709
diff --git a/lib/classes/searchEngine/options.class.php b/lib/classes/searchEngine/options.class.php index <HASH>..<HASH> 100644 --- a/lib/classes/searchEngine/options.class.php +++ b/lib/classes/searchEngine/options.class.php @@ -442,8 +442,14 @@ class searchEngine_options implements Serializable foreach ($serialized as $key => $value) { - if (in_array($key, array('date_min', 'date_max'))) + if(is_null($value)) + { + $value = null; + } + elseif (in_array($key, array('date_min', 'date_max'))) + { $value = new DateTime($value); + } elseif ($value instanceof stdClass) $value = (array) $value;
Fix #<I> : cache is not well refreshed
alchemy-fr_Phraseanet
train
php
764bd0a047d1acc26b6c32bb195c24ece6b86959
diff --git a/Admin/Admin.php b/Admin/Admin.php index <HASH>..<HASH> 100644 --- a/Admin/Admin.php +++ b/Admin/Admin.php @@ -2014,8 +2014,7 @@ abstract class Admin implements AdminInterface, DomainObjectInterface $menu = $menu->addChild($this->toString($this->getSubject())); } elseif ($action != 'list') { $menu = $menu->addChild( -// $this->trans($this->getLabelTranslatorStrategy()->getLabel(sprintf('%s_%s', $this->getClassnameLabel(), $action), 'breadcrumb', 'link')) - $this->toString($this->getSubject()) + $this->trans($this->getLabelTranslatorStrategy()->getLabel(sprintf('%s_%s', $this->getClassnameLabel(), $action), 'breadcrumb', 'link')) ); } else { $menu->getBreadcrumbsArray();
Fix breadcrumbs for custom routes when subject is empty Hi. When I open my custom routes, there is no label in breadcrumbs for it, because subject is empty.
sonata-project_SonataAdminBundle
train
php
bb333742bd3fbfca285fc8984eb577f67c306426
diff --git a/cm-mlops/automation/script/module.py b/cm-mlops/automation/script/module.py index <HASH>..<HASH> 100644 --- a/cm-mlops/automation/script/module.py +++ b/cm-mlops/automation/script/module.py @@ -567,7 +567,18 @@ class CAutomation(Automation): update_state_from_meta(variation_meta, env, state, deps, post_deps, i) - + ############################################################################################################ + # Update any env key used as part of values in meta + import re + for key in env: + value = env[key] + tmp_values = re.findall(r'<<<(.*?)>>>', value) + if tmp_values == []: continue + for tmp_value in tmp_values: + if tmp_value not in env: + return {'return':1, 'error':'variable {} is not in env'.format(tmp_value)} + value = value.replace("<<<"+tmp_value+">>>", env[tmp_value]) + env[key] = value ############################################################################################################ # Check chain of dependencies on other CM scripts
Support usage of env variables as env value in meta
ctuning_ck
train
py
604d5d98af251772e6a699a163ca664285bee489
diff --git a/cli/lib/cli/commands/release.rb b/cli/lib/cli/commands/release.rb index <HASH>..<HASH> 100644 --- a/cli/lib/cli/commands/release.rb +++ b/cli/lib/cli/commands/release.rb @@ -303,12 +303,6 @@ module Bosh::Cli::Command Dir[File.join(work_dir, "jobs", "*")].each do |job_dir| next unless File.directory?(job_dir) job_dirname = File.basename(job_dir) - job_spec = load_yaml_file(File.join(job_dir, "spec")) - - if job_spec["name"] != job_dirname - err("Found `#{job_spec["name"]}' job in " + - "`#{job_dirname}' directory, please fix it") - end prepare_script = File.join(job_dir, "prepare") if File.exists?(prepare_script) @@ -316,6 +310,12 @@ module Bosh::Cli::Command Bosh::Cli::JobBuilder.run_prepare_script(prepare_script) end + job_spec = load_yaml_file(File.join(job_dir, "spec")) + if job_spec["name"] != job_dirname + err("Found `#{job_spec["name"]}' job in " + + "`#{job_dirname}' directory, please fix it") + end + job = Bosh::Cli::JobBuilder.new(job_spec, work_dir, final, release.blobstore, built_package_names) job.dry_run = dry_run
Fix create release When building jobs that have a prepare script, spec file must be read after the prepare script execution, because the prepare script is who finally builds the spec file. Change-Id: If<I>cda7c2fbcc4d<I>b<I>fa6afcea1d<I>bf5
cloudfoundry_bosh
train
rb
8ed67fe3493df256403edf99a9015cdf476efefd
diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index <HASH>..<HASH> 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -714,9 +714,7 @@ func syncthingMain() { func dbOpts() *opt.Options { // Calculate a suitable database block cache capacity. - // Default is 8 MiB. In reality, the database will use twice the amount we - // calculate here, as it also has two write buffers each sized at half the - // block cache. + // Default is 8 MiB. blockCacheCapacity := 8 << 20 // Increase block cache up to this maximum: const maxCapacity = 64 << 20 @@ -743,7 +741,7 @@ func dbOpts() *opt.Options { return &opt.Options{ OpenFilesCacheCapacity: 100, BlockCacheCapacity: blockCacheCapacity, - WriteBuffer: blockCacheCapacity / 2, + WriteBuffer: 4 << 20, } }
Reduce db write cache to (2*) 4 MiB I haven't been able to reproduce any performance advantage of having it set higher and it reduces the memory footprint a bit.
syncthing_syncthing
train
go
2272b8d00f906321f8476eb64c9f8c6475061783
diff --git a/nptdms/tdms.py b/nptdms/tdms.py index <HASH>..<HASH> 100644 --- a/nptdms/tdms.py +++ b/nptdms/tdms.py @@ -7,8 +7,12 @@ from collections import namedtuple try: from collections import OrderedDict except ImportError: - # For Python < 2.7, just use a normal dict - OrderedDict = dict + try: + # ordereddict available on pypi for Python < 2.7 + from ordereddict import OrderedDict + except ImportError: + # Otherwise fall back on normal dict + OrderedDict = dict from copy import copy import numpy as np
Use ordereddict package if it's available on Python < <I> Issue #6
adamreeve_npTDMS
train
py
df52848521544eb575b7623661e93eda993bce4d
diff --git a/salt/utils/socket_util.py b/salt/utils/socket_util.py index <HASH>..<HASH> 100644 --- a/salt/utils/socket_util.py +++ b/salt/utils/socket_util.py @@ -337,6 +337,9 @@ class IPv4Address(object): def __repr__(self): return 'IPv4Address("{0}")'.format(str(self)) + def __cmp__(self, other): + return cmp(self.dotted_quad, other.dotted_quad) + @property def is_private(self): '''
support comparisons for IPv4Address
saltstack_salt
train
py
596fc02157813271d6db4c880dd371d2b0035560
diff --git a/js/track-adder.js b/js/track-adder.js index <HASH>..<HASH> 100644 --- a/js/track-adder.js +++ b/js/track-adder.js @@ -27,6 +27,23 @@ if (typeof(require) !== 'undefined') { var makeTreeTableSection = domui.makeTreeTableSection; var probeResource = require('./probe').probeResource; + + + // Most of this could disappear if we leave all probing to the probe module... + var bin = require('./bin'); + var URLFetchable = bin.URLFetchable; + var BlobFetchable = bin.BlobFetchable; + var readInt = bin.readInt; + + var lh3utils = require('./lh3utils'); + var unbgzf = lh3utils.unbgzf; + + var bam = require('./bam'); + var BAM_MAGIC = bam.BAM_MAGIC; + var BAI_MAGIC = bam.BAI_MAGIC; + + var tbi = require('./tabix'); + var TABIX_MAGIC = tbi.TABIX_MAGIC; } Browser.prototype.currentlyActive = function(source) {
Fix addition of binary tracks by URL.
dasmoth_dalliance
train
js
96483a990744682504101aac74fe709ec32886ad
diff --git a/src/Stream/StreamDecoratorTrait.php b/src/Stream/StreamDecoratorTrait.php index <HASH>..<HASH> 100644 --- a/src/Stream/StreamDecoratorTrait.php +++ b/src/Stream/StreamDecoratorTrait.php @@ -44,7 +44,10 @@ trait StreamDecoratorTrait } $read = min(1048576, $maxLength - $len); } - $buffer .= $this->read($read); + if ('' === ($line = $this->read($read))) { + break; + } + $buffer .= $line; } return $buffer;
Preventing infinite loops in broken implementations
guzzle_guzzle
train
php
8ae69f3ee9c133ac0672e0f8615956bcee973ec4
diff --git a/odinweb/testing.py b/odinweb/testing.py index <HASH>..<HASH> 100644 --- a/odinweb/testing.py +++ b/odinweb/testing.py @@ -5,16 +5,20 @@ Testing Helpers Collection of Mocks and Tools for testing APIs. """ +from odin.codecs import json_codec class MockRequest(object): """ Mocked Request object """ - def __init__(self, query=None, post=None, headers=None, method='GET', body='', host='127.0.0.1'): + def __init__(self, query=None, post=None, headers=None, method='GET', body='', host='127.0.0.1', + request_codec=None, response_codec=None): self.GET = query or {} self.POST = post or {} self.headers = headers or {} self.method = method self.body = body self.host = host + self.request_codec = request_codec or json_codec + self.response_codec = response_codec or json_codec
Expanded Mock request with codecs
python-odin_odinweb
train
py
dde4cd026ce0030c120a6694ec6ded32f1b841bb
diff --git a/publishable/assets/js/voyager_tinymce.js b/publishable/assets/js/voyager_tinymce.js index <HASH>..<HASH> 100644 --- a/publishable/assets/js/voyager_tinymce.js +++ b/publishable/assets/js/voyager_tinymce.js @@ -14,14 +14,14 @@ $(document).ready(function(){ menubar: false, selector:'textarea.richTextBox', skin: 'voyager', - plugins: 'link, image, code, youtube, giphy, table', + plugins: 'link, image, code, youtube, giphy, table, textcolor', extended_valid_elements : 'input[onclick|value|style|type]', file_browser_callback: function(field_name, url, type, win) { if(type =='image'){ $('#upload_file').trigger('click'); } }, - toolbar: 'styleselect bold italic underline | alignleft aligncenter alignright | bullist numlist outdent indent | link image table youtube giphy | code', + toolbar: 'styleselect bold italic underline | forecolor backcolor | alignleft aligncenter alignright | bullist numlist outdent indent | link image table youtube giphy | code', convert_urls: false, image_caption: true, image_title: true
tinymce add forecolor and backcolor
the-control-group_voyager
train
js
4a0341c26e31b95cc9ff75222a4ad7a229a711e0
diff --git a/src/plugins/color-adjust.js b/src/plugins/color-adjust.js index <HASH>..<HASH> 100644 --- a/src/plugins/color-adjust.js +++ b/src/plugins/color-adjust.js @@ -1,10 +1,12 @@ import prefix from '../prefix' +// Support old color-adjust prop syntax. +// https://caniuse.com/#search=color-adjust export default { noPrefill: ['color-adjust'], supportedProperty: (prop) => { if (prop !== 'color-adjust') return false if (prefix.js === 'Webkit') return `${prefix.css}print-${prop}` - return prefix.css + prop + return prop } } diff --git a/src/plugins/inline-logical-old.js b/src/plugins/inline-logical-old.js index <HASH>..<HASH> 100644 --- a/src/plugins/inline-logical-old.js +++ b/src/plugins/inline-logical-old.js @@ -6,6 +6,7 @@ import pascalize from '../utils/pascalize' export default { supportedProperty: (prop, style) => { if (!/^(border|margin|padding)-inline/.test(prop)) return false + if (prefix.js === 'Moz') return prop const newProp = prop.replace('-inline', '') return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false }
Fix for color-adjust and inline-border/margin etc.
cssinjs_css-vendor
train
js,js
a7afc96d7afe7c5f5934f52fedd8d5afbf86f3f1
diff --git a/tests/test_exposition.py b/tests/test_exposition.py index <HASH>..<HASH> 100644 --- a/tests/test_exposition.py +++ b/tests/test_exposition.py @@ -111,7 +111,7 @@ class TestPushGateway(unittest.TestCase): do_DELETE = do_PUT httpd = HTTPServer(('localhost', 0), TestHandler) - self.address = ':'.join([str(x) for x in httpd.server_address]) + self.address = 'http://localhost:{0}'.format(httpd.server_address[1]) class TestServer(threading.Thread): def run(self): httpd.handle_request()
Another potential workaround for py<I> test failures.
prometheus_client_python
train
py
fea3ea4eda8468e2e09cbb5b505913d5a5a863af
diff --git a/lib/catarse_pagarme/configuration.rb b/lib/catarse_pagarme/configuration.rb index <HASH>..<HASH> 100644 --- a/lib/catarse_pagarme/configuration.rb +++ b/lib/catarse_pagarme/configuration.rb @@ -3,7 +3,7 @@ module CatarsePagarme attr_accessor :api_key, :slip_tax, :credit_card_tax, :interest_rate, :host, :subdomain, :protocol, :max_installments, :minimum_value_for_installment, :credit_card_cents_fee, :pagarme_tax, :stone_tax, :stone_installment_tax, :cielo_tax, :cielo_installment_diners_tax, :cielo_installment_not_diners_tax, - :cielo_installment_amex_tax, :cielo_installment_not_amex_tax, :ecr_key, :slip_week_day_interval, :antifraud_tax + :cielo_installment_amex_tax, :cielo_installment_not_amex_tax, :ecr_key, :slip_week_day_interval, :antifraud_tax, :use_simility def initialize self.api_key = '' @@ -27,6 +27,7 @@ module CatarsePagarme self.cielo_installment_amex_tax = 0 self.cielo_installment_not_amex_tax = 0 self.slip_week_day_interval = 2 + self.use_simility = true end end end
Added use_simility defaults is true configuration
catarse_catarse_pagarme
train
rb
0d56a1607531c8ceba3da93b80437caaf8e64f90
diff --git a/packages/selenium-ide/src/neo/IO/legacy/migrate.js b/packages/selenium-ide/src/neo/IO/legacy/migrate.js index <HASH>..<HASH> 100644 --- a/packages/selenium-ide/src/neo/IO/legacy/migrate.js +++ b/packages/selenium-ide/src/neo/IO/legacy/migrate.js @@ -117,9 +117,11 @@ export function migrateTestCase(data) { const sanitized = sanitizeXml(data); const result = JSON.parse(convert.xml2json(sanitized, { compact: true })); const baseUrl = result.html.head.link._attributes.href; + let tr = result.html.body.table.tbody.tr; + tr = Array.isArray(tr) ? tr : [tr]; const test = { name: result.html.body.table.thead.tr.td._text, - commands: result.html.body.table.tbody.tr.filter(row => (row.td[0]._text && !/^wait/.test(row.td[0]._text))).map(row => ( + commands: tr.filter(row => (row.td[0]._text && !/^wait/.test(row.td[0]._text))).map(row => ( { command: row.td[0]._text && row.td[0]._text.replace("AndWait", ""), target: xmlunescape(parseTarget(row.td[1])),
fixed error when migrating old test case which has a command
SeleniumHQ_selenium-ide
train
js
d17607078d75dfcac55941fa75d229cfaf074703
diff --git a/cmd/oauth.go b/cmd/oauth.go index <HASH>..<HASH> 100644 --- a/cmd/oauth.go +++ b/cmd/oauth.go @@ -24,7 +24,7 @@ func open(url string) error { return exec.Command("open", url).Start() } -func serve() (string, error) { +func serve(url chan string) { http.HandleFunc("/callback", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Test") }) @@ -34,20 +34,24 @@ func serve() (string, error) { }) l, e := net.Listen("tcp", ":0") if e != nil { - return "", e + return } server := &http.Server{} - return l.Addr().String(), server.Serve(l) + _, port, _ := net.SplitHostPort(l.Addr().String()) + url <- fmt.Sprintf("http://localhost:%s", port) + server.Serve(l) } func startServerAndOpenBrowser() { - url, err := func() (string, error) { - return serve() + c := make(chan string) + finish := make(chan bool) + go func() { + serve(c) + }() - if err != nil { - return - } + url := <-c open(url) + <-finish } func oauthLogin(context *Context, client *Client) error {
cmd/oauth: make local server runs in background.
tsuru_tsuru
train
go
4a404bc53d93c937a85406d7f950492366f7af0e
diff --git a/cheroot/test/test_conn.py b/cheroot/test/test_conn.py index <HASH>..<HASH> 100644 --- a/cheroot/test/test_conn.py +++ b/cheroot/test/test_conn.py @@ -430,9 +430,8 @@ def test_keepalive_conn_management(test_client): assert header_has_value('Connection', 'Keep-Alive', actual_headers) assert header_has_value( 'Keep-Alive', - 'timeout={test_client.server_instance.timeout}'.format( - **locals(), - ), + 'timeout={test_client.server_instance.timeout}'. + format(**locals()), actual_headers, ) else:
Fix a trailing comma after dict unpack @ py2 This change fixes a bug introduced in <I> @ test_conn module
cherrypy_cheroot
train
py
f83b66637c264ee5599897d772131d5fcbb40ee0
diff --git a/php/commands/rewrite.php b/php/commands/rewrite.php index <HASH>..<HASH> 100644 --- a/php/commands/rewrite.php +++ b/php/commands/rewrite.php @@ -17,8 +17,8 @@ class Rewrite_Command extends WP_CLI_Command { * To regenerate a .htaccess file with WP-CLI, you'll need to add the mod_rewrite module * to your wp-cli.yml or config.yml. For example: * - * apache_modules: - * - mod_rewrite + * `apache_modules: + * - mod_rewrite` * * ## OPTIONS *
Backtick `wp rewrite flush` snippet, so it gets formatted in docs
wp-cli_export-command
train
php
b1f1cf92db346d5c3f6603e8467a88fdd26a7aef
diff --git a/lib/puppet/type/file/source.rb b/lib/puppet/type/file/source.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/type/file/source.rb +++ b/lib/puppet/type/file/source.rb @@ -127,9 +127,9 @@ module Puppet if Puppet.features.microsoft_windows? if [:use, :use_when_creating].include?(resource[:source_permissions]) Puppet.deprecation_warning("Copying owner/mode/group from the puppet master to Windows agents" << - " is not supported; use source_permissions => ignore.") + " is deprecated; use source_permissions => ignore.") end - next + next if [:owner, :group].include?(metadata_method) end case resource[:source_permissions] diff --git a/spec/unit/type/file/source_spec.rb b/spec/unit/type/file/source_spec.rb index <HASH>..<HASH> 100755 --- a/spec/unit/type/file/source_spec.rb +++ b/spec/unit/type/file/source_spec.rb @@ -368,7 +368,7 @@ describe Puppet::Type.type(:file).attrclass(:source) do @source.stubs(:local?).returns false Puppet.expects(:deprecation_warning).with( "Copying owner/mode/group from the puppet master to Windows agents" << - " is not supported; use source_permissions => ignore.").at_least_once + " is deprecated; use source_permissions => ignore.").at_least_once @source.copy_source_values end
(#<I>) Deprecate instead of remove original windows behavior The original windows behavior was to attempt to translate posix mode to the windows file. Although we want deprecate this behavior, this previous work on #<I> was removing it entirely. This patch returns original behavior and marks it as deprecated for future removal.
puppetlabs_puppet
train
rb,rb
8e6fa14222540b258c3738a4d3591cabdd52de29
diff --git a/spec/acceptance_spec.rb b/spec/acceptance_spec.rb index <HASH>..<HASH> 100644 --- a/spec/acceptance_spec.rb +++ b/spec/acceptance_spec.rb @@ -26,7 +26,7 @@ RSpec.describe "Acceptance", timeout: 10 do end end - describe "Remote plugin DSL" do + describe "Remote plugins" do before do run_nvim( {"NVIM_RPLUGIN_MANIFEST" => manifest}, @@ -43,14 +43,17 @@ RSpec.describe "Acceptance", timeout: 10 do end end - describe "Generated documentation" do + describe "Generated documentation", timeout: 120 do it "is up to date" do url = "https://api.github.com/repos/neovim/neovim/releases/latest" + retries = 5.times.lazy.map { sleep 5 } begin response = open(url) { |json| JSON.load(json) } rescue SocketError, OpenURI::HTTPError, OpenSSL::SSL::SSLError => e - skip "Skipping: #{e}" + warn "#{e} (retrying)"; retries.next; retry + rescue StopIteration + fail "Couldn't determine latest neovim release from Github" end release_version = response["name"][/NVIM v?(.+)$/, 1]
Add retries to documentation spec, instead of skipping
neovim_neovim-ruby
train
rb
5cf0bc218f3c2e4a7cfff8a687b0e939401651e3
diff --git a/lib/porch/context.rb b/lib/porch/context.rb index <HASH>..<HASH> 100644 --- a/lib/porch/context.rb +++ b/lib/porch/context.rb @@ -9,6 +9,7 @@ module Porch def initialize(context={}, success=true) @message = nil @success = success + @skip_remaining = false deep_duplicate(context) end @@ -36,12 +37,20 @@ module Porch super end + def skip_remaining? + !!@skip_remaining + end + + def skip_remaining! + @skip_remaining = true + end + def success? @success end def stop_processing? - failure? + failure? || skip_remaining? end private diff --git a/spec/porch/context_spec.rb b/spec/porch/context_spec.rb index <HASH>..<HASH> 100644 --- a/spec/porch/context_spec.rb +++ b/spec/porch/context_spec.rb @@ -114,5 +114,11 @@ RSpec.describe Porch::Context do expect(subject).to be_stop_processing end + + it "stops when the remaining actions are skipped" do + subject.skip_remaining! + + expect(subject).to be_stop_processing + end end end
Add the ability to skip the remaining steps
jwright_porch
train
rb,rb
35b073906c9296897ad7d27a3ca0e9aab2785f24
diff --git a/gwpy/cli/cliproduct.py b/gwpy/cli/cliproduct.py index <HASH>..<HASH> 100644 --- a/gwpy/cli/cliproduct.py +++ b/gwpy/cli/cliproduct.py @@ -41,7 +41,7 @@ import time from dateutil.parser import parser -from ..timeseries import TimeSeries +from gwpy.timeseries import TimeSeries __author__ = 'Joseph Areeda <[email protected]>' @@ -515,6 +515,8 @@ class CliProduct(object): else: data = TimeSeries.fetch(chan, start, start+self.dur, verbose=verb) + if data.unit == '*': + data.override_unit('') if highpass > 0 and lowpass == 0: data = data.highpass(highpass) @@ -801,13 +803,13 @@ class CliProduct(object): all_units = set() for ts in self.timeseries: un = str(ts.unit) - if (un != 'undef') & (un != ''): + if (un != 'undef') & (un != '') & (un != '*'): all_units.add(un) else: all_units.add('Counts') if len(all_units) == 1: - self.units = all_units.pop() + self.units = label_to_latex(all_units.pop()) else: self.units = 'Counts'
deal with '*' as a unit
gwpy_gwpy
train
py
b94c7b4210921e3a7a2521805766e12e4ce0005e
diff --git a/passpie/cli.py b/passpie/cli.py index <HASH>..<HASH> 100644 --- a/passpie/cli.py +++ b/passpie/cli.py @@ -219,7 +219,11 @@ def add(db, fullname, password, random, pattern, interactive, comment, force, co pattern = pattern if pattern else db.config['genpass_pattern'] password = genpass(pattern=pattern) elif not password: - password = click.prompt('Password', hide_input=True, confirmation_prompt=True) + password = click.prompt('Password [empty]', + hide_input=True, + confirmation_prompt=True, + show_default=False, + default="") found = db.credential(fullname=fullname) if found and not force:
Add support for empty passwords when adding credentials. closes #<I>
marcwebbie_passpie
train
py
0612cfcd3ceda58eca9cee6ad9d3e778f1630bc4
diff --git a/lib/fidgit/elements/composite.rb b/lib/fidgit/elements/composite.rb index <HASH>..<HASH> 100644 --- a/lib/fidgit/elements/composite.rb +++ b/lib/fidgit/elements/composite.rb @@ -1,10 +1,10 @@ # encoding: utf-8 -require_relative 'container' +require_relative 'packer' module Fidgit # A composite element, made up of other elements (but manages them internally). - class Composite < Container + class Composite < Packer DEBUG_BORDER_COLOR = Gosu::Color.rgba(0, 255, 0, 100) # Color to draw an outline in when debugging layout. # @param (see Element#initialize)
Changed composite to be a packer, not a container.
gosu_fidgit
train
rb
5282518c1333c5509e64082cfba0fe64871d2ffc
diff --git a/actionview/test/template/sanitizers_test.rb b/actionview/test/template/sanitizers_test.rb index <HASH>..<HASH> 100644 --- a/actionview/test/template/sanitizers_test.rb +++ b/actionview/test/template/sanitizers_test.rb @@ -1,6 +1,6 @@ require 'abstract_unit' -class SanitizerTest < ActionController::TestCase +class SanitizersTest < ActionController::TestCase def setup @sanitizer = nil # used by assert_sanitizer end
Renamed the SanitizerTest class to SanitersTest, to remove the conflict with the old SanitizerTest for html-scanner.
rails_rails
train
rb
cd6014eb0dee70732ecc154263a3f51d50e9b3d6
diff --git a/ImageCacheProvider.js b/ImageCacheProvider.js index <HASH>..<HASH> 100644 --- a/ImageCacheProvider.js +++ b/ImageCacheProvider.js @@ -138,10 +138,13 @@ function downloadImage(fromUrl, toFile, headers = {}) { .config({path: tmpFile}) .fetch('GET', fromUrl, headers) .then(res => { - if (Math.floor(res.respInfo.status / 100) !== 2) { + const successfulResponse = Math.floor(res.respInfo.status / 100) === 2; + const cachedResponse = res.respInfo.status === 304; + // check for error responses (not 2** or 304) + if (!(successfulResponse || cachedResponse)) { throw new Error('Failed to successfully download image'); } - //The download is complete and rename the temporary file + // The download is complete and rename the temporary file return fs.mv(tmpFile, toFile); }) .then(() => resolve(toFile))
properly check for cache response when downloading an image
kfiroo_react-native-cached-image
train
js
28e3ede3d1731f1da1a461cdcb5c5c223cd41aa1
diff --git a/spec/adhearsion/logging_spec.rb b/spec/adhearsion/logging_spec.rb index <HASH>..<HASH> 100644 --- a/spec/adhearsion/logging_spec.rb +++ b/spec/adhearsion/logging_spec.rb @@ -1,5 +1,8 @@ require 'spec_helper' +Foo = Class.new +Foo::Bar = Class.new + describe Adhearsion::Logging do before do 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 @@ -40,11 +40,4 @@ RSpec.configure do |config| end end - Adhearsion::Logging.silence! - -class Foo - class Bar - end -end -
[CS] Move some helper classes for the logging specs locally
adhearsion_adhearsion
train
rb,rb
03726ec53cb138b74da948b17fc9b3d6f2df26e6
diff --git a/example/www/php/example.php b/example/www/php/example.php index <HASH>..<HASH> 100644 --- a/example/www/php/example.php +++ b/example/www/php/example.php @@ -136,6 +136,7 @@ function save_order_data($orderid, $data) { $data['orderid'] = $orderid; ftruncate($fh, 0); + rewind($fh); fwrite($fh, json_encode($data)); fflush($fh); flock($fh, LOCK_UN);
Rewund the handle as well after we truncate or we will create a file with a hole in it.
trustly_trustly-client-php
train
php
1cf3a870ad62bfbec1715fb9b7b261948c48d5d2
diff --git a/src/network/connection.js b/src/network/connection.js index <HASH>..<HASH> 100644 --- a/src/network/connection.js +++ b/src/network/connection.js @@ -100,7 +100,7 @@ module.exports = class Connection { clearTimeout(timeoutId) const error = new KafkaJSConnectionError(`Connection error: ${e.message}`) - this.logError(error.message) + this.logError(error.message, { stack: e.stack }) await this.disconnect() this.rejectRequests(error) @@ -238,6 +238,12 @@ module.exports = class Connection { size, }) + this.logDebug(`Response ${requestInfo(entry)}`, { + error: e.message, + correlationId, + payload, + }) + throw e } }
Add stack trace to connection error logs
tulios_kafkajs
train
js
6ae04f99ad4cea3d33d8b62f9cce05f15683bbbe
diff --git a/src/prod/bootstrap.js b/src/prod/bootstrap.js index <HASH>..<HASH> 100644 --- a/src/prod/bootstrap.js +++ b/src/prod/bootstrap.js @@ -174,8 +174,8 @@ class Bootstrap { document.getElementById('loader_bar').style.width = '30%'; humane.infoLarge = humane.spawn({addnCls: 'humane-libnotify-info humane-large', timeout: 5000}); - humane.info = humane.spawn({addnCls: 'humane-libnotify-info', timeout: 4000}); - humane.error = humane.spawn({addnCls: 'humane-libnotify-error', timeout: 4000}); + humane.info = humane.spawn({addnCls: 'humane-libnotify-info', timeout: 1000}); + humane.error = humane.spawn({addnCls: 'humane-libnotify-error', timeout: 1000}); humane.forceNew = true; // cguModule.activateCgus();
PHRAS-<I> : change the notification timeout only for downloading files
alchemy-fr_Phraseanet-production-client
train
js
58b9ebad96054218281750dbad0bcc0ae98b5088
diff --git a/manifest.php b/manifest.php index <HASH>..<HASH> 100755 --- a/manifest.php +++ b/manifest.php @@ -33,7 +33,7 @@ return array( 'author' => 'Open Assessment Technologies', 'requires' => array( 'taoTests' => '>=6.4.0', - 'taoQtiItem' => '>=9.7.0', + 'taoQtiItem' => '>=9.9.0', 'tao' => '>=12.12.0', 'generis' => '>=3.36.0', 'taoDelivery' => '>=7.0.0',
Update taoQtiItem dependency.
oat-sa_extension-tao-testqti
train
php
d5ecf8f5eaf818e85455d286dd635511012d5659
diff --git a/metaknowledge/recordCollection.py b/metaknowledge/recordCollection.py index <HASH>..<HASH> 100644 --- a/metaknowledge/recordCollection.py +++ b/metaknowledge/recordCollection.py @@ -951,9 +951,13 @@ class RecordCollection(object): > A networkx Graph with the objects of the tags _tags_ as nodes and their co-occurrences as edges """ + nomalizedTags = [] for t in tags: - if t not in tagsAndNameSet: + try: + nomalizedTags.append(normalizeToTag(t)) + except KeyError: raise TypeError(str(t) + " is not a known tag, or the name of a known tag.") + tags = nomalizedTags if metaknowledge.VERBOSE_MODE: PBar = _ProgressBar(0, "Starting to make a " + str(len(tags)) + "-mode network of: " + ', '.join(tags)) count = 0
Cleaned up input to nMode as well Former-commit-id: a<I>dbe<I>a8a3df<I>fb<I>da8c<I>f<I>c
networks-lab_metaknowledge
train
py
cdbd60ab9cc2fb288c524ae232ad719d81fd8de4
diff --git a/test/test_cassandraclient.py b/test/test_cassandraclient.py index <HASH>..<HASH> 100644 --- a/test/test_cassandraclient.py +++ b/test/test_cassandraclient.py @@ -267,10 +267,21 @@ class CassandraClientTest(unittest.TestCase): memtable_operations_in_millions=1.1671875, replicate_on_write=False, merge_shards_chance=0.10000000000000001, + row_cache_provider=None, + key_alias=None, ) + post_07_fields = ['replicate_on_write', 'merge_shards_chance', + 'key_validation_class', 'row_cache_provider', 'key_alias'] + yield self.client.system_add_column_family(cfdef) ksdef = yield self.client.describe_keyspace(KEYSPACE) cfdef2 = [c for c in ksdef.cf_defs if c.name == T_CF][0] + + for field in post_07_fields: + # Most of these are ignored in 0.7, so we can't reliably compare them + setattr(cfdef, field, None) + setattr(cfdef2, field, None) + # we don't know the id ahead of time. copy the new one so the equality # comparison won't fail cfdef.id = cfdef2.id
Don't compare post-<I> CfDef attributes in tests
driftx_Telephus
train
py
198ce6c4e29577e5f7969cbdd13414748f5c487d
diff --git a/classes/Gems/Tracker/Field/DateField.php b/classes/Gems/Tracker/Field/DateField.php index <HASH>..<HASH> 100644 --- a/classes/Gems/Tracker/Field/DateField.php +++ b/classes/Gems/Tracker/Field/DateField.php @@ -120,6 +120,13 @@ class DateField extends FieldAbstract } } + if ($currentValue instanceof \MUtil_Date) { + return $currentValue; + } + if ($currentValue) { + return \MUtil_Date::ifDate($currentValue, array($this->getDateFormat(), $this->getStorageFormat())); + } + return $currentValue; }
Restored some code that was removedin earlier commit
GemsTracker_gemstracker-library
train
php
863c18904febf364876494ee650ced49c3b08bd9
diff --git a/mode/javascript/javascript.js b/mode/javascript/javascript.js index <HASH>..<HASH> 100644 --- a/mode/javascript/javascript.js +++ b/mode/javascript/javascript.js @@ -640,7 +640,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { return cont(expect("variable"), maybetypeOrIn, expect("]"), typeprop) } else if (type == "(") { return pass(functiondecl, typeprop) - } else { + } else if (!type.match(/[;\}\)\],]/)) { return cont() } }
[javascript mode] Make sure type props don't consume closing braces
codemirror_CodeMirror
train
js
7805647934b2e73fdc5c16eb273d4ba04facb1cd
diff --git a/lib/flipper/dsl.rb b/lib/flipper/dsl.rb index <HASH>..<HASH> 100644 --- a/lib/flipper/dsl.rb +++ b/lib/flipper/dsl.rb @@ -47,7 +47,7 @@ module Flipper end def features - adapter.set_members('features').map { |name| feature(name) }.to_set + adapter.features.map { |name| feature(name) }.to_set end private
Use adapter wrapper #features instead of set_members with key
jnunemaker_flipper
train
rb
24fb715b801c98cae6cc5c094f397a814a796b7f
diff --git a/chainlet/wrapper.py b/chainlet/wrapper.py index <HASH>..<HASH> 100644 --- a/chainlet/wrapper.py +++ b/chainlet/wrapper.py @@ -27,18 +27,3 @@ class WrapperMixin(object): @property def slave(self): return self.__wrapped__ - - @classmethod - def linklet(cls, target): - """ - Convert any callable constructor to a chain link constructor - """ - def linker(*args, **kwargs): - """ - Creates a new instance of a chain link - - :rtype: ChainLink - """ - return cls(target(*args, **kwargs)) - functools.update_wrapper(linker, target) - return linker
removed deprecated linklet interface for GeneratorLink and FunctionLink
maxfischer2781_chainlet
train
py
acbfae658f7e7726dd0575559887baa8fb33753c
diff --git a/salt/states/file.py b/salt/states/file.py index <HASH>..<HASH> 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -742,6 +742,20 @@ def managed(name, Default is None. If specified, will use the given string as the contents of the file. Should not be used in conjunction with a source file of any kind. Ignores hashes and does not use a templating engine. + + Note, including a multiline string from an external source (such as + Pillar) presents a formatting challenege since the multiline content + will not adhere to YAML's required indentation. The external content + must be indented manually at the Jinja level:: + + /tmp/myfile: + file: + - managed + - contents: | + {{ salt['pillar.get']('some:multiline:text') | indent(8) }} + + # Note the above example is indented by 8 spaces. + ''' # Make sure that leading zeros stripped by YAML loader are added back mode = __salt__['config.manage_mode'](mode)
Added note about multiline content when using file.managed.contents Closes #<I>
saltstack_salt
train
py
8783c7bcaaba72cda39021a4af3990782d22eda3
diff --git a/insights/util/subproc.py b/insights/util/subproc.py index <HASH>..<HASH> 100644 --- a/insights/util/subproc.py +++ b/insights/util/subproc.py @@ -97,7 +97,7 @@ class Pipeline(object): last = len(self.cmds) - 2 for i, arg in enumerate(self.cmds[1:]): if i < last: - stdout = Popen(arg, bufsize=self.bufsize, stdin=stdout, stderr=STDOUT, STDOUT=PIPE, env=self.env).stdout + stdout = Popen(arg, bufsize=self.bufsize, stdin=stdout, stderr=STDOUT, stdout=PIPE, env=self.env).stdout else: return Popen(arg, bufsize=self.bufsize, stdin=stdout, stderr=STDOUT, stdout=out_stream, env=self.env)
Fix a typo of stdout in subproc.py (#<I>)
RedHatInsights_insights-core
train
py
5e0a208fa28403891eeaf1903d8d348154465ace
diff --git a/spec/support/dtmf_helper.rb b/spec/support/dtmf_helper.rb index <HASH>..<HASH> 100644 --- a/spec/support/dtmf_helper.rb +++ b/spec/support/dtmf_helper.rb @@ -1,4 +1,5 @@ # encoding: utf-8 +# frozen_string_literal: true # # Convert a simple DTMF string from "1 star 2" to "dtmf-1 dtmf-star dtmf-2".
[CS] Appease the blood hound with a frozen string sacrifice
adhearsion_ruby_speech
train
rb
700a93f935bd1dd11d4fa2204adcc27f08659938
diff --git a/lib/minstall.js b/lib/minstall.js index <HASH>..<HASH> 100755 --- a/lib/minstall.js +++ b/lib/minstall.js @@ -681,6 +681,11 @@ function runPostinstalls(modules) { continue; } + if (!module.postinstallCommand) { + logger.debug(`skipping the postinstall of ${module.name}. it has no postinstall script.`); + continue; + } + logger.debug(`running postinstall of ${module.name}`); postinstallPromises.push(systools.runCommand(`cd ${module.fullModulePath}${commandConcatSymbol} ${module.postinstallCommand}`)); } diff --git a/lib/moduletools.js b/lib/moduletools.js index <HASH>..<HASH> 100644 --- a/lib/moduletools.js +++ b/lib/moduletools.js @@ -57,10 +57,7 @@ const moduletools = { ]) .then((currentLevelModules) => { - // the mother-module has installed dependencies, but is not a local module itself! - if (location !== process.cwd()) { - result.modules.push(currentLevelModules[0]); - } + result.modules.push(currentLevelModules[0]); result.installedDependencies = result.installedDependencies.concat(currentLevelModules[1]); // recursively get the local modules and installed dependencies of all the other local modules
:bug: fix installing of peer-dependencies of the parent-module
heikomat_minstall
train
js,js
e93b43972040952482d6cbe62a05264fbef5e718
diff --git a/symphony/lib/toolkit/class.databasequery.php b/symphony/lib/toolkit/class.databasequery.php index <HASH>..<HASH> 100644 --- a/symphony/lib/toolkit/class.databasequery.php +++ b/symphony/lib/toolkit/class.databasequery.php @@ -275,6 +275,10 @@ class DatabaseQuery extends DatabaseStatement $col = $dir; $dir = null; } + if ($col === 'RAND()') { + $orders[] = 'RAND()'; + continue; + } $dir = $dir ?: $direction; General::ensureType([ 'col' => ['var' => $col, 'type' => 'string'],
Allow RAND() to be used as a column name in sorts Picked from c5cfd<I>c Picked from 5cd6afad0a Picked from 0e<I>cfde1
symphonycms_symphony-2
train
php
60123b2358da6c178805eae89b323c6b81e37e2d
diff --git a/tests/test_argc.py b/tests/test_argc.py index <HASH>..<HASH> 100644 --- a/tests/test_argc.py +++ b/tests/test_argc.py @@ -149,4 +149,5 @@ if __name__ == "__main__": test_arm() test_i386() test_amd64() - test_ppc32() + # ppc32 doesn't work for now + #test_ppc32()
Commented out test_ppc<I>() from test_argc.py as it doesn't work for now.
angr_angr
train
py
c78a86ddc963c4b41f381e6b3f5e484935824cf9
diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/WellKnownMutability.java b/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/WellKnownMutability.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/WellKnownMutability.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/WellKnownMutability.java @@ -165,6 +165,11 @@ public final class WellKnownMutability { .add(java.math.BigInteger.class) .add(java.net.InetAddress.class) .add(java.net.URI.class) + .add(java.nio.charset.Charset.class) + .add(java.nio.file.Path.class) + .add(java.nio.file.WatchEvent.class) + .add(java.nio.file.attribute.AclEntry.class) + .add(java.nio.file.attribute.FileTime.class) .add(java.util.UUID.class) .add(java.util.Locale.class) .add(java.util.regex.Pattern.class)
Add java.nio.file.Path to the list of well known immutable types. RELNOTES: Added java.nio.file.Path to the list of well known immutable types. ------------- Created by MOE: <URL>
google_error-prone
train
java
0e2e5f94833fe2385fb75287990a0570dc7cff54
diff --git a/components/Account.php b/components/Account.php index <HASH>..<HASH> 100644 --- a/components/Account.php +++ b/components/Account.php @@ -330,6 +330,8 @@ class Account extends ComponentBase Flash::success(Lang::get(/*An activation email has been sent to your email address.*/'rainlab.user::lang.account.activation_email_sent')); } + $intended = false; + /* * Activation is by the admin, show message * For automatic email on account activation RainLab.Notify plugin is needed @@ -343,12 +345,13 @@ class Account extends ComponentBase */ if ($automaticActivation || !$requireActivation) { Auth::login($user); + $intended = true; } /* * Redirect to the intended page after successful sign in */ - if ($redirect = $this->makeRedirection(true)) { + if ($redirect = $this->makeRedirection($intended)) { return $redirect; } }
Fix intended redirect fix on register success (#<I>)
rainlab_user-plugin
train
php
a98ea87e463383a77d7244c78c9da3ac9f2cd086
diff --git a/graph/pull.go b/graph/pull.go index <HASH>..<HASH> 100644 --- a/graph/pull.go +++ b/graph/pull.go @@ -654,6 +654,10 @@ func (s *TagStore) pullV2Tag(r *registry.Session, out io.Writer, endpoint *regis return false, err } + if err := s.graph.SetDigest(d.img.ID, d.digest); err != nil { + return false, err + } + // FIXME: Pool release here for parallel tag pull (ensures any downloads block until fully extracted) } out.Write(sf.FormatProgress(stringid.TruncateID(d.img.ID), "Pull complete", nil))
Store layer digests on pull Currently digests are not stored on pull, causing a simple re-tag or re-push to send up all layers. Storing the digests on pull will allow subsequent pushes to the same repository to not push up content. This does not address pushing content to a new repository. When content is pushed to a new repository, the digest will be recalculated. Since only one digest is currently stored, it may cause a new content push to the original repository. Fixes #<I>
moby_moby
train
go
76e433e358e66d343048cff431183e23bcd17ef1
diff --git a/src/Core/Content/Media/DataAbstractionLayer/Indexing/MediaThumbnailIndexer.php b/src/Core/Content/Media/DataAbstractionLayer/Indexing/MediaThumbnailIndexer.php index <HASH>..<HASH> 100644 --- a/src/Core/Content/Media/DataAbstractionLayer/Indexing/MediaThumbnailIndexer.php +++ b/src/Core/Content/Media/DataAbstractionLayer/Indexing/MediaThumbnailIndexer.php @@ -81,8 +81,7 @@ class MediaThumbnailIndexer implements IndexerInterface, EventSubscriberInterfac public function refresh(EntityWrittenContainerEvent $event): void { if ($thumbnailEvent = $event->getEventByDefinition(MediaDefinition::class)) { - $mediaIds = array_column($thumbnailEvent->getIds(), 'id'); - $this->updateThumbnailsRoField($mediaIds, $event->getContext()); + $this->updateThumbnailsRoField($thumbnailEvent->getIds(), $event->getContext()); } }
NTR - Prevent thumbnail indexer to index all media every time
shopware_platform
train
php
093522b2877fc8d3049d69f7b3fe6b000643e568
diff --git a/lib/rubocop_challenger/rubocop/yardoc.rb b/lib/rubocop_challenger/rubocop/yardoc.rb index <HASH>..<HASH> 100644 --- a/lib/rubocop_challenger/rubocop/yardoc.rb +++ b/lib/rubocop_challenger/rubocop/yardoc.rb @@ -66,15 +66,7 @@ module RubocopChallenger end def source_file_path - if Object.respond_to?(:const_source_location) - Object.const_source_location(cop_class.name).first - else - instance_methods - .map { |m| cop_class.instance_method(m).source_location } - .compact - .map(&:first) - .first - end + Object.const_source_location(cop_class.name).first end end end
Remove the code for backward compatibility with Ruby <I>
ryz310_rubocop_challenger
train
rb
521e998ba71c9859e3f2202baac3b7baea7d6222
diff --git a/test/unit/builtins/test_packages.py b/test/unit/builtins/test_packages.py index <HASH>..<HASH> 100644 --- a/test/unit/builtins/test_packages.py +++ b/test/unit/builtins/test_packages.py @@ -129,7 +129,8 @@ class TestPackage(BuiltinTest): mock_obj = mock.patch.object with mock_obj(self.env, 'builder', wraps=self.env.builder) as m, \ mock.patch('bfg9000.shell.execute', mock_execute), \ - mock.patch('bfg9000.shell.which', mock_which): # noqa + mock.patch('bfg9000.shell.which', mock_which), \ + mock.patch('logging.log'): # noqa yield m package = self.context['package']
Silence some extraneous logging in unit test
jimporter_bfg9000
train
py
9f6b577f081a88ff5917166775b1b53ffcc07fcd
diff --git a/aiogram/dispatcher/filters/builtin.py b/aiogram/dispatcher/filters/builtin.py index <HASH>..<HASH> 100644 --- a/aiogram/dispatcher/filters/builtin.py +++ b/aiogram/dispatcher/filters/builtin.py @@ -501,7 +501,7 @@ class ExceptionsFilter(BoundFilter): return False -class IdFilter(Filter): +class IDFilter(Filter): def __init__(self, user_id: Optional[Union[Iterable[Union[int, str]], str, int]] = None,
Rename IdFilter to IDFilter Rename IdFilter to IDFilter as it is an abbreviation like URL
aiogram_aiogram
train
py
894b8f23d6d51188d8e8f3e14ac432a5bdc4aace
diff --git a/lib/omnibus.rb b/lib/omnibus.rb index <HASH>..<HASH> 100644 --- a/lib/omnibus.rb +++ b/lib/omnibus.rb @@ -116,6 +116,13 @@ module Omnibus @logger ||= Logger.new end + # + # @api private + # + # Programatically set the logger for Omnibus. + # + # @param [Logger] logger + # def logger=(logger) @logger = logger end
Document attr_writer for logger
chef_omnibus
train
rb
304f0c02c2d596a64a17e6dbf10baadf49a6024a
diff --git a/benchexec/tools/metaval.py b/benchexec/tools/metaval.py index <HASH>..<HASH> 100644 --- a/benchexec/tools/metaval.py +++ b/benchexec/tools/metaval.py @@ -29,7 +29,7 @@ class Tool(benchexec.tools.template.BaseTool2): """ TOOL_TO_PATH_MAP = { - "cpachecker-metaval": "CPAchecker-backend", + "cpachecker-metaval": "CPAchecker-frontend", "cpachecker": "CPAchecker", "esbmc": "esbmc", "symbiotic": "symbiotic",
Correct imprecise naming in MetaVal
sosy-lab_benchexec
train
py
18b70fc71b0ff46cefc9c842c1de00e1d8d32a91
diff --git a/src/Models/Category.php b/src/Models/Category.php index <HASH>..<HASH> 100644 --- a/src/Models/Category.php +++ b/src/Models/Category.php @@ -4,12 +4,16 @@ declare(strict_types=1); namespace Cortex\Categories\Models; -use Cortex\Foundation\Events\CrudPerformed; use Kalnoy\Nestedset\NestedSet; use Cortex\Foundation\Traits\Auditable; use Rinvex\Support\Traits\HashidsTrait; use Spatie\Activitylog\Traits\LogsActivity; use Cortex\Foundation\Traits\FiresCustomModelEvent; +use Cortex\Foundation\Events\ModelDeleted; +use Cortex\Foundation\Events\ModelCreated; +use Cortex\Foundation\Events\ModelUpdated; +use Cortex\Foundation\Events\ModelRestored; + use Rinvex\Categories\Models\Category as BaseCategory; /** @@ -85,10 +89,10 @@ class Category extends BaseCategory * @var array */ protected $dispatchesEvents = [ - 'created' => CrudPerformed::class, - 'deleted' => CrudPerformed::class, - 'restored' => CrudPerformed::class, - 'updated' => CrudPerformed::class, + 'created' => ModeC::class, + 'deleted' => ModelDeleted::class, + 'restored' => ModelRestored::class, + 'updated' => ModelUpdated::class, ]; /**
Refactor model CRUD dispatched events
rinvex_cortex-categories
train
php
2e92b015dbe28c2038801a8375b7ac5a7a6c8dfc
diff --git a/drools-core/src/test/java/org/drools/reteoo/NodeSegmentUnlinkingTest.java b/drools-core/src/test/java/org/drools/reteoo/NodeSegmentUnlinkingTest.java index <HASH>..<HASH> 100644 --- a/drools-core/src/test/java/org/drools/reteoo/NodeSegmentUnlinkingTest.java +++ b/drools-core/src/test/java/org/drools/reteoo/NodeSegmentUnlinkingTest.java @@ -20,11 +20,13 @@ import org.drools.reteoo.builder.BuildContext; import org.drools.rule.Rule; import org.drools.spi.PropagationContext; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.kie.KnowledgeBaseConfiguration; import org.kie.KnowledgeBaseFactory; import org.kie.builder.conf.LRUnlinkingOption; +@Ignore public class NodeSegmentUnlinkingTest { ReteooRuleBase ruleBase; BuildContext buildContext;
added @ignore to failing test
kiegroup_drools
train
java
f6ef0c046d78c75d177099fea276f83c8dab178f
diff --git a/lib/coa.js b/lib/coa.js index <HASH>..<HASH> 100644 --- a/lib/coa.js +++ b/lib/coa.js @@ -21,9 +21,12 @@ module.exports = require('coa').Cmd() // Give ability for external technologies to has its own options without conflicts with borschik .name('techOptions') .title('Additional options for tech in JSON format') .short('to').long('tech-options') - .def("{}") + .def({}) .val(function(v) { - return JSON.parse(v); + if (typeof v === 'string') { + v = JSON.parse(v); + } + return v; }) .end() .opt()
Allow to pass an object as the techOptions value
borschik_borschik
train
js
c203f70b29e1027b479bbbbfb00dbfbffab9bf31
diff --git a/api/src/main/java/org/commonjava/indy/conf/DefaultIndyConfiguration.java b/api/src/main/java/org/commonjava/indy/conf/DefaultIndyConfiguration.java index <HASH>..<HASH> 100644 --- a/api/src/main/java/org/commonjava/indy/conf/DefaultIndyConfiguration.java +++ b/api/src/main/java/org/commonjava/indy/conf/DefaultIndyConfiguration.java @@ -314,14 +314,16 @@ public class DefaultIndyConfiguration } @ConfigName(value = "remote.nossl.hosts") - public void setRemoteNoSSLHosts(String hosts) { + public void setRemoteNoSSLHosts(String hosts) + { String[] arrayNSSLHosts = hosts.split(","); this.remoteNoSSLHosts = new ArrayList<>(); this.remoteNoSSLHosts.addAll(Arrays.asList(arrayNSSLHosts)); } @Override - public List<String> remoteNoSSLHosts() { + public List<String> remoteNoSSLHosts() + { return this.remoteNoSSLHosts; } }
Added Configuration for SSL required and for remote noSSL hosts
Commonjava_indy
train
java
4a8d9da9e4000df78199df119ba62cb9f7db75a6
diff --git a/gcs/update_object.go b/gcs/update_object.go index <HASH>..<HASH> 100644 --- a/gcs/update_object.go +++ b/gcs/update_object.go @@ -87,6 +87,9 @@ func (b *bucket) UpdateObject( query := make(url.Values) query.Set("projection", "full") + if req.Generation != 0 { + query.Set("generation", fmt.Sprintf("%d", req.Generation)) + } url := &url.URL{ Scheme: "https",
Include a generation, if set.
jacobsa_gcloud
train
go
a8b9941e64b6797586f5259e6e4dcc5f2f30636f
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ params = dict( 'keyring[test] >= 10.3.1', 'fs>=0.5,<2', - 'pycrypto', + 'pycrypto; sys_platform!="win32" or python_version=="2.7"', # gdata doesn't currently install on Python 3 # http://code.google.com/p/gdata-python-client/issues/detail?id=229
Pycrypto isn't building on Python <I> in Appveyor, so disable it.
jaraco_keyrings.alt
train
py
b98e7c62ff0645c49d981f7f673152d6b563d466
diff --git a/lib/accesslib.php b/lib/accesslib.php index <HASH>..<HASH> 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -2653,7 +2653,6 @@ function get_roles_with_capability($capability, $permission=NULL, $context='') { */ function role_assign($roleid, $userid, $groupid, $contextid, $timestart=0, $timeend=0, $hidden=0, $enrol='manual',$timemodified='') { global $USER, $CFG, $DB; - require_once($CFG->dirroot.'/group/lib.php'); /// Do some data validation
MDL-<I>: required library was included in the wrong function - this removes the old one.
moodle_moodle
train
php
699682274056351d9c7eec3259abb7e558d2947a
diff --git a/lib/Serverless.js b/lib/Serverless.js index <HASH>..<HASH> 100644 --- a/lib/Serverless.js +++ b/lib/Serverless.js @@ -186,6 +186,10 @@ class Serverless { if (!_this.commands[_this.cli.context][_this.cli.action]) { return BbPromise.reject(new SError('Command not found. Enter "serverless help" to see all available commands.')); } + // if not in project root and not creating project, throw error + if (!this.config.projectPath && _this.cli.context != 'project' && _this.cli.context != 'create') { + return BbPromise.reject(new SError('This command can only be run inside a Serverless project.')); + } // Get Command Config let cmdConfig = _this.commands[_this.cli.context][_this.cli.action];
validating that we are inside a serverless project for all actions except project create
serverless_serverless
train
js
12092f4c1329fa0fefbf57cf553e5e25523c5717
diff --git a/gwpy/timeseries/io/lalframe.py b/gwpy/timeseries/io/lalframe.py index <HASH>..<HASH> 100644 --- a/gwpy/timeseries/io/lalframe.py +++ b/gwpy/timeseries/io/lalframe.py @@ -209,11 +209,14 @@ def read_timeseriesdict(source, channels, start=None, end=None, dtype=None, # now read the data out = series_class.DictClass() - for src in source: + for i, src in enumerate(source): stream = open_data_source(src) out.append(read_stream(stream, channels, start=start, end=end, series_class=series_class), gap=gap, pad=pad, copy=False) + if i == 0: # force data into fresh memory if needed + for name in out: + out[name] = numpy.require(out[name], requirements=['O']) for name in out: if (resample.get(name) and resample[name] != out[name].sample_rate.value):
timeseries.io.lalframe: use numpy to acquire data if needed
gwpy_gwpy
train
py
cdd3aa6d01d42872c4a3572d2e73639500bffc42
diff --git a/lib/dynamoid/adapter_plugin/aws_sdk_v3.rb b/lib/dynamoid/adapter_plugin/aws_sdk_v3.rb index <HASH>..<HASH> 100644 --- a/lib/dynamoid/adapter_plugin/aws_sdk_v3.rb +++ b/lib/dynamoid/adapter_plugin/aws_sdk_v3.rb @@ -605,7 +605,7 @@ module Dynamoid results = client.query(q) results.items.each { |row| y << result_item_to_hash(row) } - record_count += results.items.size + record_count += results.count break if record_limit && record_count >= record_limit scan_count += results.scanned_count @@ -685,7 +685,7 @@ module Dynamoid results = client.scan(request) results.items.each { |row| y << result_item_to_hash(row) } - record_count += results.items.size + record_count += results.count break if record_limit && record_count >= record_limit scan_count += results.scanned_count
Use `result.count` in query and scan operations
Dynamoid_dynamoid
train
rb
d9360500be30d742ee5b7d7d5dcd6e2402b9ebb4
diff --git a/databasetools/csv_tools/csv.py b/databasetools/csv_tools/csv.py index <HASH>..<HASH> 100644 --- a/databasetools/csv_tools/csv.py +++ b/databasetools/csv_tools/csv.py @@ -26,7 +26,7 @@ class CSVExport: self.data_to_csv() def __str__(self): - return str(self.file_name) + return str(self.file_name).strip() def data_to_csv(self): df = DataFrame(self.data, columns=self.cols)
Added .strip() method to str return
mrstephenneal_databasetools
train
py
dc9d46f0baae868b86189fc2b293d9dadb4b7230
diff --git a/src/ng-tiny-scrollbar.js b/src/ng-tiny-scrollbar.js index <HASH>..<HASH> 100644 --- a/src/ng-tiny-scrollbar.js +++ b/src/ng-tiny-scrollbar.js @@ -159,7 +159,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. $element.on(wheelEvent, wheel); } - if (self.options.autoUpdate && typeof window.MutationObserver === 'function') { + if (self.options.autoUpdate && typeof MutationObserver === 'function') { (function () { var recentWidth = $overview[0].offsetWidth, recentHeight = $overview[0].offsetHeight,
Update ng-tiny-scrollbar.js
yads_ngTinyScrollbar
train
js
2d0dfdf6be23743e90c091c3f543293cc099d043
diff --git a/embark-ui/src/components/Processes.js b/embark-ui/src/components/Processes.js index <HASH>..<HASH> 100644 --- a/embark-ui/src/components/Processes.js +++ b/embark-ui/src/components/Processes.js @@ -26,7 +26,7 @@ const Process = ({process}) => ( <i className={iconClasses(process.state)}></i> </span> <div> - <h4 className="text-capitalize m-0"><Link to={`/embark/processes/${process.name}`}>{process.name}</Link></h4> + <h4 className="text-capitalize m-0"><Link to={`/embark/processes/${process.name}`}>{process.name} ({process.state})</Link></h4> </div> </div> </Card>
uiux(embark-ui/HomeContainer): show state of connected processes
embark-framework_embark
train
js
534762ca35cbe605e7f0380b5f3b4c68217d0a48
diff --git a/src/Sylius/Bundle/AdminBundle/Controller/DashboardController.php b/src/Sylius/Bundle/AdminBundle/Controller/DashboardController.php index <HASH>..<HASH> 100644 --- a/src/Sylius/Bundle/AdminBundle/Controller/DashboardController.php +++ b/src/Sylius/Bundle/AdminBundle/Controller/DashboardController.php @@ -73,7 +73,7 @@ final class DashboardController public function getRawData(Request $request): Response { /** @var ChannelInterface|null $channel */ - $channel = $this->findChannelByCodeOrFindFirst($request->query->get('channel')); + $channel = $this->findChannelByCodeOrFindFirst($request->query->get('channelCode')); if (null === $channel) { return new RedirectResponse($this->router->generate('sylius_admin_channel_create'));
fixed name to channelCode since we are sending code
Sylius_Sylius
train
php
f78e7d6c155f32327d77e20fe406b36a69eeb013
diff --git a/alot/buffers.py b/alot/buffers.py index <HASH>..<HASH> 100644 --- a/alot/buffers.py +++ b/alot/buffers.py @@ -310,7 +310,7 @@ class TagListBuffer(Buffer): self.isinitialized = True lines = list() - displayedtags = filter(self.filtfun, self.tags) + displayedtags = sorted(filter(self.filtfun, self.tags), key=unicode.lower) for (num, b) in enumerate(displayedtags): tw = widgets.TagWidget(b) lines.append(urwid.Columns([('fixed', tw.width(), tw)]))
Sort TagListBuffer Make sorting of tags in TagListBuffer case insensitive. So far the following three tags would have been sorted like ['Notmuch', 'alot', 'xapian']. The new case insensitive sorting will arrange them as ['alot', 'Notmuch', 'xapian']. Closes #<I>.
pazz_alot
train
py
31b55d14d60d82e4d94bd603d80dc88e4c76c28c
diff --git a/src/ibmiotf/__init__.py b/src/ibmiotf/__init__.py index <HASH>..<HASH> 100644 --- a/src/ibmiotf/__init__.py +++ b/src/ibmiotf/__init__.py @@ -142,7 +142,7 @@ class AbstractClient(object): # Attach MQTT callbacks self.client.on_log = self._onLog self.client.on_disconnect = self._onDisconnect - self.client.on_publish = self.on_publish + self.client.on_publish = self._onPublish # Initialize default message encoders and decoders. self._messageEncoderModules = {} @@ -275,7 +275,7 @@ class AbstractClient(object): self.logger.info("Disconnected from the IBM Watson IoT Platform") self.stats() - def on_publish(self, mqttc, obj, mid): + def _onPublish(self, mqttc, obj, mid): """ Called when a message from the client has been successfully sent to IBM Watson IoT Platform.
Mark on_publish() as private -> _onPublish()
ibm-watson-iot_iot-python
train
py
775f6592a168ba3eb7b7d6ff214ece7d2026baa1
diff --git a/pyocd/flash/loader.py b/pyocd/flash/loader.py index <HASH>..<HASH> 100755 --- a/pyocd/flash/loader.py +++ b/pyocd/flash/loader.py @@ -471,10 +471,16 @@ class FlashLoader(object): totalSamePageCount += perf.same_page_count totalProgramTime += perf.program_time + # Compute kbps while avoiding a potential zero-div error. + if totalProgramTime == 0: + kbps = 0 + else: + kbps = (totalByteCount/1024) / totalProgramTime + LOG.info("Programmed %d bytes (%d pages) at %.02f kB/s (%d pages unchanged)", totalByteCount, totalPageCount, - ((totalByteCount/1024) / totalProgramTime), + kbps, totalSamePageCount) # Clear state to allow reuse.
Work around potential zero-div error in FlashLoader.
mbedmicro_pyOCD
train
py
9f5033b6f3c18ab8fdbdfe2d111f4c46ce02c5af
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -3,10 +3,10 @@ var gutil = require('gulp-util'); var mocha = require('gulp-mocha'); var jshint = require('gulp-jshint'); -gulp.task('default', ['lint','unitTest','integrationTest']); +gulp.task('default', ['lint','test']); gulp.task('watch', function() { - gulp.watch(['test/**', 'lib/**'], ["lint","unitTest","integrationTest"]) + gulp.watch(['test/**', 'lib/**'], ["lint","test"]) }); gulp.task('lint', function() { @@ -16,6 +16,8 @@ gulp.task('lint', function() { .pipe(jshint.reporter('default')); }); +gulp.task('test',["unitTest","integrationTest"]); + gulp.task('unitTest',function(){ gulp.src(['test/unit/**/*.js']) .pipe(mocha({ reporter: 'list' }))
Updated gulp to include a test task
tjchaplin_hammerdown
train
js
61db0f0391cbdcb925f13659da6647fea85bb155
diff --git a/spec/mail/encodings_spec.rb b/spec/mail/encodings_spec.rb index <HASH>..<HASH> 100644 --- a/spec/mail/encodings_spec.rb +++ b/spec/mail/encodings_spec.rb @@ -430,7 +430,6 @@ describe Mail::Encodings do it "should handle a very long string efficiently" do string = "This is a string " * 10000 - result.force_encoding('UTF-8') if RUBY_VERSION >= '1.9' Mail::Encodings.value_decode(string).should == string end end
No need to force encoding of anything in this spec
mikel_mail
train
rb
c3fdc990fcccb0171d59a9684cdadf1f869cb5f3
diff --git a/lxd/storage/filesystem/fs.go b/lxd/storage/filesystem/fs.go index <HASH>..<HASH> 100644 --- a/lxd/storage/filesystem/fs.go +++ b/lxd/storage/filesystem/fs.go @@ -36,9 +36,7 @@ func StatVFS(path string) (*unix.Statfs_t, error) { // Detect returns the filesystem on which the passed-in path sits. func Detect(path string) (string, error) { - fs := unix.Statfs_t{} - - err := unix.Statfs(path, &fs) + fs, err := StatVFS(path) if err != nil { return "", err }
lxd/storage/filesystem/fs: Switch Detect to use StatVFS
lxc_lxd
train
go
02c1101d8a3cdbf5ce05d14eb63fa7cba859f278
diff --git a/lib/linked-list/list.rb b/lib/linked-list/list.rb index <HASH>..<HASH> 100644 --- a/lib/linked-list/list.rb +++ b/lib/linked-list/list.rb @@ -62,7 +62,7 @@ module LinkedList self end - # Removes node from the end of the list. + # Removes data from the end of the list. # # == Returns: # Data stored in the node or nil. @@ -84,7 +84,7 @@ module LinkedList tail.data end - # Removes node from the beginning of the list. + # Removes data from the beginning of the list. # # == Returns: # Data stored in the node or nil.
Update docs. Those are data stored, not nodes.
spectator_linked-list
train
rb
03b44e399248f1b208b17afb8be6de5a4017c36e
diff --git a/lib/determine-basal/determine-basal.js b/lib/determine-basal/determine-basal.js index <HASH>..<HASH> 100644 --- a/lib/determine-basal/determine-basal.js +++ b/lib/determine-basal/determine-basal.js @@ -69,7 +69,11 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_ if (typeof autosens_data !== 'undefined' ) { min_bg = Math.round((min_bg - 60) / autosens_data.ratio) + 60; max_bg = Math.round((max_bg - 60) / autosens_data.ratio) + 60; - target_bg = Math.round((target_bg - 60) / autosens_data.ratio) + 60; + new_target_bg = Math.round((target_bg - 60) / autosens_data.ratio) + 60; + if (target_bg != new_target_bg) { + console.error("Adjusting target_bg from", target_bg, "to", new_target_bg); + } + target_bg = new_target_bg; } if (typeof iob_data === 'undefined' ) {
log when Adjusting target_bg
openaps_oref0
train
js
a1a8c9438fc3fd6a2b153187f545c95f6e261699
diff --git a/src/server/pps/server/worker_rc.go b/src/server/pps/server/worker_rc.go index <HASH>..<HASH> 100644 --- a/src/server/pps/server/worker_rc.go +++ b/src/server/pps/server/worker_rc.go @@ -122,6 +122,9 @@ func (a *apiServer) workerPodSpec(options *workerOptions, pipelineInfo *pps.Pipe }, { Name: "POSTGRES_DATABASE_NAME", Value: a.env.Config().PostgresDBName, + }, { + Name: "METRICS", + Value: strconv.FormatBool(a.env.Config().Metrics), }} sidecarEnv = append(sidecarEnv, assets.GetSecretEnvVars(a.storageBackend)...) sidecarEnv = append(sidecarEnv, a.getStorageEnvVars(pipelineInfo)...) @@ -179,6 +182,10 @@ func (a *apiServer) workerPodSpec(options *workerOptions, pipelineInfo *pps.Pipe Name: client.PeerPortEnv, Value: strconv.FormatUint(uint64(a.peerPort), 10), }, + { + Name: "METRICS", + Value: strconv.FormatBool(a.env.Config().Metrics), + }, }...) workerEnv = append(workerEnv, assets.GetSecretEnvVars(a.storageBackend)...)
Respect metrics state in pipeline pods. (#<I>)
pachyderm_pachyderm
train
go
f791e43495804fcbd049f5d6262005f16e41f888
diff --git a/src/Adapters/FHIRAppointmentAdapter.php b/src/Adapters/FHIRAppointmentAdapter.php index <HASH>..<HASH> 100644 --- a/src/Adapters/FHIRAppointmentAdapter.php +++ b/src/Adapters/FHIRAppointmentAdapter.php @@ -250,10 +250,10 @@ class FHIRAppointmentAdapter extends AbstractFHIRAdapter implements BaseAdapterI $extension1 = new FHIRExtension; $extension2 = new FHIRExtension; $extension3 = new FHIRExtension; - $extension->setUrl(json_decode($appointment->getLocation())->portalUri); + $extension->setUrl(); $extension1->setUrl('#portal-uri'); $value = new FHIRString(); - $value->setValue('https://vircon.vu2vu.com'); + $value->setValue(json_decode($appointment->getLocation())->portalUri); $extension1->setValueString($value); $extension2->setUrl('#room-key'); $value = new FHIRString();
fixing hardcoded value in Appointment
LibreHealthIO_lh-ehr-fhir-api
train
php
d68fcfcde5fa1bac8656d15e6b19e02effa8eabf
diff --git a/phonenumber_field/modelfields.py b/phonenumber_field/modelfields.py index <HASH>..<HASH> 100644 --- a/phonenumber_field/modelfields.py +++ b/phonenumber_field/modelfields.py @@ -57,6 +57,8 @@ class PhoneNumberField(models.Field): """ value = super(PhoneNumberField, self).get_prep_value(value) value = to_python(value) + if (value in validators.EMPTY_VALUES) and (self.null is True): + return None if not isinstance(value, PhoneNumber): return value format_string = getattr(settings, 'PHONENUMBER_DB_FORMAT', 'E164') diff --git a/testproject/testapp/tests.py b/testproject/testapp/tests.py index <HASH>..<HASH> 100644 --- a/testproject/testapp/tests.py +++ b/testproject/testapp/tests.py @@ -142,7 +142,7 @@ class PhonenumerFieldAppTest(TestCase): pk = tm.id tm = TestModel.objects.get(pk=pk) - self.assertEqual(tm.phone, '') + self.assertIsNone(tm.phone) self.assertEqual( 0, TestModel.objects
Return None when value is one of EMPTY_VALUES and null is True
stefanfoulis_django-phonenumber-field
train
py,py
b8b6fc8a360b669dec8d93c0d09511f0ddc80bab
diff --git a/views/js/runner/plugins/controls/review/review.js b/views/js/runner/plugins/controls/review/review.js index <HASH>..<HASH> 100644 --- a/views/js/runner/plugins/controls/review/review.js +++ b/views/js/runner/plugins/controls/review/review.js @@ -228,6 +228,7 @@ define([ canFlag: !context.isLinear && context.options.markReview }); self.show(); + updateButton(self.$toggleButton, getToggleButtonData(self.navigator)); } else { self.hide(); }
Set the correct state for the show/hide review button after the review panel is restored
oat-sa_extension-tao-testqti
train
js
b8001c56a3a9c234d188a39c75c6701adf56f71a
diff --git a/addon/initializers/route-alias.js b/addon/initializers/route-alias.js index <HASH>..<HASH> 100644 --- a/addon/initializers/route-alias.js +++ b/addon/initializers/route-alias.js @@ -96,9 +96,9 @@ function patchRoute(lookup) { }; } -export function initialize(container, application) { - // Make this work in 1.X and 2.X. - application = application || container; +export function initialize() { + // Make this work in 1.X and 2.X without deprecation warnings. + let application = arguments[1] || arguments[0]; // The dictionary we'll be using. const lookup = application._routeAliasLookup = {};
Pass one argument to initialize to address deprecation warning This shows up in the browser console when using ember-route-alias with a project that uses ember <I>+. Use the method suggested by the documentation at: <URL>
nathanhammond_ember-route-alias
train
js
d22dc751f9bb254e76cab742fc9d46fd7b1da2fc
diff --git a/src/FormHandler/Renderer/AbstractRenderer.php b/src/FormHandler/Renderer/AbstractRenderer.php index <HASH>..<HASH> 100644 --- a/src/FormHandler/Renderer/AbstractRenderer.php +++ b/src/FormHandler/Renderer/AbstractRenderer.php @@ -65,7 +65,7 @@ abstract class AbstractRenderer * @param Element $element * @return string */ - protected function parseTag(Tag &$tag, Element $element) + protected function parseTag(Tag $tag, Element $element) { $list = [ 'disabled' => 'isDisabled',
Tag is no longer by reference, not needed
FormHandler_FormHandler
train
php
b7a1fce2a17f0dbf7bae03aa9a1933c4351ed317
diff --git a/sprinter/recipes/perforce.py b/sprinter/recipes/perforce.py index <HASH>..<HASH> 100644 --- a/sprinter/recipes/perforce.py +++ b/sprinter/recipes/perforce.py @@ -83,6 +83,10 @@ class PerforceRecipe(RecipeStandard): self.__destroy_perforce(config) def reload(self, feature_name, config): + self.p4environ = dict(os.environ.items() + [('P4USER', config['username']), + ('P4PASSWD', config['password']), + ('P4CLIENT', config['client'])]) + self.p4_command = os.path.join(self.directory.install_directory(feature_name), "p4") self.__sync_perforce(config) def __install_perforce(self, feature_name, config):
bugfix to perforce for syncing
toumorokoshi_sprinter
train
py
a6ffbaff57f8a3c86eaf061000781f1f05efe49d
diff --git a/src/tuwien/auto/calimero/serial/TpuartConnection.java b/src/tuwien/auto/calimero/serial/TpuartConnection.java index <HASH>..<HASH> 100644 --- a/src/tuwien/auto/calimero/serial/TpuartConnection.java +++ b/src/tuwien/auto/calimero/serial/TpuartConnection.java @@ -310,8 +310,8 @@ public class TpuartConnection implements AutoCloseable Thread.currentThread().interrupt(); } catch (final IOException ignore) {} - adapter.close(); receiver.quit(); + adapter.close(); fireConnectionClosed(origin, reason); }
Quit receiver before closing adapter to avoid unnecessary close
calimero-project_calimero-core
train
java
ad7239e81a6fecb6b2dde876d4275e598ec3519b
diff --git a/EventListener/ActionCacheListener.php b/EventListener/ActionCacheListener.php index <HASH>..<HASH> 100644 --- a/EventListener/ActionCacheListener.php +++ b/EventListener/ActionCacheListener.php @@ -113,7 +113,9 @@ class ActionCacheListener { public function handleResponse(FilterResponseEvent $Event) { if (HttpKernelInterface::MASTER_REQUEST === $Event->getRequestType()) { - $this->injectAssets($Event->getResponse()); + if ($this->Config['debug']) { + $this->injectAssets($Event->getResponse()); + } } if (!($TagcacheConfig = $this->getTagcacheConfig($Event))) { return;
Added injecting of assets only in debug mode
RickySu_tagcache-bundle
train
php
20c666047d8aa143668b0d33c6966a2e21067c45
diff --git a/src/Model/BaseModel.php b/src/Model/BaseModel.php index <HASH>..<HASH> 100644 --- a/src/Model/BaseModel.php +++ b/src/Model/BaseModel.php @@ -279,7 +279,7 @@ class BaseModel if (is_array($where)) { $tmp = array(); foreach ($where as $k => $v) { - $tmp[] = !is_string($v) ? $k . "=" . $v : $k . "='" . $v . "'"; + $tmp[] = !is_string($v) ? $k . "=" . $v : $k . "='" . $this->escape_string($v) . "'"; } $where = implode(' AND ', $tmp); } elseif (is_string($where) && !empty($replacement)) {
FIXED: update replacement ISSUE
wangxian_ephp
train
php
5ba376e362c2b1d62f206ab0b637372d4230a7b0
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -15,6 +15,8 @@ Plugin provides some fixtures to simplify app testing: - ``client`` - an instance of ``app.test_client``, - ``client_class`` - ``client`` fixture for class-based tests, - ``config`` - you application config, +- ``live_server`` - runs an application in the background (useful for tests + with `Selenium <http://www.seleniumhq.org>` and other headless browsers), - ``accept_json``, ``accept_jsonp``, ``accept_any`` - accept headers suitable to use as parameters in ``client``. @@ -48,6 +50,20 @@ a JSON response: res = client.get(url_for('api.ping')) assert res.json == {'ping': 'pong'} +If you want your tests done via Selenium or other headless browser use +the ``live_server`` fixture. The server's URL can be retrieved using +the ``url_for`` function: + +.. code:: python + + @pytest.mark.usefixtures('live_server') + class TestLiveServer: + + def test_server_is_up_and_running(self): + res = urllib2.urlopen(url_for('index', _external=True)) + assert b'OK' in res.read() + assert res.code == 200 + Quick Start -----------
Add note about `live_server` to pypi page
pytest-dev_pytest-flask
train
py
208794073cb60c20e55015822dcb746aee80a3db
diff --git a/fastlane_core/lib/fastlane_core/version.rb b/fastlane_core/lib/fastlane_core/version.rb index <HASH>..<HASH> 100644 --- a/fastlane_core/lib/fastlane_core/version.rb +++ b/fastlane_core/lib/fastlane_core/version.rb @@ -1,3 +1,3 @@ module FastlaneCore - VERSION = "0.48.0".freeze + VERSION = "0.48.1".freeze end
[fastlane_core] Version bump (#<I>) * Use the exception handler in the inspector when you don't have a specific message (#<I>) * [fastlane_core] Added missing prefix when printing out GH issue errors (#<I>)
fastlane_fastlane
train
rb
fc84457a3d3da46d22ec6bff90b5c3ef4fa1a3d0
diff --git a/lib/rails_best_practices/reviews/restrict_auto_generated_routes_review.rb b/lib/rails_best_practices/reviews/restrict_auto_generated_routes_review.rb index <HASH>..<HASH> 100644 --- a/lib/rails_best_practices/reviews/restrict_auto_generated_routes_review.rb +++ b/lib/rails_best_practices/reviews/restrict_auto_generated_routes_review.rb @@ -86,7 +86,7 @@ module RailsBestPractices # get the controller name. def controller_name(node) - if node.arguments.all.size > 1 + if node.arguments.all.size > 1 && :bare_assoc_hash == node.arguments.all[1].sexp_type options = node.arguments.all[1] if options.hash_keys.include?("controller") name = options.hash_value("controller").to_s
restrict to parse hash option for resources command
flyerhzm_rails_best_practices
train
rb
2fd9b38101ed940bed2c2c896ef8a2f98aa7a9a1
diff --git a/lib/chessmonger/game.rb b/lib/chessmonger/game.rb index <HASH>..<HASH> 100644 --- a/lib/chessmonger/game.rb +++ b/lib/chessmonger/game.rb @@ -24,5 +24,9 @@ module Chessmonger def cancel history.pop.cancel self end + + def player + @rules.current_player self + end end end diff --git a/spec/game_spec.rb b/spec/game_spec.rb index <HASH>..<HASH> 100644 --- a/spec/game_spec.rb +++ b/spec/game_spec.rb @@ -111,4 +111,20 @@ describe 'Game' do @game.history.should include(@a1) end end + + describe '#player' do + + it "should return the current player defined by the rules" do + + @game = Chessmonger::Game.new @rules, @players + + @rules.stub(:current_player => @p1) + @rules.should_receive(:current_player).with(@game) + @game.player.should be(@p1) + + @rules.stub(:current_player => @p2) + @rules.should_receive(:current_player).with(@game) + @game.player.should be(@p2) + end + end end
Game current player spec and implementation.
AlphaHydrae_chessmonger
train
rb,rb
5d17a87b1ef8b7cf69f7bb9f06b9e13c756f70a1
diff --git a/Lib/fontbakery/commands/check_specification.py b/Lib/fontbakery/commands/check_specification.py index <HASH>..<HASH> 100644 --- a/Lib/fontbakery/commands/check_specification.py +++ b/Lib/fontbakery/commands/check_specification.py @@ -196,7 +196,7 @@ def get_spec(): imported = get_module(args.specification) specification = get_module_specification(imported) if not specification: - raise Exception(f'Can\'t get a specification from {imported}.') + raise Exception(f"Can't get a specification from {imported}.") return specification # This stub or alias is kept for compatibility (e.g. check-commands, FontBakery
Minor: Use double quotes if string contains single quote
googlefonts_fontbakery
train
py
1068cca301ea0a448684e7df7c0c8cd41335bf2e
diff --git a/src/Picture.php b/src/Picture.php index <HASH>..<HASH> 100644 --- a/src/Picture.php +++ b/src/Picture.php @@ -594,6 +594,11 @@ class Picture { if($extension === 'png') { + if($this->progressive) + { + imageinterlace($this->resource, TRUE); + } + imagepng($this->resource, $file, 9); } elseif($extension === 'gif') { @@ -660,6 +665,11 @@ class Picture { imagecolortransparent($gifResource, $transparentColor); } + if($this->progressive) + { + imageinterlace($gifResource, TRUE); + } + imagegif($gifResource, $file); } else { @@ -674,6 +684,12 @@ class Picture { imagefilledrectangle($background, 0, 0, $width, $height, $whiteColor); imagecopy($background, $image, 0, 0, 0, 0, $width, $height); + + if($this->progressive) + { + imageinterlace($background, TRUE); + } + imagejpeg($background, $file, $this->quality); } } @@ -751,6 +767,10 @@ class Picture { unlink($tmpImage); } + + echo 'OK'; + + unlink($file); }
Support saving progressive images in GD.
MichaelPavlista_palette
train
php
360cb4ac2af350c8b96b2fd56b67ef9d5589836a
diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index <HASH>..<HASH> 100644 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -188,7 +188,7 @@ class Application extends BaseApplication } // Check system temp folder for usability as it can cause weird runtime issues otherwise - Silencer::call(function() { + Silencer::call(function () use ($io) { $tempfile = sys_get_temp_dir() . '/temp-' . md5(microtime()); if (!(file_put_contents($tempfile, __FILE__) && (file_get_contents($tempfile) == __FILE__) && unlink($tempfile) && !file_exists($tempfile))) { $io->writeError(sprintf('<error>PHP temp directory (%s) does not exist or is not writable to Composer. Set sys_temp_dir in your php.ini</error>', sys_get_temp_dir()));
Fix for a fatal error when system temp dir is not available
composer_composer
train
php
056d190ed6c9d2dfd289f0dba6f4ce648e4c20cb
diff --git a/lib/apply-credentials.js b/lib/apply-credentials.js index <HASH>..<HASH> 100644 --- a/lib/apply-credentials.js +++ b/lib/apply-credentials.js @@ -43,9 +43,14 @@ const applyCredentialsByType = { header, }; -const applyCredentials = (reqParams, { type, payload = {} }, callback) => { +const applyCredentials = (reqParams, { type = 'header', payload }, callback) => { const { [type]: applyCredentialsImpl } = applyCredentialsByType; + if (_.isUndefined(payload)) { + callback(new TypeError('payload must not be undefined')); + return; + } + if (!_.isFunction(applyCredentialsImpl)) { callback(new Error(`credentials type ${type} is not supported`)); return;
default credentials type to `header` and make payload required
benkroeger_oniyi-http-plugin-credentials
train
js