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
864f25b1125b314ceb01464653e07457a3a81e9e
diff --git a/src/main/java/org/jfree/graphics2d/svg/ImageElement.java b/src/main/java/org/jfree/graphics2d/svg/ImageElement.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jfree/graphics2d/svg/ImageElement.java +++ b/src/main/java/org/jfree/graphics2d/svg/ImageElement.java @@ -74,5 +74,20 @@ public final class ImageElement { public Image getImage() { return image; } + + /** + * Returns a string representation of this object, primarily for debugging + * purposes. + * + * @return A string. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("ImageElement["); + sb.append(this.href).append(", ").append(this.image); + sb.append("]"); + return sb.toString(); + } }
Provide toString() for debugging.
jfree_jfreesvg
train
java
bb1af4e6cbf27f9d8452f00d02197a8e751c8eca
diff --git a/habra_favorites/loaders.py b/habra_favorites/loaders.py index <HASH>..<HASH> 100644 --- a/habra_favorites/loaders.py +++ b/habra_favorites/loaders.py @@ -10,6 +10,13 @@ from .items import FavoriteItem RATING_REGEX = re.compile(ur'Всего (\d+): ↑(\d+) и ↓(\d+)', re.UNICODE) +def process_comments(value): + try: + return int(value) + except ValueError: + return 0 + + def process_id_(value): return int(value.split('_')[-1]) @@ -40,4 +47,4 @@ class FavoriteItemLoader(XPathItemLoader): rating_down_in = MapCompose(process_rating_all(3)) views_in = MapCompose(int) count_in = MapCompose(int) - comments_in = MapCompose(int) + comments_in = MapCompose(process_comments)
Added a check for comments' existing.
ykalchevskiy_habra-favorites
train
py
baa5c8469119afe7fbccbdf52f0bee775dc8da3f
diff --git a/test/query-select.js b/test/query-select.js index <HASH>..<HASH> 100644 --- a/test/query-select.js +++ b/test/query-select.js @@ -28,7 +28,34 @@ describe('monoxide.query() using $select', function() { }); }); + // See issue #14 + it('should select deeply nested with boolean', function(finish) { + monoxide.query({ + $collection: 'users', + $sort: 'created', + $select: { + // String to mimick input from ReST querystring + mostPurchased: '1' + }, + }, function(err, data) { + expect(err).to.be.not.ok; + expect(data).to.be.an('array'); + data.forEach(function(d) { + console.log('d', d); + expect(d).to.have.property('mostPurchased'); + d.mostPurchased.forEach(function(i) { + console.log('i', i); + expect(i).to.have.property('number'); + expect(i).to.have.property('item'); + //expect(i).to.not.have.property('0'); + }) + }); + finish(); + }); + }); + it('should omit certain fields', function(finish) { + this.timeout(5 * 1000); monoxide.query({ $collection: 'widgets', $sort: 'created',
TEST: Check for corruption of objects based on string "1" booleans
hash-bang_Monoxide
train
js
0268b52f22fce6ce57c5d4f96040d5865f3d173f
diff --git a/haphilipsjs/__init__.py b/haphilipsjs/__init__.py index <HASH>..<HASH> 100644 --- a/haphilipsjs/__init__.py +++ b/haphilipsjs/__init__.py @@ -143,14 +143,9 @@ class PhilipsTV(object): self.protocol = "http" self.port = 1925 - # for devices with notify support we must have two - if self.api_version > 1: - pool_maxsize=2 - else: - pool_maxsize=1 - - limits = httpx.Limits(max_keepalive_connections=1, max_connections=pool_maxsize) - self.session = httpx.AsyncClient(limits=limits, verify=False) + timeout = httpx.Timeout(timeout=5.0, pool=20.0) + limits = httpx.Limits(max_keepalive_connections=1, max_connections=2) + self.session = httpx.AsyncClient(limits=limits, timeout=timeout, verify=False) self.session.headers["Accept"] = "application/json" if username and password:
Adjust timeouts somewhat and allow two connections
danielperna84_ha-philipsjs
train
py
8abf644c0e6730adc470ffab25438c4fb3c455e6
diff --git a/lib/parse.js b/lib/parse.js index <HASH>..<HASH> 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -37,7 +37,7 @@ exports.evaluate = function(content, options, isDocument) { content = content.toString(); if (typeof content === 'string') { - var useHtmlParser2 = options.xmlMode || options.useHtmlParser2; + var useHtmlParser2 = options.xmlMode || options._useHtmlParser2; dom = useHtmlParser2 ? htmlparser.parseDOM(content, options) : parseWithParse5(content, isDocument); } else { diff --git a/lib/utils.js b/lib/utils.js index <HASH>..<HASH> 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -62,7 +62,7 @@ exports.domEach = function(cheerio, fn) { * @argument {Object} options - The parsing/rendering options */ exports.cloneDom = function(dom, options) { - options = assign({}, options, { useHtmlParser2: true }); + options = assign({}, options, { _useHtmlParser2: true }); return parse(render(dom, options), options, false).children; };
Rename `useHtmlParser2` option This flag is used to control parsing behavior internally, but it is not intended for use by consumers. Prefix the name with an underscore in order to discourage users from relying on it.
oyyd_cheerio-without-node-native
train
js,js
04b62d6439a26ed384ec420617265b8358a67b62
diff --git a/cmd/policies.go b/cmd/policies.go index <HASH>..<HASH> 100644 --- a/cmd/policies.go +++ b/cmd/policies.go @@ -480,3 +480,32 @@ func filterTeamsByUser(client *api.Client, teams []envelope.Team, close(teamChan) }() } + +// Fetch all policies and policy-attachments for the org. The two steps are +// independent so do them in parallel. +func getPoliciesAndAttachments(client *api.Client, orgID *identity.ID) ([]envelope.Policy, []envelope.PolicyAttachment, error) { + c := context.Background() + wg := &sync.WaitGroup{} + wg.Add(2) + + var pErr error + var policies []envelope.Policy + go func() { + defer wg.Done() + policies, pErr = client.Policies.List(c, orgID, "") + }() + + var aErr error + var attachments []envelope.PolicyAttachment + go func() { + defer wg.Done() + attachments, aErr = client.Policies.AttachmentsList(c, orgID, nil, nil) + }() + wg.Wait() + + if aErr != nil || pErr != nil { + return nil, nil, cli.NewMultiError(pErr, aErr, + errs.NewExitError(policyTestFailed)) + } + return policies, attachments, nil +}
cmd: policies: test: Fetch all policies and attachments Fetch all policies and policy-attachments for the org. Do it in parallel.
manifoldco_torus-cli
train
go
e0e516cd50882bc8de500d164cd7c28eacd64430
diff --git a/src/Illuminate/Pipeline/Pipeline.php b/src/Illuminate/Pipeline/Pipeline.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Pipeline/Pipeline.php +++ b/src/Illuminate/Pipeline/Pipeline.php @@ -13,7 +13,7 @@ class Pipeline implements PipelineContract /** * The container implementation. * - * @var \Illuminate\Contracts\Container\Container + * @var \Illuminate\Contracts\Container\Container|null */ protected $container;
improve property type (#<I>)
laravel_framework
train
php
f30339a7025f45dfec455f5e5488925a643673d5
diff --git a/src/JMS/Serializer/XmlDeserializationVisitor.php b/src/JMS/Serializer/XmlDeserializationVisitor.php index <HASH>..<HASH> 100644 --- a/src/JMS/Serializer/XmlDeserializationVisitor.php +++ b/src/JMS/Serializer/XmlDeserializationVisitor.php @@ -150,7 +150,8 @@ class XmlDeserializationVisitor extends AbstractVisitor $namespace = isset($classMetadata->xmlNamespaces[''])?$classMetadata->xmlNamespaces['']:$namespace; } - if ( ! isset($data->$entryName) ) { + $hasNode = null !== $namespace ? isset($data->children($namespace)->$entryName) : isset($data->$entryName); + if (false === $hasNode) { if (null === $this->result) { return $this->result = array(); }
Starting from php <I> there is a bc break bugfix in the simplexml parser, the new behaviour is more strict. Reported in <URL>
schmittjoh_serializer
train
php
4a12506c3b4753336e675c13cb63913d85dea58b
diff --git a/lib/outpost/scouts/ping.rb b/lib/outpost/scouts/ping.rb index <HASH>..<HASH> 100644 --- a/lib/outpost/scouts/ping.rb +++ b/lib/outpost/scouts/ping.rb @@ -1,9 +1,4 @@ -begin - require 'net/ping/external' -rescue LoadError => e - puts "Please install net-ping gem: gem install net-ping". - raise -end +require 'net/ping/external' require 'outpost/expectations'
Remove rescue of loaderror in ping scout, as it is now obsolete
vinibaggio_outpost
train
rb
0cda3b3bb8b966a5e5b6951c3f4101f47601a620
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ def read(fname): return io.open(file_path, encoding='utf-8').read() -version = '0.7.2' +version = '0.7.3.dev0' setuptools.setup(
Back to development: <I>
ecmwf_cfgrib
train
py
aa518199197683c6dbd4bbf683fe52bac5ca84da
diff --git a/zealdb.py b/zealdb.py index <HASH>..<HASH> 100644 --- a/zealdb.py +++ b/zealdb.py @@ -112,6 +112,8 @@ class ZealDB(object): '''Enter ZealDB context. Opens a connection to the database.''' self.open() + return self + def __exit__(self, exc_type, exc_value, exc_traceback): '''Exit ZealDB context. Commits transactions and closes the database connection.'''
Forgot to return self from ZealDB's context __enter__()
vedvyas_doxytag2zealdb
train
py
bf8d8ab90c4c0058d2dcbb322a3a2dd8428f12da
diff --git a/easy_select2/widgets.py b/easy_select2/widgets.py index <HASH>..<HASH> 100644 --- a/easy_select2/widgets.py +++ b/easy_select2/widgets.py @@ -19,10 +19,8 @@ SELECT2_CSS = getattr( SELECT2_USE_BUNDLED_JQUERY = getattr( settings, 'SELECT2_USE_BUNDLED_JQUERY', True) -if django.VERSION[1] <= 7: # django 1.7 and lower - lookup_override_filename = 'lookup_override.1.7.js' -else: # django 1.8+ - lookup_override_filename = 'lookup_override.1.8.js' +lookup_override_filename = 'lookup_override.1.7.js' \ + if django.VERSION[1] < 8 else 'lookup_override.1.8.js' SELECT2_WIDGET_JS = [ 'easy_select2/js/init.js',
Same logic, better coverage test result.
asyncee_django-easy-select2
train
py
a08eceea754675a63cd859b88552cd19df269301
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -196,7 +196,7 @@ function DiscordClient(options) { KAi = setInterval(function() { //Send Keep Alive Data if (ws.readyState == 1) { - ws.send(JSON.stringify({op: 1, d: Date.now()})); + ws.send(JSON.stringify({op: 1, d: self.internals.sequence})); } }, message.d.heartbeat_interval);
Change to sequence for new keep alive data
izy521_discord.io
train
js
f445de2574366995303747cf2b9e977e9cfb1ab2
diff --git a/h2o-core/src/main/java/water/H2O.java b/h2o-core/src/main/java/water/H2O.java index <HASH>..<HASH> 100644 --- a/h2o-core/src/main/java/water/H2O.java +++ b/h2o-core/src/main/java/water/H2O.java @@ -1833,7 +1833,7 @@ final public class H2O { */ public static boolean checkUnsupportedJava() { String version = System.getProperty("java.version"); - if (version != null && !(version.startsWith("1.7") || version.startsWith("1.8") || version.startsWith("9"))) { + if (version != null && !(version.startsWith("1.7") || version.startsWith("1.8") || version.startsWith("9") || version.startsWith("10"))) { System.err.println("Only Java 1.7-1.8 and 9 is supported, system version is " + version); return true; }
PUBDEV-<I>: Enable Java <I> support
h2oai_h2o-3
train
java
d5799a1f376537ca755bb4fa0364b6e34ed4f08f
diff --git a/providers/http/webroot/webroot.go b/providers/http/webroot/webroot.go index <HASH>..<HASH> 100644 --- a/providers/http/webroot/webroot.go +++ b/providers/http/webroot/webroot.go @@ -33,12 +33,12 @@ func (w *HTTPProvider) Present(domain, token, keyAuth string) error { var err error challengeFilePath := path.Join(w.path, acme.HTTP01ChallengePath(token)) - err = os.MkdirAll(path.Dir(challengeFilePath), 0777) + err = os.MkdirAll(path.Dir(challengeFilePath), 0755) if err != nil { return fmt.Errorf("Could not create required directories in webroot for HTTP challenge -> %v", err) } - err = ioutil.WriteFile(challengeFilePath, []byte(keyAuth), 0777) + err = ioutil.WriteFile(challengeFilePath, []byte(keyAuth), 0644) if err != nil { return fmt.Errorf("Could not write file in webroot for HTTP challenge -> %v", err) }
Tighten permissions on challenge files and directories
go-acme_lego
train
go
6a3b75e06c8e7e46b734b0bb3cb770e7c6e768b3
diff --git a/proxylib/proxylib_test.go b/proxylib/proxylib_test.go index <HASH>..<HASH> 100644 --- a/proxylib/proxylib_test.go +++ b/proxylib/proxylib_test.go @@ -121,8 +121,10 @@ func TestOnNewConnection(t *testing.T) { func checkAccessLogs(t *testing.T, logServer *test.AccessLogServer, expPasses, expDrops int) { t.Helper() passes, drops := 0, 0 - empty := false - for !empty { + nWaits := 0 + done := false + // Loop until done or when the timeout has ticked 100 times without any logs being received + for !done && nWaits < 100 { select { case pblog := <-logServer.Logs: if pblog.EntryType == cilium.EntryType_Denied { @@ -130,8 +132,16 @@ func checkAccessLogs(t *testing.T, logServer *test.AccessLogServer, expPasses, e } else { passes++ } - case <-time.After(10 * time.Millisecond): - empty = true + // Start the timeout again (for upto 5 seconds) + nWaits = 0 + case <-time.After(50 * time.Millisecond): + // Count the number of times we have waited since the last log was received + nWaits++ + // Finish when expected number of passes and drops have been collected + // and there are no more logs in the channel for 50 milliseconds + if passes == expPasses && drops == expDrops { + done = true + } } }
proxylib: Fix unit test flake when counting access log entries Modify the access log check function to allow for upto 5 seconds to receive the logs, but also to stop waiting after <I> milliseconds if the expecgted number of passes and drops have been received. The additional time allows for successful completion in resource limited test environments, while the short wait after the expected number of passes and drops has been received allows for the case where extraneous logs are being generated. Fixes: #<I> Fixes: #<I>
cilium_cilium
train
go
27ed07b61e718f106091f6b978c9227efe47a3c4
diff --git a/src/dialogs-default-translations.js b/src/dialogs-default-translations.js index <HASH>..<HASH> 100644 --- a/src/dialogs-default-translations.js +++ b/src/dialogs-default-translations.js @@ -130,6 +130,23 @@ DIALOGS_YES: "确认", DIALOGS_NO: "取消" }); + + $translateProvider.translations('sv-SE',{ + DIALOGS_ERROR: "Fel", + DIALOGS_ERROR_MSG: "Ett okänt fel har uppstått.", + DIALOGS_CLOSE: "Stäng", + DIALOGS_PLEASE_WAIT: "Vänligen vänta", + DIALOGS_PLEASE_WAIT_ELIPS: "Vänligen vänta...", + DIALOGS_PLEASE_WAIT_MSG: "Väntar på att processen skall slutföras.", + DIALOGS_PERCENT_COMPLETE: "% Färdigt", + DIALOGS_NOTIFICATION: "Meddelande", + DIALOGS_NOTIFICATION_MSG: "Okänt meddelande från applikationen.", + DIALOGS_CONFIRMATION: "Bekräftelse", + DIALOGS_CONFIRMATION_MSG: "Bekräftelse krävs.", + DIALOGS_OK: "OK", + DIALOGS_YES: "Ja", + DIALOGS_NO: "Nej" + }); $translateProvider.preferredLanguage('en-US'); }]); // end config
Update dialogs-default-translations.js Updated with Swedish translations.
m-e-conroy_angular-dialog-service
train
js
6119928610dcf7ec9c1ce92a87661cc109bce72b
diff --git a/src/ui_components/jf_tree/jf_tree_api.js b/src/ui_components/jf_tree/jf_tree_api.js index <HASH>..<HASH> 100644 --- a/src/ui_components/jf_tree/jf_tree_api.js +++ b/src/ui_components/jf_tree/jf_tree_api.js @@ -803,6 +803,13 @@ export function JFTreeApi($q, $timeout, AdvancedStringMatch, ContextMenuService) this._refreshIndentations(); } + bringNodeToView(node, doScroll = false) { + let fi = this._flatFromNode(node); + if (fi) { + fi.pane.bringItemToView(fi, !doScroll); + } + } + } return JFTreeApiClass;
jf-tree: bringNodeToView
jfrog_jfrog-ui-essentials
train
js
a82d20030ab18bb430a1abd302f1c6189a568dc3
diff --git a/lib/loops/engine.rb b/lib/loops/engine.rb index <HASH>..<HASH> 100644 --- a/lib/loops/engine.rb +++ b/lib/loops/engine.rb @@ -83,7 +83,7 @@ class Loops::Engine def load_loop_class(name, config) loop_name = config['loop_name'] || name - klass_files = [Loops.root + "app/loops/#{loop_name}_loop.rb", "#{loop_name}_loop"] + klass_files = [Loops.loops_root + "#{loop_name}_loop.rb", "#{loop_name}_loop"] begin klass_file = klass_files.shift debug "Loading class file: #{klass_file}" @@ -94,8 +94,8 @@ class Loops::Engine return false end - klass_name = "#{loop_name}_loop".classify - klass = klass_name.constantize rescue nil + klass_name = "#{loop_name}_loop".capitalize.gsub(/_(.)/) { $1.upcase } + klass = Object.const_get(klass_name) rescue nil unless klass error "Can't find class: #{klass_name}. Worker #{name} won't be started!"
Use Loops.loops_root directory to find loops classes
kovyrin_loops
train
rb
4e2a6aee0fd63ffdd67074d3763def4377acf406
diff --git a/pkg/backend/display/rows.go b/pkg/backend/display/rows.go index <HASH>..<HASH> 100644 --- a/pkg/backend/display/rows.go +++ b/pkg/backend/display/rows.go @@ -327,7 +327,7 @@ func (data *resourceRowData) getInfoColumn() string { diagMsg += msg } - changes := data.getDiffInfo() + changes := data.getDiffInfo(step) if colors.Never.Colorize(changes) != "" { appendDiagMessage("[" + changes + "]") } @@ -383,8 +383,7 @@ func (data *resourceRowData) getInfoColumn() string { return diagMsg } -func (data *resourceRowData) getDiffInfo() string { - step := data.step +func (data *resourceRowData) getDiffInfo(step engine.StepEventMetadata) string { changesBuf := &bytes.Buffer{} if step.Old != nil && step.New != nil { var diff *resource.ObjectDiff
Ensure we show the properties that changed when doing a multi-stage replace. (#<I>)
pulumi_pulumi
train
go
65d7d1ba5528a18130607d72a763e59850f81bef
diff --git a/test/integration/trackable_test.rb b/test/integration/trackable_test.rb index <HASH>..<HASH> 100644 --- a/test/integration/trackable_test.rb +++ b/test/integration/trackable_test.rb @@ -10,8 +10,8 @@ class TrackableHooksTest < ActionDispatch::IntegrationTest sign_in_as_user user.reload - assert_kind_of Time, user.current_sign_in_at - assert_kind_of Time, user.last_sign_in_at + assert user.current_sign_in_at.acts_like?(:time) + assert user.last_sign_in_at.acts_like?(:time) assert_equal user.current_sign_in_at, user.last_sign_in_at assert user.current_sign_in_at >= user.created_at
Change test to use acts_like? so that we can have DateTime fields
plataformatec_devise
train
rb
401e84624ce26624aeb3a282e62b87ec3e81eb90
diff --git a/owslib/util.py b/owslib/util.py index <HASH>..<HASH> 100644 --- a/owslib/util.py +++ b/owslib/util.py @@ -253,7 +253,7 @@ def testXMLAttribute(element, attribute): if element is not None: attrib = element.get(attribute) if attrib is not None: - return attrib.strip() + return attrib.strip(' \t') return None
Restrict stripped chars in testXMLAttribute
geopython_OWSLib
train
py
9596cd23f5b1abafe162a79e107f4e8a44d64084
diff --git a/schema.js b/schema.js index <HASH>..<HASH> 100644 --- a/schema.js +++ b/schema.js @@ -163,8 +163,6 @@ class NodeType { return this.contentExpr.matches(attrs, content) } - get ephemeral() { return false } - static compile(nodes, schema) { let result = Object.create(null) nodes.forEach((name, spec) => result[name] = new spec.type(name, schema))
Remove ephemeral note type flag We'll need to address the problem it solves in a different way
ProseMirror_prosemirror-model
train
js
6feaa42a007fe075932025261f6f57b28fbaa3c5
diff --git a/faker/tests/hu_HU/__init__.py b/faker/tests/hu_HU/__init__.py index <HASH>..<HASH> 100644 --- a/faker/tests/hu_HU/__init__.py +++ b/faker/tests/hu_HU/__init__.py @@ -19,4 +19,4 @@ class hu_HU_FactoryTestCase(unittest.TestCase): for i in range(100): pcd = Provider.postcode() - assert pcd[2] > 0 + assert pcd[2] > "0"
Wrong postcode format bug (silly... :S) fixed.
joke2k_faker
train
py
f96bcbf1150c723a1be09d42fe7379d55fdbb2fa
diff --git a/lib/ronin/program/options.rb b/lib/ronin/program/options.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/program/options.rb +++ b/lib/ronin/program/options.rb @@ -72,7 +72,7 @@ module Ronin def options(&block) self.separator ' Options:' - block.call(self) if block + block.call() if block self.on('-h','--help','print this message',&method(:help)) self.separator ''
Don't pass anything to the block given to Options#options.
ronin-ruby_ronin
train
rb
ce360e2f7dcdba5b4bce9de71cb69feb57b6eeed
diff --git a/python/thunder/utils/context.py b/python/thunder/utils/context.py index <HASH>..<HASH> 100644 --- a/python/thunder/utils/context.py +++ b/python/thunder/utils/context.py @@ -472,11 +472,11 @@ class ThunderContext(): from thunder.rdds.fileio.imagesloader import ImagesLoader loader = ImagesLoader(self._sc) if inputFormat.lower() == 'stack': - images = loader.fromStack(dataPath, dims, dtype=dtype, startIdx=startIdx, stopIdx=stopIdx, + images = loader.fromStack(dataPath, dims, ext=ext, dtype=dtype, startIdx=startIdx, stopIdx=stopIdx, recursive=recursive, nplanes=nplanes, npartitions=npartitions) else: # 'tif' or 'tif-stack' - images = loader.fromTif(dataPath, startIdx=startIdx, stopIdx=stopIdx, + images = loader.fromTif(dataPath, ext=ext, startIdx=startIdx, stopIdx=stopIdx, recursive=recursive, nplanes=nplanes, npartitions=npartitions) if renumber: images = images.renumber()
wire "ext=" parameter through convertImagesToSeries with shuffle=True Looks like this one just never got set up correctly.
thunder-project_thunder
train
py
268ddc165d73075c9d9e943b53edbd3d74bb3bf7
diff --git a/spec/support/integration_helper.rb b/spec/support/integration_helper.rb index <HASH>..<HASH> 100644 --- a/spec/support/integration_helper.rb +++ b/spec/support/integration_helper.rb @@ -18,7 +18,7 @@ module IntegrationSupport end end - def with_plugin(plugin_path, contents) # + def with_plugin(plugin_path, contents) # rubocop:disable Lint/NestedMethodDefinition filename = path_to(plugin_path) dir = File.dirname(filename) FileUtils.mkdir_p(dir) unless dir == "." @@ -27,11 +27,11 @@ module IntegrationSupport end end - def path_to(plugin_path) + def path_to(plugin_path) # rubocop:disable Lint/NestedMethodDefinition File.expand_path(plugin_path, @plugins_directory) end - def self.with_plugin(plugin_path, contents) + def self.with_plugin(plugin_path, contents) # rubocop:disable Lint/NestedMethodDefinition before :each do with_plugin(plugin_path, contents) end
not fixing Lint/NestedMethodDefinition there's some voodoo going on here i don't want to figure out how to unwind
chef_ohai
train
rb
7ca880a3bdcf7f7aa9741690853cc71623178af5
diff --git a/analyzers/FileInfo/submodules/submodule_oletools.py b/analyzers/FileInfo/submodules/submodule_oletools.py index <HASH>..<HASH> 100644 --- a/analyzers/FileInfo/submodules/submodule_oletools.py +++ b/analyzers/FileInfo/submodules/submodule_oletools.py @@ -28,7 +28,7 @@ class OLEToolsSubmodule(SubmoduleBaseclass): 'PPT', 'PPTM', 'PPTX' - ]: + ] or kwargs.get('mimetype').startswith("application/vnd.openxmlformats-officedocument"): return True except KeyError: return False
#<I> manage OpenXML files detected as zip thx to @githule
TheHive-Project_Cortex-Analyzers
train
py
1aefb2f96dc7ea11f3fef5d2a1dc020f52b0bcba
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -6,7 +6,11 @@ const tc = require('./tc'); const localHostTc = require('./localHostTc'); function verify(options) { - if ( + if (options.localhost) { + if (!Number.isInteger(options.rtt)) { + throw Error('You need to set rtt as an integer for localhost'); + } + } else if ( !Number.isInteger(options.up) || !Number.isInteger(options.down) || !Number.isInteger(options.rtt)
check rtt for localhost
sitespeedio_throttle
train
js
fba4d5efc16554f1176fda44404432fe2fae97cc
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/explorers/explorerNavHandler.js b/bundles/org.eclipse.orion.client.ui/web/orion/explorers/explorerNavHandler.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.ui/web/orion/explorers/explorerNavHandler.js +++ b/bundles/org.eclipse.orion.client.ui/web/orion/explorers/explorerNavHandler.js @@ -435,8 +435,8 @@ exports.ExplorerNavHandler = (function() { while (offsetParent) { var style = window.getComputedStyle(offsetParent, null); if (!style) { break; } - var overflow = style.getPropertyValue("overflow-y"); - if (overflow === "hidden" || overflow === "auto" || overflow === "scroll") { break; } + var overflow = style.getPropertyValue("overflow-y"); //$NON-NLS-0$ + if (overflow === "auto" || overflow === "scroll") { break; } //$NON-NLS-1$ //$NON-NLS-0$ offsetParent = offsetParent.parentNode; } if (!offsetParent) {
arrow down/up does not show item in outline view (at top and bottom)
eclipse_orion.client
train
js
7330db78d29442a853974c61ba2a89dd58405203
diff --git a/spec/unit/resource/file/verification/json_spec.rb b/spec/unit/resource/file/verification/json_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/resource/file/verification/json_spec.rb +++ b/spec/unit/resource/file/verification/json_spec.rb @@ -51,10 +51,16 @@ describe Chef::Resource::File::Verification::Json do expect(v.verify(@invalid_json)).to eq(false) end - it "returns false for empty file" do - # empty string is invalid per JSON spec https://stackoverflow.com/questions/30621802/why-does-json-parse-fail-with-the-empty-string + it "returns true for empty file" do + # Expectation here is different from that of default JSON parser included in ruby 2.4+. + # The default parser considers empty string as invalid JSON + # https://stackoverflow.com/questions/30621802/why-does-json-parse-fail-with-the-empty-string, + # however JSONCompat parses an empty string to `nil`. + # We are retaining the behavior of JSONCompat for two reasons + # - It is universal inside Chef codebase + # - It can be helpful to not throw an error when a `file` or `template` is empty v = Chef::Resource::File::Verification::Json.new(parent_resource, :json, {}) - expect(v.verify(@empty_json)).to eq(false) + expect(v.verify(@empty_json)).to eq(true) end end
Change rspec to reflect the behavior of JSONCompat
chef_chef
train
rb
d7998c3ca5e5a2c118fd7e382b3360c3ed563c90
diff --git a/src/share/classes/com/sun/tools/javac/comp/TransTypes.java b/src/share/classes/com/sun/tools/javac/comp/TransTypes.java index <HASH>..<HASH> 100644 --- a/src/share/classes/com/sun/tools/javac/comp/TransTypes.java +++ b/src/share/classes/com/sun/tools/javac/comp/TransTypes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -834,6 +834,8 @@ public class TransTypes extends TreeTranslator { public void visitReference(JCMemberReference tree) { tree.expr = translate(tree.expr, erasure(tree.expr.type)); tree.type = erasure(tree.type); + if (tree.varargsElement != null) + tree.varargsElement = erasure(tree.varargsElement); result = tree; }
<I>: javac crash with method references plus lambda plus var args
wmdietl_jsr308-langtools
train
java
f7a4db4d91c13277e22a5c6aed8cdb9d00db6999
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -565,7 +565,7 @@ function ui5Build(sUI5SrcPath, sUI5TargetPath, sUI5Version, oOptions = {}) { rename(path => { // normal path: sap/m/themes/sap_belize // update path: sap.m/src/sap/m/themes/base => sap/m/themes/base - const aPathChain = path.dirname.split('/') + const aPathChain = path.dirname.split(path.sep) path.dirname = aPathChain.length > 1 && aPathChain[1] === 'src' ? aPathChain.slice(2, aPathChain.length - 1).join('/') @@ -682,7 +682,7 @@ function ui5Build(sUI5SrcPath, sUI5TargetPath, sUI5Version, oOptions = {}) { */ function ui5CompileLessLib(oFile) { const sDestDir = path.dirname(oFile.path) - const sFileName = oFile.path.split('/').pop() + const sFileName = oFile.path.split(path.sep).pop() const sLessFileContent = oFile.contents.toString('utf8') // options for less-openui5
Make ui5-lib-util work under windows Some paths were split by a hardcoded '/' --> did not work on windows, as it uses '\' --> use 'path.sep' in these cases ('path.sep' returns the OS-specific path seperator)
pulseshift_ui5-lib-util
train
js
bd7a7f4218b6d6e7a136370d4f69e3e15771589c
diff --git a/liquibase-core/src/main/java/liquibase/sqlgenerator/core/CreateProcedureGenerator.java b/liquibase-core/src/main/java/liquibase/sqlgenerator/core/CreateProcedureGenerator.java index <HASH>..<HASH> 100644 --- a/liquibase-core/src/main/java/liquibase/sqlgenerator/core/CreateProcedureGenerator.java +++ b/liquibase-core/src/main/java/liquibase/sqlgenerator/core/CreateProcedureGenerator.java @@ -70,6 +70,10 @@ public class CreateProcedureGenerator extends AbstractSqlGenerator<CreateProcedu procedureText = removeTrailingDelimiter(procedureText, statement.getEndDelimiter()); + if (database instanceof MSSQLDatabase && procedureText.matches("(?si).*as[\\s\\r\\n.]+merge.*") && !procedureText.endsWith(";")) { //mssql "AS MERGE" procedures need a trailing ; (regardless of the end delimiter) + procedureText = procedureText + ";"; + } + sql.add(new UnparsedSql(procedureText, statement.getEndDelimiter()));
CORE-<I> MSSQL createProcedure for CREATE MERGE AS procedures need a trailing semicolon
liquibase_liquibase
train
java
76bbe894df49581cf48269ae9448fe912e067659
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -17,6 +17,7 @@ Bluebird .try( activate ) .then( () => process.exit( 0 ) ) .catch( ( err ) => { + console.lineLength = 9999; console.line( true ); if ( err instanceof ProcedureError ) { console.error( err.message, err.command );
Error exceptions are now printed ignoring console lineLength
Zelgadis87_npm-versionator
train
js
be1ba9d11d999ea285d5353bf8c872eaefa1f4ef
diff --git a/module/__init__.py b/module/__init__.py index <HASH>..<HASH> 100644 --- a/module/__init__.py +++ b/module/__init__.py @@ -481,6 +481,10 @@ class Connection(object): self._init_x() def _init_x(self): + if core is None: + raise XcffibException("No core protocol object has been set. " + "Did you import xcffib.xproto?") + self.core = core(self) self.setup = self.get_setup()
Better error when xcffib.xproto hasn't been imported Closes #<I>
tych0_xcffib
train
py
5a3013fea562b1eea3fc2ff3730aaa16f70ea05b
diff --git a/packages/components/bolt-image/src/image.js b/packages/components/bolt-image/src/image.js index <HASH>..<HASH> 100644 --- a/packages/components/bolt-image/src/image.js +++ b/packages/components/bolt-image/src/image.js @@ -223,7 +223,7 @@ class BoltImage extends withLitHtml() { ? srcset || src || undefined : this.isLazyLoaded ? srcset - : placeholderImage, + : placeholderImage || undefined, )}" data-srcset="${ifDefined(lazyload ? srcset || src : undefined)}" sizes="${ifDefined(
chore: add missing undefined fallback to srcset behavior
bolt-design-system_bolt
train
js
4257ad37d1ab216a7ee3d0021c9e24118837d3be
diff --git a/app/controllers/krikri/records_controller.rb b/app/controllers/krikri/records_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/krikri/records_controller.rb +++ b/app/controllers/krikri/records_controller.rb @@ -95,8 +95,8 @@ module Krikri # with Blacklight v5.10. # @param String id is a local name. def get_solr_response_for_doc_id(id=nil, extra_controller_params={}) - id_uri = Krikri::Settings.marmotta.item_container << '/' << id - solr_response = solr_repository.find(id_uri, extra_controller_params) + id = (RDF::URI(Krikri::Settings.marmotta.item_container) / id).to_s if id + solr_response = solr_repository.find(id, extra_controller_params) [solr_response, solr_response.documents.first] end
Fix Solr document ID builder regression which modifies item container
dpla_KriKri
train
rb
94a3d494ce5cafb7cca67fb86dcc614f61438037
diff --git a/lib/adb_sdklib/raw_image.rb b/lib/adb_sdklib/raw_image.rb index <HASH>..<HASH> 100644 --- a/lib/adb_sdklib/raw_image.rb +++ b/lib/adb_sdklib/raw_image.rb @@ -46,5 +46,9 @@ module AdbSdkLib def bpp() @image.bpp end + + def point_to_index(x,y) + return (x*(bpp >> 3))+(y*((bpp >> 3)*(width))) + end end end
add point_to_index method to raw_image
yoyo0906_ruby-adb-sdklib
train
rb
149a1e16d492e8a313fb04686ae64accaeeda06e
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb @@ -121,6 +121,7 @@ module ActiveRecord @config = config @visitor = Arel::Visitors::SQLite.new self + @quoted_column_names = {} if self.class.type_cast_config_to_boolean(config.fetch(:prepared_statements) { true }) @prepared_statements = true @@ -240,7 +241,7 @@ module ActiveRecord end def quote_column_name(name) #:nodoc: - %Q("#{name.to_s.gsub('"', '""')}") + @quoted_column_names[name] ||= %Q("#{name.to_s.gsub('"', '""')}") end #--
cache quoted column names in SQLite3 we do this in other adapters, and it's a nice speed improvement
rails_rails
train
rb
57e93ded81e0d6969f15edb3ab7eb9da48f5633f
diff --git a/lib/parallel_cucumber/cli.rb b/lib/parallel_cucumber/cli.rb index <HASH>..<HASH> 100644 --- a/lib/parallel_cucumber/cli.rb +++ b/lib/parallel_cucumber/cli.rb @@ -44,7 +44,7 @@ module ParallelCucumber fail("File '#{script}' is not executable") unless File.executable?(script) options[:setup_script] = File.expand_path(script) end - opts.on('--thread-delay [SECONDS]', Integer, 'Delay before next thread starting') do |thread_delay| + opts.on('--thread-delay [SECONDS]', Float, 'Delay before next thread starting') do |thread_delay| options[:thread_delay] = thread_delay end opts.on('-v', '--version', 'Show version') do
Allow fractional thread-delay value
badoo_parallel_cucumber
train
rb
6fa1fe06d5ee856e23ce6fdd1ff3007cb3b63708
diff --git a/lib/brightbox-cli/commands/servers-update.rb b/lib/brightbox-cli/commands/servers-update.rb index <HASH>..<HASH> 100644 --- a/lib/brightbox-cli/commands/servers-update.rb +++ b/lib/brightbox-cli/commands/servers-update.rb @@ -14,6 +14,9 @@ module Brightbox c.desc "Don't base64 encode the user data" c.switch [:e, :no_base64] + c.desc "Set the compatibility mode (true or false) (default: false)" + c.flag [:c, :compatibility_mode] + c.action do |global_options, options, args| srv_id = args.shift raise "You must specify a valid server id as the first argument" unless srv_id =~ /^srv-/ @@ -46,9 +49,16 @@ module Brightbox raise "User data too big (>16k)" if user_data.size > 16 * 1024 end + if options[:c] == "true" + compatibility_flag = true + else + compatibility_flag = false + end + params = NilableHash.new params[:name] = options[:n] if options[:n] params[:user_data] = user_data if user_data + params[:compatibility_mode] = compatibility_flag params.nilify_blanks info "Updating server #{server}#{" with %.2fk of user data" % (user_data.size / 1024.0) if user_data}"
[#<I>] Support update of compatibility_mode for Server
brightbox_brightbox-cli
train
rb
7b5c00c0208543cfef17444da84653f218031ab3
diff --git a/yolk/cli.py b/yolk/cli.py index <HASH>..<HASH> 100755 --- a/yolk/cli.py +++ b/yolk/cli.py @@ -20,6 +20,7 @@ License : GNU General Public License Version 2 (See COPYING) __docformat__ = 'restructuredtext' +import os import sys import optparse import pkg_resources @@ -113,6 +114,12 @@ def show_distributions(show, project_name, version, options): ignores = ["/UNIONFS", "/KNOPPIX.IMG", "/usr/lib/python2.5/lib-dynload"] #/usr/lib/python2.5/lib-dynload will show 'Python' as development mode + #Check if we're in a workingenv + #See http://cheeseshop.python.org/pypi/workingenv.py + workingenv = os.environ.get('WORKING_ENV') + if workingenv: + ignores.append(workingenv) + dists = Distributions() results = None for (dist, active) in dists.get_distributions(show, project_name,
Don't detect workingenv dirs as development
cakebread_yolk
train
py
71b6e5251e930a6e20ed34238c60cdefbccc4e1e
diff --git a/src/Promise.php b/src/Promise.php index <HASH>..<HASH> 100644 --- a/src/Promise.php +++ b/src/Promise.php @@ -36,8 +36,8 @@ interface Promise * If you do not care about one of the cases, you can set the corresponding callable to null * The callback will be called when the value arrived and never more than once. * - * @param callable $onFulfilled called when a response will be available - * @param callable $onRejected called when an exception occurs + * @param callable|null $onFulfilled called when a response will be available + * @param callable|null $onRejected called when an exception occurs * * @return Promise a new resolved promise with value of the executed callback (onFulfilled / onRejected) */
Corrected phpdoc of then
php-http_promise
train
php
f61de9da41ee7da7d67457af56732f73231e06be
diff --git a/test/spec/notifying_block_spec.rb b/test/spec/notifying_block_spec.rb index <HASH>..<HASH> 100644 --- a/test/spec/notifying_block_spec.rb +++ b/test/spec/notifying_block_spec.rb @@ -65,7 +65,7 @@ describe Poise::Provider::NotifyingBlock do end end # /context without updated inner resources - context 'with an exception raised inside the block', :focus do + context 'with an exception raised inside the block' do provider(:poise_test) do include Poise::Provider::LWRPPolyfill include Poise::Provider::NotifyingBlock
I should really stop committing :focus.
poise_poise
train
rb
eeeacc3e27f334a178275345dcfd79b70f386075
diff --git a/aeron-cluster/src/main/java/io/aeron/cluster/ConsensusModuleAgent.java b/aeron-cluster/src/main/java/io/aeron/cluster/ConsensusModuleAgent.java index <HASH>..<HASH> 100644 --- a/aeron-cluster/src/main/java/io/aeron/cluster/ConsensusModuleAgent.java +++ b/aeron-cluster/src/main/java/io/aeron/cluster/ConsensusModuleAgent.java @@ -1785,6 +1785,10 @@ final class ConsensusModuleAgent implements Agent { throw new AgentTerminationException("unexpected Aeron close"); } + else if (ConsensusModule.State.CLOSED == state) + { + unexpectedTermination(); + } if (null == dynamicJoin) { @@ -2863,7 +2867,8 @@ final class ConsensusModuleAgent implements Agent { ctx.countedErrorHandler().onError(new ClusterException( "Aeron client in service closed unexpectedly", WARN)); - unexpectedTermination(); + state(ConsensusModule.State.CLOSED); + return; } }
[Java] Don't do run cluster unexpected termination code in counter unavailable handler. Set state and handle it after.
real-logic_aeron
train
java
8b40345be607ba3229ea8c550ee850569cdf7296
diff --git a/autograd/numpy/numpy_grads.py b/autograd/numpy/numpy_grads.py index <HASH>..<HASH> 100644 --- a/autograd/numpy/numpy_grads.py +++ b/autograd/numpy/numpy_grads.py @@ -2,7 +2,7 @@ from __future__ import absolute_import import numpy as onp import operator as op -from autograd.core import getval, primitive +from autograd.core import primitive from . import numpy_wrapper as anp from .numpy_extra import ArrayNode, take, array_types from builtins import range, zip @@ -159,8 +159,6 @@ def grad_transpose(g, ans, vs, gvs, x, axes=None): return anp.transpose(g, axes) anp.transpose.defgrad(grad_transpose) -isarray = lambda x : type(x) in array_types - def repeat_to_match_shape(g, vs, axis, keepdims): """Returns the array g repeated along axis to fit vector space vs. Also returns the number of repetitions of the array."""
numpy_grads no longer does any type checking of variables
HIPS_autograd
train
py
86b642722dd2b6e17456a3007196addda3799f4d
diff --git a/lib/mongoid/relations/many.rb b/lib/mongoid/relations/many.rb index <HASH>..<HASH> 100644 --- a/lib/mongoid/relations/many.rb +++ b/lib/mongoid/relations/many.rb @@ -21,11 +21,11 @@ module Mongoid size == 0 end - # Creates a new document on the references many relation. This will - # save the document if the parent has been persisted. - # - # @example Create and save the new document. - # person.posts.create(:text => "Testing") + # Creates a new document on the references many relation. This will + # save the document if the parent has been persisted. + # + # @example Create and save the new document. + # person.posts.create(:text => "Testing") # # @overload create(attributes = nil, options = {}, type = nil) # @param [ Hash ] attributes The attributes to create with.
Small indentation [ci skip]
mongodb_mongoid
train
rb
f050c0429beffa13d94ad303c1730fef5b44f544
diff --git a/pymysql/tests/test_nextset.py b/pymysql/tests/test_nextset.py index <HASH>..<HASH> 100644 --- a/pymysql/tests/test_nextset.py +++ b/pymysql/tests/test_nextset.py @@ -1,6 +1,11 @@ from pymysql.tests import base from pymysql import util +try: + import unittest2 as unittest +except ImportError: + import unittest + class TestNextset(base.PyMySQLTestCase): @@ -26,3 +31,20 @@ class TestNextset(base.PyMySQLTestCase): cur.execute("SELECT 42") self.assertEqual([(42,)], list(cur)) + + @unittest.expectedFailure + def test_multi_cursor(self): + cur1 = self.con.cursor() + cur2 = self.con.cursor() + + cur1.execute("SELECT 1; SELECT 2;") + cur2.execute("SELECT 42") + + self.assertEqual([(1,)], list(cur1)) + self.assertEqual([(42,)], list(cur2)) + + r = cur1.nextset() + self.assertTrue(r) + + self.assertEqual([(2,)], list(cur1)) + self.assertIsNone(cur1.nextset())
Add multi cursor test currently failed.
PyMySQL_PyMySQL
train
py
a45196dc978564428646b6e302e9367c0dbb363e
diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index <HASH>..<HASH> 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -1079,10 +1079,6 @@ class Page $this->publish_date = Utils::date2timestamp($var); } - if ($this->publish_date === null) { - $this->publish_date = $this->date(); - } - return $this->publish_date; } @@ -2227,7 +2223,7 @@ class Page } } // publish if required, if not clear cache right before page is published - if ($this->publishDate() != $this->modified() && $this->publishDate() > time()) { + if ($this->publishDate() && $this->publishDate() && $this->publishDate() > time()) { $this->published(false); self::getGrav()['cache']->setLifeTime($this->publishDate()); }
regular `date:` header should not impact published visibility
getgrav_grav
train
php
2ab67049387e34dcf5ca2732889754798070cbe3
diff --git a/poloniex/poloniex.py b/poloniex/poloniex.py index <HASH>..<HASH> 100644 --- a/poloniex/poloniex.py +++ b/poloniex/poloniex.py @@ -116,3 +116,7 @@ class Poloniex(PoloniexPublic): response = self._private_session.post(self._private_url, data=params, auth=Poloniex._PoloniexAuth(self._secret)) return response.json(object_hook=AutoCastDict) + + def returnBalances(self): + """Returns all of your available balances.""" + return self._private('returnBalances')
add returnBalances in trading API
Aula13_poloniex
train
py
8b726eae5e004aef6abb27b65825b02ba13adcc6
diff --git a/src/Bkwld/Decoy/Models/Encoding.php b/src/Bkwld/Decoy/Models/Encoding.php index <HASH>..<HASH> 100644 --- a/src/Bkwld/Decoy/Models/Encoding.php +++ b/src/Bkwld/Decoy/Models/Encoding.php @@ -139,8 +139,8 @@ class Encoding extends Base { */ public function getTagAttribute() { - // Require and for the encoding to be complete - if (!$sources = $this->outputs && $this->status == 'complete') return; + // Require sources and for the encoding to be complete + if (!($sources = $this->outputs) && $this->status != 'complete') return; // Start the tag $tag = Element::video();
Fixing a bug in the HTML5 tag generation
BKWLD_decoy
train
php
d3bcd9995765acc25cc58168fe95b536be6dc78a
diff --git a/src/MvcCore/Ext/Routers/ModuleLocalization/UrlByRoute.php b/src/MvcCore/Ext/Routers/ModuleLocalization/UrlByRoute.php index <HASH>..<HASH> 100644 --- a/src/MvcCore/Ext/Routers/ModuleLocalization/UrlByRoute.php +++ b/src/MvcCore/Ext/Routers/ModuleLocalization/UrlByRoute.php @@ -49,10 +49,13 @@ trait UrlByRoute if ( $route->GetAbsolute() && $moduleParamDefined && $currentDomainRouteMatched && $params[$moduleParamName] !== $this->requestedDomainParams[$moduleParamName] - ) throw new \InvalidArgumentException( - "[".__CLASS__."] It's not possible to create URL address " - ."to different module/domain for route defined as absolute." - ); + ) { + $selfClass = version_compare(PHP_VERSION, '5.5', '>') ? self::class : __CLASS__; + throw new \InvalidArgumentException( + "[".$selfClass."] It's not possible to create URL address " + ."to different module/domain for route defined as absolute." + ); + } list ($targetModule, $targetDomainRoute, $domainParamsDefault) = $this->urlGetDomainRouteAndDefaultDomainParams( $params, $moduleParamDefined, $currentDomainRouteMatched
Direct usage of deprecated __CLASS__ constant conditioned.
mvccore_ext-router-module-localization
train
php
91488e83968791b723bfd4ddd2da4e7ca15abf19
diff --git a/exchangelib/account.py b/exchangelib/account.py index <HASH>..<HASH> 100644 --- a/exchangelib/account.py +++ b/exchangelib/account.py @@ -100,14 +100,6 @@ class Account(object): raise ValueError("Expected 'protocol' to be a Protocol, got %s" % self.protocol) log.debug('Added account: %s', self) - @property - def folders(self): - warnings.warn('The Account.folders mapping is deprecated. Use Account.root.walk() instead') - folders_map = defaultdict(list) - for f in self.root.walk(): - folders_map[f.__class__].append(f) - return folders_map - @threaded_cached_property def admin_audit_logs(self): return self.root.get_default_folder(AdminAuditLogs)
Remove Account.folders which has been deprecated since <I>
ecederstrand_exchangelib
train
py
d24e168c5b28db82df3ba60870b9f67aa8235854
diff --git a/src/playbacks/html5_video/html5_video.js b/src/playbacks/html5_video/html5_video.js index <HASH>..<HASH> 100644 --- a/src/playbacks/html5_video/html5_video.js +++ b/src/playbacks/html5_video/html5_video.js @@ -383,6 +383,14 @@ export default class HTML5Video extends Playback { } _onError() { + const { code, message } = this.el.error + + const formattedError = this.createError({ + code, + description: message, + raw: this.el.error, + }) + this.trigger(Events.PLAYBACK_ERROR, this.el.error, this.name) }
feat(html5_video): create player error on playback error
clappr_clappr
train
js
396aa852e74f48bdc70c87c959f9760564c8bc5a
diff --git a/indra/tools/reading/readers/trips/__init__.py b/indra/tools/reading/readers/trips/__init__.py index <HASH>..<HASH> 100644 --- a/indra/tools/reading/readers/trips/__init__.py +++ b/indra/tools/reading/readers/trips/__init__.py @@ -4,9 +4,11 @@ import random import logging import threading import subprocess as sp +from unidecode import unidecode from contextlib import closing from datetime import datetime, timedelta, timezone +from indra.resources import greek_alphabet from indra.tools.reading.readers.core import Reader from indra.sources.trips import client, process_xml @@ -115,8 +117,15 @@ class TripsReader(Reader): if not self.running: logger.error("Breaking loop: trips is down.") break - html = client.send_query(content.get_text(), - service_host=service_host, + + # Clean up the text string a bit. + raw_text = content.get_text() + for greek_letter, spelled_letter in greek_alphabet.items(): + raw_text = raw_text.replace(greek_letter, spelled_letter) + text = unidecode(raw_text) + + # Process the text + html = client.send_query(text, service_host=service_host, service_endpoint=service_endpoint) xml = client.get_xml(html) self.add_result(content.get_id(), xml)
Clean up the text before sending it to TRIPS.
sorgerlab_indra
train
py
44323b08e932f7cdc304d80a3fb342a4b32e79f9
diff --git a/default_test.go b/default_test.go index <HASH>..<HASH> 100644 --- a/default_test.go +++ b/default_test.go @@ -102,6 +102,30 @@ func TestFormatEmail(t *testing.T) { testValid(t, "email", str) testInvalid(t, "email", "somebody@somewhere@com") + + validEmails := []string{ + "[email protected]", + "[email protected]", + "[email protected]", + `" "@example.com`, + `"Abc\@def"@example.com`, + `"Fred Bloggs"@example.com`, + `"Joe\\Blow"@example.com`, + `"Abc@def"@example.com`, + "customer/[email protected]", + "[email protected]", + "!def!xyz%[email protected]", + "[email protected]", + "!#$%&'*+-/=?^_`{}|[email protected]", + "Miles.O'[email protected]", + "postmaster@☁→❄→☃→☀→☺→☂→☹→✝.ws", + "root@localhost", + "john@com", + } + + for _, eml := range validEmails { + testValid(t, "email", eml) + } } func TestFormatHostname(t *testing.T) {
adds a test with some unusual email addresses
go-openapi_strfmt
train
go
d8942ce75b3ebaf207bad6ea6da759a166ad8d65
diff --git a/can/interfaces/pcan/pcan.py b/can/interfaces/pcan/pcan.py index <HASH>..<HASH> 100644 --- a/can/interfaces/pcan/pcan.py +++ b/can/interfaces/pcan/pcan.py @@ -9,6 +9,7 @@ from can.interfaces.pcan.PCANBasic import * from can.bus import BusABC from can.message import Message from can import CanError +import can import time boottimeEpoch = 0 @@ -82,7 +83,7 @@ class PcanBus(BusABC): else: self.channel_info = channel - bitrate = kwargs.get('bitrate', 500000) + bitrate = kwargs.get('bitrate', can.rc.get('bitrate', 500000)) pcan_bitrate = pcan_bitrate_objs.get(bitrate, PCAN_BAUD_500K) hwtype = PCAN_TYPE_ISA
Use configured bitrate in pcan. Closes #<I> (cherry picked from commit bd<I>d<I>)
hardbyte_python-can
train
py
616a243dcc0e65caf439b8f23477c0992235dc9b
diff --git a/tests/http/test_request_data_property.py b/tests/http/test_request_data_property.py index <HASH>..<HASH> 100644 --- a/tests/http/test_request_data_property.py +++ b/tests/http/test_request_data_property.py @@ -30,6 +30,15 @@ def test_json_content_type_with_json_body(): assert request.data == {'key': 'value', 'key2': 'value2', 'key[1]': 'subvalue1', 'key[2]': 'subvalue2'} +def test_json_content_type_with_json_bytes_body(): + body = bytes(json.dumps({'key': 'value', 'key2': 'value2', 'key[1]': 'subvalue1', 'key[2]': 'subvalue2'}), 'utf-8') + request = RequestFactory( + body=body, + content_type='application/json', + ) + assert request.data == {'key': 'value', 'key2': 'value2', 'key[1]': 'subvalue1', 'key[2]': 'subvalue2'} + + def test_form_content_type_with_body(): request = RequestFactory( body="key=value&key2=value2&arr[1]=subvalue1&arr[2]=subvalue2",
Add test for a json body of 'bytes' type When creating a post request with the requests library in python 3 (tested on <I>) passing a dict to the json parameter the body generated is of type 'bytes' and not 'str'.
pipermerriam_flex
train
py
b6149bc1b855ce4f800d3e0e5264b2d70816719a
diff --git a/lib/faker/internet.rb b/lib/faker/internet.rb index <HASH>..<HASH> 100644 --- a/lib/faker/internet.rb +++ b/lib/faker/internet.rb @@ -12,17 +12,28 @@ module Faker def user_name(name = nil) return name.scan(/\w+/).shuffle.join(%w(. _).rand).downcase if name - [ + fix_umlauts([ Proc.new { Name.first_name.gsub(/\W/, '').downcase }, Proc.new { [ Name.first_name, Name.last_name ].map {|n| n.gsub(/\W/, '') }.join(%w(. _).rand).downcase } - ].rand.call + ].rand.call) end def domain_name - [ domain_word, domain_suffix ].join('.') + [ fix_umlauts(domain_word), domain_suffix ].join('.') + end + + def fix_umlauts(string) + string.gsub(/[äöüß]/i) do |match| + case match.downcase + when "ä" 'ae' + when "ö" 'oe' + when "ü" 'ue' + when "ß" 'ss' + end + end end def domain_word
fixed german umlauts in domain names
stympy_faker
train
rb
829e47681a23be06a3433c15ecd3d9351aba6142
diff --git a/java/src/org/openqa/selenium/remote/http/netty/NettyClient.java b/java/src/org/openqa/selenium/remote/http/netty/NettyClient.java index <HASH>..<HASH> 100644 --- a/java/src/org/openqa/selenium/remote/http/netty/NettyClient.java +++ b/java/src/org/openqa/selenium/remote/http/netty/NettyClient.java @@ -86,6 +86,7 @@ public class NettyClient implements HttpClient { .setConnectTimeout(toClampedInt(config.connectionTimeout().toMillis())) .setReadTimeout(toClampedInt(config.readTimeout().toMillis())) .setFollowRedirect(true) + .setMaxRedirects(100) .setUseProxyProperties(true) .setUseProxySelector(true) .setMaxRequestRetry(0);
[java] Setting a high max redirects Some cloud users (Sauce Labs in this case), start many concurrent sessions and go over their max concurrency. Those session requests get queued and a redirect mechanism is used. When the limit is reached the session request dies. This change avoids that.
SeleniumHQ_selenium
train
java
f35852a0b3bc98ffa49c27c4d56dc9bdd8c6048a
diff --git a/hyperas/optim.py b/hyperas/optim.py index <HASH>..<HASH> 100644 --- a/hyperas/optim.py +++ b/hyperas/optim.py @@ -123,6 +123,9 @@ def get_hyperopt_space(parts, hyperopt_params): def retrieve_data_string(data): + ''' + This assumes 4 spaces for indentation and won't work otherwise + ''' data_string = inspect.getsource(data) first_line = data_string.split("\n")[0] data_string = data_string.replace(first_line, "") @@ -130,7 +133,7 @@ def retrieve_data_string(data): split_data = data_string.split("\n") for i, line in enumerate(split_data): - split_data[i] = line.strip() + "\n" + split_data[i] = line[4:] + "\n" data_string = ''.join(split_data) print(">>> Data") print(data_string)
Fix indentation problem for data function
maxpumperla_hyperas
train
py
026e54935f4dd0f22eb0ae4a1606d546a6a33641
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -187,7 +187,9 @@ function Driver (options) { this._updateBalance() ]) .then(function () { - if (self._destroyed) return + if (self._destroyed) { + return Q.reject(new Error('destroyed')) + } self.msgDB.start() self.txDB.start() @@ -202,8 +204,6 @@ function Driver (options) { self._sendTheUnsent() // self._watchMsgStatuses() }) - - this._readyPromise.done() } Driver.prototype.ready = function () {
if tim is destroyed before it starts, reject ready promise
tradle_tim-old-engine
train
js
db7f654cf88c38f98a86bf4dd7bec01c3ee45a11
diff --git a/icetea_lib/DeviceConnectors/DutProcess.py b/icetea_lib/DeviceConnectors/DutProcess.py index <HASH>..<HASH> 100755 --- a/icetea_lib/DeviceConnectors/DutProcess.py +++ b/icetea_lib/DeviceConnectors/DutProcess.py @@ -16,7 +16,6 @@ DutProcess module. """ from icetea_lib.DeviceConnectors.Dut import Dut, DutConnectionError -from icetea_lib.TestStepError import TestStepError, TestStepFail from icetea_lib.GenericProcess import GenericProcess from icetea_lib.DeviceConnectors.DutInformation import DutInformation from icetea_lib.build.build import Build @@ -82,12 +81,7 @@ class DutProcess(Dut, GenericProcess): :return: Nothing """ - if self.is_alive(): - self.logger.info("Process alive, trying to exit", extra={'type': 'XXX'}) - try: - self.execute_command("exit", wait=False) - except (TestStepError, TestStepFail): - self.logger.warning("exit timed out", extra={'type': 'XXX'}) + pass def close_connection(self): """
Removed application specific exit command. (#<I>)
ARMmbed_icetea
train
py
ac1d1b5db68bc8f2628c5cb4a8c89752d753e087
diff --git a/src/compiler.js b/src/compiler.js index <HASH>..<HASH> 100644 --- a/src/compiler.js +++ b/src/compiler.js @@ -855,11 +855,12 @@ var Compiler = Object.extend({ var name = block.name.value; this.emitFuncBegin('b_' + name); - this.emitLine('var l_super = context.getSuper(env, ' + + this.emitLine('var l_super = runtime.markAsSafe(' + + 'context.getSuper(env, ' + '"' + name + '", ' + 'b_' + name + ', ' + 'frame, ' + - 'runtime);'); + 'runtime));'); var tmpFrame = new Frame(); tmpFrame.set('super', 'l_super');
Using `markAsSafe` to preserve `super()` calls
mozilla_nunjucks
train
js
0dcfdaf1642f354b9ca56973fde7325008051457
diff --git a/holidays.py b/holidays.py index <HASH>..<HASH> 100755 --- a/holidays.py +++ b/holidays.py @@ -228,10 +228,14 @@ def createHolidaySum(h1, h2): return HolidaySum -def CountryHoliday(country, years=[], prov=None, state=None): +def CountryHoliday(country, years=[], prov=None, state=None, expand=True, + observed=True): try: country_holiday = globals()[country](years=years, - prov=prov, state=state) + prov=prov, + state=state, + expand=expand, + observed=observed) except (KeyError): raise KeyError("Country %s not available" % country) return country_holiday
Added missing parameters to CountryHoliday (#<I>)
dr-prodigy_python-holidays
train
py
e94c083a556b277fbd5cb038fb800fa86595ecda
diff --git a/endesive/__init__.py b/endesive/__init__.py index <HASH>..<HASH> 100644 --- a/endesive/__init__.py +++ b/endesive/__init__.py @@ -2,6 +2,6 @@ __author__ = 'Grzegorz Makarewicz' __license__ = 'MIT' -__version__ = '2.0.0' +__version__ = '2.0.1' __all__ = [__author__, __license__, __version__]
#<I> - accessing pages in big documents
m32_endesive
train
py
4d8367bc0e5b928335382189230d0a5caf341bc7
diff --git a/sa/database.go b/sa/database.go index <HASH>..<HASH> 100644 --- a/sa/database.go +++ b/sa/database.go @@ -59,7 +59,7 @@ func NewDbMap(driver string, dbConnect string) (*gorp.DbMap, error) { return nil, err } - logger.Debug(fmt.Sprintf("Connecting to database %s %s", driver, dbConnect)) + logger.Debug("Connecting to database") dialect, ok := dialectMap[driver].(gorp.Dialect) if !ok { @@ -67,7 +67,7 @@ func NewDbMap(driver string, dbConnect string) (*gorp.DbMap, error) { return nil, err } - logger.Info(fmt.Sprintf("Connected to database %s %s", driver, dbConnect)) + logger.Info("Connected to database") dbmap := &gorp.DbMap{Db: db, Dialect: dialect, TypeConverter: BoulderTypeConverter{}}
Remove logging of dbConnect string. This can accidentally put passwords in logs.
letsencrypt_boulder
train
go
67062aef1c167763eb936a96a81b955b91400fa3
diff --git a/lib/active_rest_client/request.rb b/lib/active_rest_client/request.rb index <HASH>..<HASH> 100644 --- a/lib/active_rest_client/request.rb +++ b/lib/active_rest_client/request.rb @@ -104,11 +104,10 @@ module ActiveRestClient do_request(etag) end result = handle_response(response) + if result == :not_modified && cached + result = cached.result + end ActiveRestClient::Base.write_cached_response(self, response, result) - end - if result == :not_modified && cached - cached.result - else result end end diff --git a/lib/active_rest_client/version.rb b/lib/active_rest_client/version.rb index <HASH>..<HASH> 100644 --- a/lib/active_rest_client/version.rb +++ b/lib/active_rest_client/version.rb @@ -1,3 +1,3 @@ module ActiveRestClient - VERSION = "0.9.51" + VERSION = "0.9.52" end
Fixed a bug in etag-not_modified responses not re-caching the correct response
whichdigital_active-rest-client
train
rb,rb
2b55874584f034b5113359ced6b05c143d31e03c
diff --git a/utils/uname_darwin.go b/utils/uname_darwin.go index <HASH>..<HASH> 100644 --- a/utils/uname_darwin.go +++ b/utils/uname_darwin.go @@ -2,9 +2,12 @@ package utils import ( "errors" - "syscall" ) -func uname() (*syscall.Utsname, error) { +type Utsname struct { + Release [65]byte +} + +func uname() (*Utsname, error) { return nil, errors.New("Kernel version detection is not available on darwin") } diff --git a/utils/uname_linux.go b/utils/uname_linux.go index <HASH>..<HASH> 100644 --- a/utils/uname_linux.go +++ b/utils/uname_linux.go @@ -4,8 +4,9 @@ import ( "syscall" ) -// FIXME: Move this to utils package -func uname() (*syscall.Utsname, error) { +type Utsname syscall.Utsname + +func uname() (*Utsname, error) { uts := &syscall.Utsname{} if err := syscall.Uname(uts); err != nil {
utils: fix compilation on Darwin Although Docker daemon does not work on Darwin, the API client will have to work. That said, I'm fixing the compilation of the package on Darwin.
moby_moby
train
go,go
3101b1ff80cdd66206b9f8ff5ff35384b7dbde8c
diff --git a/eli5/formatters/html.py b/eli5/formatters/html.py index <HASH>..<HASH> 100644 --- a/eli5/formatters/html.py +++ b/eli5/formatters/html.py @@ -37,6 +37,10 @@ def format_as_html(explanation, include_styles=True, force_weights=True, With ``force_weights=False``, weights will not be displayed in a table for predictions where it is possible to show feature weights highlighted in the document. + If ``highlight_spaces`` is None (default), spaces will be highlighted in + feature names only if there are any spaces at the start or at the end of the + feature. Setting it to True forces space highlighting, and setting it to False + turns it off. """ template = template_env.get_template('explain.html') if highlight_spaces is None: diff --git a/eli5/formatters/text.py b/eli5/formatters/text.py index <HASH>..<HASH> 100644 --- a/eli5/formatters/text.py +++ b/eli5/formatters/text.py @@ -15,6 +15,12 @@ _SPACE = '_' if six.PY2 else '░' def format_as_text(expl, show=fields.ALL, highlight_spaces=None): + """ Format explanation as text. + If ``highlight_spaces`` is None (default), spaces will be highlighted in + feature names only if there are any spaces at the start or at the end of the + feature. Setting it to True forces space highlighting, and setting it to False + turns it off. + """ lines = [] # type: List[str] if highlight_spaces is None:
Add highlight_spaces to docstrings
TeamHG-Memex_eli5
train
py,py
372d03b25f21d363138ecf340816dd04fb33ef71
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,3 +1,7 @@ +import os + +on_rtd = os.environ.get('READTHEDOCS', None) == 'True' + extensions = [] templates_path = ['_templates'] source_suffix = '.rst' @@ -14,5 +18,8 @@ latex_documents = [ ('index', 'django-soapbox.tex', u'django-soapbox Documentation', u'James Bennett', 'manual'), ] -html_theme = 'classic' +if not on_rtd: + import sphinx_rtd_theme + html_theme = 'sphinx_rtd_theme' + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
Switch to RTD docs theme.
ubernostrum_django-soapbox
train
py
e176af072bc04a5f573136c6071875efe22cd3a5
diff --git a/docs/docs.js b/docs/docs.js index <HASH>..<HASH> 100644 --- a/docs/docs.js +++ b/docs/docs.js @@ -231,15 +231,15 @@ $(function () { 'default': 'client', example: 'pagination-table' }, - { - name: 'totalRows', - attribute: 'data-total-rows', - type: 'Number', - description: 'Defines the total rows of table, you need to set this option when the sidePagination option is set to "server".', - description_zh: '定义表格记录的总条数,在server端分页的时候需要设置该参数。', - 'default': 0, - example: '' - }, +// { +// name: 'totalRows', +// attribute: 'data-total-rows', +// type: 'Number', +// description: 'Defines the total rows of table, you need to set this option when the sidePagination option is set to "server".', +// description_zh: '定义表格记录的总条数,在server端分页的时候需要设置该参数。', +// 'default': 0, +// example: '' +// }, { name: 'pageNumber', attribute: 'data-page-number',
Remove docs of totalRows option
wenzhixin_bootstrap-table
train
js
11677063353cb6a1913d927bc8eb9338bc4c563a
diff --git a/lib/github_changelog_generator/version.rb b/lib/github_changelog_generator/version.rb index <HASH>..<HASH> 100644 --- a/lib/github_changelog_generator/version.rb +++ b/lib/github_changelog_generator/version.rb @@ -1,3 +1,3 @@ module GitHubChangelogGenerator - VERSION = "1.10.3" + VERSION = "1.10.4" end
Update gemspec to version <I>
github-changelog-generator_github-changelog-generator
train
rb
c26363e026b1fc196ca488e59e82f1523e6c242a
diff --git a/lib/email_spy/delivery_method.rb b/lib/email_spy/delivery_method.rb index <HASH>..<HASH> 100644 --- a/lib/email_spy/delivery_method.rb +++ b/lib/email_spy/delivery_method.rb @@ -8,6 +8,9 @@ module EmailSpy end def deliver!(email) + launch messages(email, location(email, settings)) + end + private def location(email, settings) @@ -26,6 +29,7 @@ module EmailSpy end.each &:render end + def launch(messages) Launchy.open URI.parse "file://#{messages.first.filepath}" end end
Putting the launch logic in a private method
krainboltgreene_email_spy
train
rb
0c8386a1dec88a3c178982a9f1644d8da0b4ba26
diff --git a/test/unit/specs/Datepicker.spec.js b/test/unit/specs/Datepicker.spec.js index <HASH>..<HASH> 100644 --- a/test/unit/specs/Datepicker.spec.js +++ b/test/unit/specs/Datepicker.spec.js @@ -644,6 +644,8 @@ describe('Datepicker with open date', () => { it('should set pageTimestamp to be first day of open date\'s month', () => { const d = new Date(vm.pageTimestamp) + expect(vm.openDate.getTime()).to.equal(openDate.getTime()) + vm.setPageDate() expect(d.getFullYear()).to.equal(openDate.getFullYear()) expect(d.getMonth()).to.equal(openDate.getMonth()) expect(d.getDate()).to.equal(1)
Check that openDate is set before testing pageTimestamp
charliekassel_vuejs-datepicker
train
js
33a2e6afb932a01f4365876dbb353963dfc3ff25
diff --git a/server/client_http.go b/server/client_http.go index <HASH>..<HASH> 100644 --- a/server/client_http.go +++ b/server/client_http.go @@ -35,8 +35,6 @@ type httpWriter struct { w http.ResponseWriter } -// http context - func newClientHTTP(app *App, w http.ResponseWriter, r *http.Request) { var err error c := new(httpClient) @@ -90,7 +88,11 @@ func (c *httpClient) makeRequest(app *App, r *http.Request, w http.ResponseWrite } req.cmd = strings.ToLower(cmd) - req.args = args + + if req.cmd == "slaveof" || req.cmd == "fullsync" || req.cmd == "sync" { + return nil, fmt.Errorf("unsupported command: '%s'", cmd) + } + req.remoteAddr = c.addr(r) req.resp = &httpWriter{contentType, cmd, w} return req, nil
http interface: not support cmds of repl
siddontang_ledisdb
train
go
195ff29152ba8fd8528609c21600c8ba1e0edfca
diff --git a/lib/soapy_cake/client.rb b/lib/soapy_cake/client.rb index <HASH>..<HASH> 100644 --- a/lib/soapy_cake/client.rb +++ b/lib/soapy_cake/client.rb @@ -58,6 +58,16 @@ module SoapyCake @logger ||= opts[:logger] || (defined?(::Rails) && ::Rails.logger) end + def log_curl_command(request) + curl_headers = HEADERS.map {|k, v| "-H \"#{k}: #{v}\""}.join(' ') + curl_body = request.xml + .tr("\n", '') + .gsub(/>\s*</, '><') + .sub(request.api_key, '{{{ INSERT API KEY }}}') + + logger&.info("curl --data '#{curl_body}' #{curl_headers} https://#{domain}/#{request.path}") + end + def response_body(request) request.opts[:response].presence || http_response(request) end @@ -65,6 +75,8 @@ module SoapyCake def http_response(request) logger&.info("soapy_cake:request #{request}") + log_curl_command(request) if fetch_opt(:log_curl) + http_request = Net::HTTP::Post.new(request.path, HEADERS) http_request.body = request.xml response = perform_http_request(http_request)
Add method to output calls as curl command
ad2games_soapy_cake
train
rb
21e071a5da8406aff3a484e0338ea818a6a42579
diff --git a/scripts/constants.py b/scripts/constants.py index <HASH>..<HASH> 100644 --- a/scripts/constants.py +++ b/scripts/constants.py @@ -15,16 +15,16 @@ import sys # Kubernetes branch to get the OpenAPI spec from. -KUBERNETES_BRANCH = "release-1.6" +KUBERNETES_BRANCH = "release-1.7" # client version for packaging and releasing. -CLIENT_VERSION = "2.0.0-snapshot" +CLIENT_VERSION = "3.0.0-snapshot" # Name of the release package PACKAGE_NAME = "kubernetes" # Stage of development, mainly used in setup.py's classifiers. -DEVELOPMENT_STATUS = "3 - Alpha" +DEVELOPMENT_STATUS = "4 - Beta" # If called directly, return the constant value given
Master to follow kubernetes <I> branch
kubernetes-client_python
train
py
2da75b56540e8edd8d13543783f75af73448cf54
diff --git a/system/HTTP/Message.php b/system/HTTP/Message.php index <HASH>..<HASH> 100644 --- a/system/HTTP/Message.php +++ b/system/HTTP/Message.php @@ -20,7 +20,7 @@ class Message protected $protocolVersion; - protected $validProtocolVersions = ['1.0', '1.1']; + protected $validProtocolVersions = ['1.0', '1.1', '2']; protected $body;
Don't refuse HTTP/2 connections.
codeigniter4_CodeIgniter4
train
php
ceb4733a086da41a759018ca31c8d0aac9094c90
diff --git a/lib/key_path/path.rb b/lib/key_path/path.rb index <HASH>..<HASH> 100644 --- a/lib/key_path/path.rb +++ b/lib/key_path/path.rb @@ -26,11 +26,30 @@ module KeyPath end def to_collection + collection = {} s = self.to_a - - {:item => { - :resource_uri => {} - }} + depth = '' + + s.each_with_index do |e, i| + # assemble the key + if e.is_number? + key = "#{e}" + else + key = ":#{e}" + end + depth << "[#{key}]" + + # figure out the correct type to push + type = {} + if e.is_plural? + type = [] + end + + # evaluate this stage + eval "collection#{depth} = #{type}" + end + + collection end def inspect
Implements the to_collection method for KeyPath::Path.
nickcharlton_keypath-ruby
train
rb
883fd008d29fdcaab18b50f47c248e3d112f39ed
diff --git a/addon/hint/show-hint.js b/addon/hint/show-hint.js index <HASH>..<HASH> 100644 --- a/addon/hint/show-hint.js +++ b/addon/hint/show-hint.js @@ -302,7 +302,7 @@ setTimeout(function(){cm.focus();}, 20); }); - CodeMirror.signal(data, "select", completions[0], hints.firstChild); + CodeMirror.signal(data, "select", completions[this.selectedHint], hints.childNodes[this.selectedHint]); return true; }
[show-hint addon] Fire correct hint selection event specific hint is selected Fixes #<I>.
codemirror_CodeMirror
train
js
b60598a05dae6f4bc71b6583a9c1e5cf926a1e72
diff --git a/lib/api/traversing.js b/lib/api/traversing.js index <HASH>..<HASH> 100644 --- a/lib/api/traversing.js +++ b/lib/api/traversing.js @@ -72,9 +72,18 @@ var closest = exports.closest = function(selector) { var next = exports.next = function() { if (!this[0]) { return this; } - var elem = this[0]; - while ((elem = elem.next)) if (isTag(elem)) return this._make(elem); - return this._make([]); + var elems = []; + + _.forEach(this, function(elem) { + while ((elem = elem.next)) { + if (isTag(elem)) { + elems.push(elem); + return; + } + } + }); + + return this._make(elems); }; var nextAll = exports.nextAll = function(selector) { diff --git a/test/api.traversing.js b/test/api.traversing.js index <HASH>..<HASH> 100644 --- a/test/api.traversing.js +++ b/test/api.traversing.js @@ -103,6 +103,10 @@ describe('$(...)', function() { expect($('.banana', fruits).next()).to.have.length(0); }); + it('() : should operate over all elements in the selection', function() { + expect($('.apple, .orange', food).next()).to.have.length(2); + }); + }); describe('.nextAll', function() {
Fix bug in `next` Ensure that the `next` method operates over every element in the collection.
oyyd_cheerio-without-node-native
train
js,js
c2ef0348039409b4d1e143748e7eb2db8c4d007d
diff --git a/buffalo/cmd/app_generators.go b/buffalo/cmd/app_generators.go index <HASH>..<HASH> 100644 --- a/buffalo/cmd/app_generators.go +++ b/buffalo/cmd/app_generators.go @@ -54,7 +54,8 @@ import ( ) func main() { - log.Fatal(http.ListenAndServe(":3000", actions.App())) + port := defaults.String(os.Getenv("PORT"), "3000") + log.Fatal(http.ListenAndServe(fmt.Sprintf(":%s", port), actions.App())) } `
PORT should be settable via an ENV var closes #<I>
gobuffalo_buffalo
train
go
36a20ea7c37d1a0b13d2860729c72b4261c16490
diff --git a/dispatch/modules/auth/tests.py b/dispatch/modules/auth/tests.py index <HASH>..<HASH> 100644 --- a/dispatch/modules/auth/tests.py +++ b/dispatch/modules/auth/tests.py @@ -1,7 +1,7 @@ from django.test import TestCase from django.contrib.auth import get_user_model, authenticate, login from django.db import IntegrityError -from dispatch.apps.core.models import Person, ContributorRole +from dispatch.apps.core.models import Person User = get_user_model() @@ -56,14 +56,5 @@ class PersonTests(TestCase): ) self.p1.save() - def test_make_contributor(self): - writer = ContributorRole(title="writer") - writer.save() - self.p1.roles.add(writer) - - roles = self.p1.roles.all() - if writer not in roles: - self.fail() - def test_person_str(self): self.assertEquals(self.p1.__str__(), "John Doe")
remove ContributorRole from core tests
ubyssey_dispatch
train
py
168b6cf41787a407518c15d19d8e713b4aa08186
diff --git a/src/control/ShoppingCart.php b/src/control/ShoppingCart.php index <HASH>..<HASH> 100644 --- a/src/control/ShoppingCart.php +++ b/src/control/ShoppingCart.php @@ -825,8 +825,6 @@ class ShoppingCart extends Controller // Extend our save operation $this->extend("onBeforeSave"); - $member = Member::currentUser(); - $contact = $member->Contact(); $estimate = $this->getEstimate(); $session = $this->getSession();
Fix error on save when user not logged in
silvercommerce_shoppingcart
train
php
524d8f6800861ca02c438fa7c65908221215b82e
diff --git a/test/dot-test.js b/test/dot-test.js index <HASH>..<HASH> 100644 --- a/test/dot-test.js +++ b/test/dot-test.js @@ -130,6 +130,15 @@ describe("lib/dot", function() { describe("can parse all files in test-data", function() { var testDataDir = path.resolve(__dirname, "test-data"); + + // Hack when running testling - it seems to return an empty object from fs... + if (!("readdirSync" in fs)) { + fs.readdirSync = function() { + console.log("!! Mocking fs module. This should only appear with testling."); + return []; + }; + } + fs.readdirSync(testDataDir).forEach(function(file) { it(file, function() { var f = fs.readFileSync(path.resolve(testDataDir, file), "UTF-8");
Hack around problem with testling and fs module
dagrejs_dagre-d3
train
js
8cb0b39dc30a06ce78a68a662635d61a0b7477d4
diff --git a/recipe/common.php b/recipe/common.php index <HASH>..<HASH> 100644 --- a/recipe/common.php +++ b/recipe/common.php @@ -134,8 +134,8 @@ task('deploy:prepare', [ 'deploy:lock', 'deploy:release', 'deploy:update_code', - 'deploy:writable', 'deploy:shared', + 'deploy:writable', ]); task('deploy:publish', [
Switch deploy:shared and deploy:writable order
deployphp_deployer
train
php
568abbde5188dcfa3d87610d2dacb42f46cf2c59
diff --git a/queries_test.go b/queries_test.go index <HASH>..<HASH> 100644 --- a/queries_test.go +++ b/queries_test.go @@ -252,11 +252,11 @@ func TestError(t *testing.T) { t.Fatal("Query should fail") } - if err, ok := err.(Error); !ok { - t.Fatalf("Should be sql error, actually %t, %v", err, err) + if sqlerr, ok := err.(Error); !ok { + t.Fatalf("Should be sql error, actually %T, %v", err, err) } else { - if err.Number != 2812 { // Could not find stored procedure 'bad' - t.Fatalf("Should be specific error code 2812, actually %d %s", err.Number, err) + if sqlerr.Number != 2812 { // Could not find stored procedure 'bad' + t.Fatalf("Should be specific error code 2812, actually %d %s", sqlerr.Number, sqlerr) } } }
fix format err was always nil inside the if; introduced sqlerr to fix it. %t formats booleans; changed to %T for representation of the type of value.
denisenkom_go-mssqldb
train
go
cf7f83866e404ef387a5e0ff4a8e818c0ee95d55
diff --git a/src/main/java/eu/hansolo/tilesfx/Tile.java b/src/main/java/eu/hansolo/tilesfx/Tile.java index <HASH>..<HASH> 100644 --- a/src/main/java/eu/hansolo/tilesfx/Tile.java +++ b/src/main/java/eu/hansolo/tilesfx/Tile.java @@ -909,6 +909,12 @@ public class Tile extends Control { } /** + * Returns the moving average object + * @return the moving average object + */ + public MovingAverage getMovingAverage() { return movingAverage; } + + /** * Returns true if the averaging functionality is enabled. * @return true if the averaging functionality is enabled */
Added a method to get the MovingAverage object
HanSolo_tilesfx
train
java
ddcaabd303c4adbe622598ea2645b2049eccfb93
diff --git a/ext/mini_racer_extension/extconf.rb b/ext/mini_racer_extension/extconf.rb index <HASH>..<HASH> 100644 --- a/ext/mini_racer_extension/extconf.rb +++ b/ext/mini_racer_extension/extconf.rb @@ -17,6 +17,28 @@ if ENV['CXX'] CONFIG['CXX'] = ENV['CXX'] end +CXX11_TEST = <<EOS +#if __cplusplus <= 199711L +# error A compiler that supports at least C++11 is required in order to compile this project. +#endif +EOS + +`echo "#{CXX11_TEST}" | #{CONFIG['CXX']} -std=c++0x -x c++ -E -` +unless $?.success? + warn <<EOS + + +WARNING: C++11 support is required for compiling mini_racer. Please make sure +you are using a compiler that supports at least C++11. Examples of such +compilers are GCC 4.7+ and Clang 3.2+. + +If you are using Travis, consider either migrating your bulid to Ubuntu Trusty or +installing GCC 4.8. See mini_racer's README.md for more information. + + +EOS +end + CONFIG['LDSHARED'] = '$(CXX) -shared' unless RUBY_PLATFORM =~ /darwin/ if CONFIG['warnflags'] CONFIG['warnflags'].gsub!('-Wdeclaration-after-statement', '')
Check for C<I> support and warn if it's missing Add a test for C<I> support of the compiler and display a warning and instructions what the users should do in case it's missing. This closes #<I>
discourse_mini_racer
train
rb
228ea3b721b4701dfaf50350b74436da3cb7e8ef
diff --git a/src/actions/analytics.js b/src/actions/analytics.js index <HASH>..<HASH> 100644 --- a/src/actions/analytics.js +++ b/src/actions/analytics.js @@ -159,9 +159,9 @@ export function recordImpressions(queryId, impressions = []) { headers, appbaseRef: { url, protocol, credentials }, } = getState(); - if (queryId && impressions.length) { - const esURL = `${protocol}://${url}`; - const parsedURL = esURL.replace(/\/+$/, ''); + const esURL = `${protocol}://${url}`; + const parsedURL = esURL.replace(/\/+$/, ''); + if (!parsedURL.includes('scalr.api.appbase.io') && queryId && impressions.length) { fetch(`${parsedURL}/${app}/_analytics/search`, { method: 'PUT', body: JSON.stringify({
fix: avoid impressions reacking for app users
appbaseio_reactivecore
train
js
ad508e8c4ca0da4ee6b3e09a673aea667da003f3
diff --git a/src/angular-multi-select-styles-helper.js b/src/angular-multi-select-styles-helper.js index <HASH>..<HASH> 100644 --- a/src/angular-multi-select-styles-helper.js +++ b/src/angular-multi-select-styles-helper.js @@ -55,6 +55,10 @@ angular_multi_select_styles_helper.factory('angularMultiSelectStylesHelper', [ }; StylesHelper.prototype.get_open_class = function (item) { + if (item[angularMultiSelectConstants.INTERNAL_KEY_CHILDREN_LEAFS] === 0) { + return ''; + } + return item[this.OPEN_PROPERTY] === true ? angularMultiSelectConstants.CSS_OPEN : angularMultiSelectConstants.CSS_CLOSED;
Leaf should not have neither closed nor open caret class
alexandernst_angular-multi-select
train
js
066285f4d6888f54c18f6384dbf4e918935969a8
diff --git a/tests/test_conformance.py b/tests/test_conformance.py index <HASH>..<HASH> 100644 --- a/tests/test_conformance.py +++ b/tests/test_conformance.py @@ -461,6 +461,21 @@ a b '''.lstrip()) + def test_sass_unicode(self): + self.assertHTML( +u''' +a +:sass + #mydiv:before + content: "☺" +b +''', u''' +a +<style>/*<![CDATA[*/#mydiv:before{content:"☺"}/*]]>*/</style> +b +'''.lstrip()) + + def test_filter_scoping(self): self.assertHTML( ''' @@ -490,7 +505,7 @@ A A '''.lstrip()) - def test_filter_unicode(self): + def test_coffeescript_unicode(self): self.assertHTML( u''' :coffeescript
Test passing unicode to SASS.
mikeboers_PyHAML
train
py
52b7dafebe3abc7152941e40d0419f4fb449b327
diff --git a/lib/bud.rb b/lib/bud.rb index <HASH>..<HASH> 100644 --- a/lib/bud.rb +++ b/lib/bud.rb @@ -177,10 +177,8 @@ class Bud if @initial_port == 0 success = false 15.times do - #@port = 5000 + rand(20000) - @port = 0 + rand(1200) + @port = 5000 + rand(20000) begin - puts "Trying port #{@port}..." EventMachine::start_server(@ip, @port, BudServer, self) success = true break
Fix fat-fingering of previous ephemeral port commit. Remove debug code.
bloom-lang_bud
train
rb
1ca6e6c41b0964e1c945b64582039137ec6d9a7c
diff --git a/html/pfappserver/root/static/admin/configuration/authentication.js b/html/pfappserver/root/static/admin/configuration/authentication.js index <HASH>..<HASH> 100644 --- a/html/pfappserver/root/static/admin/configuration/authentication.js +++ b/html/pfappserver/root/static/admin/configuration/authentication.js @@ -295,13 +295,13 @@ function initAuthentication() { var action = type.val(); var value = type.next(); - // Replace value field + // Replace value field with the one from the templates var value_new = $('#' + action + '_action').clone(); value_new.attr('id', value.attr('id')); value_new.attr('name', value.attr('name')); value_new.insertBefore(value); - if (value.is('[type="hidden"]')) { + if (value.is('[type="hidden"]') && value.val().length) { value_new.val(value.val()); } @@ -316,4 +316,10 @@ function initAuthentication() { $('#section').on('change', '#ruleActions select[name$=type]', function(event) { updateAction($(this)); }); + + /* Update the rule action fields when adding a new action */ + $('#section').on('admin.added', '#ruleActions tr', function(event) { + var type = $(this).find('select[name$=type]').first(); + updateAction(type); + }); }
Fix handling of new action in a auth source rule
inverse-inc_packetfence
train
js
e6ceb4f2445c32d13681315b62214bb8dd428518
diff --git a/Str.php b/Str.php index <HASH>..<HASH> 100644 --- a/Str.php +++ b/Str.php @@ -360,20 +360,22 @@ class Str * * @param string $str The string over which to run the callable. * @param callable $callable The callable to apply. + * @param string $encoding The encoding to use. * @param mixed ...$args Additional arguments to pass to the callable. * @return string The string after applying the callable to each of its characters. */ - public static function eachCharacter(string $str, callable $callable, ...$args) : string + public static function eachCharacter(string $str, callable $callable, string $encoding = null, ...$args) : string { if ($str === '') { return $str; } - $result = []; - $length = mb_strlen($str); + $result = []; + $encoding = $encoding ?: static::encoding($str); + $length = mb_strlen($str, $encoding); for ($idx = 0; $idx < $length; $idx++) { - $result[] = (string) call_user_func($callable, mb_substr($str, $idx, 1), $idx, ...$args); + $result[] = (string) call_user_func($callable, mb_substr($str, $idx, 1, $encoding), $idx, ...$args); } return implode('', $result);
[Utils/Str] Added encoding option to Str::eachCharacter()
unyx_utils
train
php
158fafc3e52a8bc4eb395927f8858639be55628f
diff --git a/flask_mqtt/__init__.py b/flask_mqtt/__init__.py index <HASH>..<HASH> 100644 --- a/flask_mqtt/__init__.py +++ b/flask_mqtt/__init__.py @@ -147,9 +147,7 @@ class Mqtt(): if self.tls_insecure: self.client.tls_insecure_set(self.tls_insecure) - self.client.loop_start() - - res = self.client.connect( + res = self.client.connect_async( self.broker_url, self.broker_port, keepalive=self.keepalive ) @@ -163,6 +161,8 @@ class Mqtt(): "Could not connect to MQTT Broker, Error Code: {0}".format(res) ) + self.client.loop_start() + def _disconnect(self): # type: () -> None self.client.loop_stop()
MQTT: use connect_async (2)
stlehmann_Flask-MQTT
train
py
4e4fa90b1804afce2ebc11f75d7e965548d5513c
diff --git a/webapps/ui/tasklist/client/scripts/tasklist/directives/cam-tasklist-tasks.js b/webapps/ui/tasklist/client/scripts/tasklist/directives/cam-tasklist-tasks.js index <HASH>..<HASH> 100644 --- a/webapps/ui/tasklist/client/scripts/tasklist/directives/cam-tasklist-tasks.js +++ b/webapps/ui/tasklist/client/scripts/tasklist/directives/cam-tasklist-tasks.js @@ -144,7 +144,8 @@ module.exports = [function() { // Sachbearbeiter starts counting at '1' $scope.pageNum = ($scope.query.firstResult / $scope.pageSize) + 1; - if (oldQuery.id) { + // only clear the task if the filter changed + if (oldQuery.id && oldQuery.id !== taskListQuery.id) { clearSelectedTask(); } } else {
fix(cockpit): make task cleared only when filter changes Related to. CAM-<I>
camunda_camunda-bpm-platform
train
js
9b929eb6b36484b51095434d8a7a24a729a2876c
diff --git a/src/MetaModels/Filter/Setting/Simple.php b/src/MetaModels/Filter/Setting/Simple.php index <HASH>..<HASH> 100644 --- a/src/MetaModels/Filter/Setting/Simple.php +++ b/src/MetaModels/Filter/Setting/Simple.php @@ -268,6 +268,8 @@ abstract class Simple implements ISimple * @SuppressWarnings(PHPMD.UnusedFormalParameter) * @SuppressWarnings(PHPMD.Superglobals) * @SuppressWarnings(PHPMD.CamelCaseVariableName) + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) */ protected function prepareFrontendFilterOptions($arrWidget, $arrFilterUrl, $arrJumpTo, $blnAutoSubmit) { @@ -358,6 +360,8 @@ abstract class Simple implements ISimple * * @SuppressWarnings(PHPMD.Superglobals) * @SuppressWarnings(PHPMD.CamelCaseVariableName) + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) */ protected function prepareFrontendFilterWidget( $arrWidget,
Silence complexity warnings in simple filters
MetaModels_core
train
php