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
1edac1bfbe9e6acacc7af3f44470195046f18324
diff --git a/packages/server/lib/modes/run.js b/packages/server/lib/modes/run.js index <HASH>..<HASH> 100644 --- a/packages/server/lib/modes/run.js +++ b/packages/server/lib/modes/run.js @@ -660,6 +660,7 @@ const getVideoRecordingDelay = function (startedVideoCapture) { const maybeStartVideoRecording = Promise.method(function (options = {}) { const { spec, browser, video, videosFolder } = options + debug(`video recording has been ${video ? 'enabled' : 'disabled'}. video: %s`, video) // bail if we've been told not to capture // a video recording if (!video) {
Add more debug logs around whether they have video recording disabled (#<I>) * Add more debug logs around whether they have video recording disabled * clean up debug log :P
cypress-io_cypress
train
js
51222af2bf5fd1f3bbe7efb3e4e5d843371dddec
diff --git a/lib/oauth2server.js b/lib/oauth2server.js index <HASH>..<HASH> 100644 --- a/lib/oauth2server.js +++ b/lib/oauth2server.js @@ -48,7 +48,6 @@ function OAuth2Server (config) { this.refreshTokenLifetime = config.refreshTokenLifetime !== undefined ? config.refreshTokenLifetime : 1209600; this.authCodeLifetime = config.authCodeLifetime || 30; - this.now = new Date(); this.regex = {}; this.regex.clientId = config.clientIdRegex || /^[a-z0-9-_]{3,40}$/i; @@ -94,6 +93,7 @@ OAuth2Server.prototype.handler = function () { // Setup request params req.oauth = { internal: false }; + oauth.now = new Date; if (req.path === '/oauth/token') { req.oauth.internal = true;
Fix expiration checking. (follows 9baf<I> in <I>)
oauthjs_node-oauth2-server
train
js
5e4b3ff7786f2d6e1775f964d60caf42abe8add9
diff --git a/src/Auth/Manager.php b/src/Auth/Manager.php index <HASH>..<HASH> 100644 --- a/src/Auth/Manager.php +++ b/src/Auth/Manager.php @@ -33,6 +33,8 @@ class Manager extends Module { * @var \Phalcon\Security */ protected $security; + + protected $tokenElement; # attributes - aparently to be used in Phalcon\Validation\Validator::setOption() these have to be strings ... const ATTR_ENTITY = 'A10'; @@ -219,7 +221,7 @@ class Manager extends Module { } public function getTokenElement($forcenew = false) { - if ($forcenew || !$this->getSession()->has('$PHALCON/CSRF/KEY$')) { + if ($forcenew || is_null($this->tokenElement) || !$this->getSession()->has('$PHALCON/CSRF/KEY$')) { $this->tokenkey = $this->getSecurity()->getTokenKey(); $this->tokenval = $this->getSecurity()->getToken();
fixed minor bug where it was possible to reference an undefined property
logikostech_auth
train
php
1c703124c814cf91a0ae830ea8f91524018d32d1
diff --git a/src/flask_rq2/cli.py b/src/flask_rq2/cli.py index <HASH>..<HASH> 100644 --- a/src/flask_rq2/cli.py +++ b/src/flask_rq2/cli.py @@ -14,7 +14,7 @@ from rq.cli import cli as rq_cli try: from flask.cli import AppGroup, ScriptInfo -except ImportError: +except ImportError: # pragma: no cover try: from flask_cli import AppGroup, ScriptInfo except ImportError:
Ignore the ImportError of flask.cli in test coverage.
rq_Flask-RQ2
train
py
2caef7446fd3156fe581bdc12287d50b8483a765
diff --git a/tests/test_file_configuration.py b/tests/test_file_configuration.py index <HASH>..<HASH> 100644 --- a/tests/test_file_configuration.py +++ b/tests/test_file_configuration.py @@ -39,6 +39,24 @@ def test_file_configuration_from_string_local_variables_take_precedence( assert fconf.config['mark'] == 'just a mark' +def test_file_configuration_from_string_cannot_include_global_variables( + global_variables): + + local_variables = { + 'serializer': '__version__ = {{GLOBALS.serializer}}' + } + fconf = fc.FileConfiguration( + 'pkg/__init__.py', + local_variables, + global_variables + ) + + assert fconf.path == 'pkg/__init__.py' + assert fconf.config['serializer'] == \ + '__version__ = {{GLOBALS.serializer}}' + assert fconf.config['mark'] == 'just a mark' + + def test_file_conf_fr_str_path_cannot_be_overridden_by_global_variables( local_variables, global_variables): global_variables['path'] = 'a/new/path'
Added a test to check that GLOBAL variables are no more replaces in file configuration
lgiordani_punch
train
py
ada0f5fd7b0146d8d594044f35df160786c0b865
diff --git a/src/lib/widget/default.js b/src/lib/widget/default.js index <HASH>..<HASH> 100644 --- a/src/lib/widget/default.js +++ b/src/lib/widget/default.js @@ -75,6 +75,10 @@ define(['../util', '../assets', '../i18n'], function(util, assets, i18n) { var widgetOptions = {}; + function escape(s) { + return s.replace(/>/, '&gt;').replace(/</, '&lt;'); + } + function addEvent(element, eventName, handler) { browserEvents.push([element, eventName, handler]); element.addEventListener(eventName, handler); @@ -220,7 +224,8 @@ define(['../util', '../assets', '../i18n'], function(util, assets, i18n) { var trace = cEl('pre'); elements.bubble.appendChild(trace); if(error instanceof Error) { - trace.innerHTML = error.stack; + trace.innerHTML = '<strong>' + escape(error.message) + '</strong>' + + "\n" + escape(error.stack); } else if(typeof(error) === 'object') { trace.innerHTML = JSON.stringify(error, null, 2); } else {
fixed error trace in widget error-state
remotestorage_remotestorage.js
train
js
e0ed21a391437fbc3e2d9c01734ad69443f2258b
diff --git a/waterboy/api/model_config.py b/waterboy/api/model_config.py index <HASH>..<HASH> 100644 --- a/waterboy/api/model_config.py +++ b/waterboy/api/model_config.py @@ -76,6 +76,10 @@ class ModelConfig: """ Return data directory for given dataset """ return self.project_config.project_toplevel_dir(*args) + def openai_dir(self) -> str: + """ Return directory for openai output files for this model """ + return self.project_config.project_output_dir('openai', self.run_name) + #################################################################################################################### # NAME UTILITIES @property
Add OpenAI logging directory to the model config.
MillionIntegrals_vel
train
py
bf16b3e37a600b232dfc35401c18fbc67b82aabd
diff --git a/pylint/checkers/strings.py b/pylint/checkers/strings.py index <HASH>..<HASH> 100644 --- a/pylint/checkers/strings.py +++ b/pylint/checkers/strings.py @@ -341,9 +341,7 @@ class StringFormatChecker(BaseChecker): format_type)): self.add_message('bad-string-format-type', node=node, - args=(arg_type.pytype(), - format_type)) - # TODO: compare type + args=(arg_type.pytype(), format_type)) elif isinstance(args, OTHER_NODES + (astroid.Tuple,)): type_name = type(args).__name__ self.add_message('format-needs-mapping', @@ -381,9 +379,7 @@ class StringFormatChecker(BaseChecker): if (arg_type not in (None, astroid.Uninferable) and not arg_matches_format_type(arg_type, format_type)): self.add_message('bad-string-format-type', - node=node, - args=(arg_type.pytype(), - format_type)) + node=node, args=(arg_type.pytype(), format_type)) @check_messages(*(MSGS.keys()))
Remove extraneous comment and fix the style
PyCQA_pylint
train
py
a3aef7ec1eb51a85ee3854f7efedd7aa5ce0b484
diff --git a/sqlg-core/src/main/java/org/umlg/sqlg/step/SqlgVertexStep.java b/sqlg-core/src/main/java/org/umlg/sqlg/step/SqlgVertexStep.java index <HASH>..<HASH> 100644 --- a/sqlg-core/src/main/java/org/umlg/sqlg/step/SqlgVertexStep.java +++ b/sqlg-core/src/main/java/org/umlg/sqlg/step/SqlgVertexStep.java @@ -200,7 +200,6 @@ public class SqlgVertexStep<E extends SqlgElement> extends SqlgAbstractStep impl private void constructQueryPerSchemaTable() { for (SchemaTable schemaTable : this.heads.keySet()) { SchemaTableTree rootSchemaTableTree = parseForStrategy(schemaTable); - this.replacedStepTree.maybeAddLabelToLeafNodes(); //If the order is over multiple tables then the resultSet will be completely loaded into memory and then sorted. if (this.replacedStepTree.hasOrderBy()) { if (isForMultipleQueries() || !replacedStepTree.orderByIsOrder() || this.replacedStepTree.orderByHasSelectOneStepAndForLabelNotInTree()) {
remove not needed maybeAddLabelToLeafNode. It is already added in the VertexStrategy
pietermartin_sqlg
train
java
f8c3e41c0f6349583a98bf6e79290b111917f24f
diff --git a/lib/hippo/api/handlers/tenant.rb b/lib/hippo/api/handlers/tenant.rb index <HASH>..<HASH> 100644 --- a/lib/hippo/api/handlers/tenant.rb +++ b/lib/hippo/api/handlers/tenant.rb @@ -8,7 +8,7 @@ module Hippo::API::Handlers def update tenant = Hippo::Tenant.current - tenant.assign_attributes(data.slice(*PUBLIC_ATTRS)) + tenant.assign_attributes(data.slice(*Hippo::Tenant::PUBLIC_ATTRS)) success = tenant.save if success && tenant.slug_previously_changed? Hippo::Tenant.system.perform do @@ -16,7 +16,7 @@ module Hippo::API::Handlers end end std_api_reply(:update, tenant, - only: PUBLIC_ATTRS, + only: Hippo::Tenant::PUBLIC_ATTRS, success: success) end end
fix path to PUBLIC_ATTRS
argosity_hippo
train
rb
fa99df1c3ec7214d86fdf38b160b4fe812f7944a
diff --git a/lib/elasticsearch/drain/autoscaling.rb b/lib/elasticsearch/drain/autoscaling.rb index <HASH>..<HASH> 100644 --- a/lib/elasticsearch/drain/autoscaling.rb +++ b/lib/elasticsearch/drain/autoscaling.rb @@ -85,7 +85,7 @@ module Elasticsearch auto_scaling_group_name: asg, min_size: count ) - wait_until(0) do + wait_until(count) do min_size end end
Fixes resizing asg min_size This fixes resizing when we are not draining a whole asg.
rapid7_elasticsearch-drain
train
rb
44f7d195364aef52bb311e7420e8f7b59b2d7e5f
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ import sys, os -from distutils.core import setup, Extension +from setuptools import setup, Extension from subprocess import Popen, PIPE, check_output def call(*cmd):
setup.py: switch from distutils to setuptools In Python <I>, distutils is deprecated and slated for removal in Python <I>. It also prevents 'setup.py bdist_wheel' from building a wheel.
systemd_python-systemd
train
py
d787e74125b7c5fcd1d5f66a6a5585511973b385
diff --git a/contractcourt/channel_arbitrator.go b/contractcourt/channel_arbitrator.go index <HASH>..<HASH> 100644 --- a/contractcourt/channel_arbitrator.go +++ b/contractcourt/channel_arbitrator.go @@ -305,8 +305,6 @@ func (c *ChannelArbitrator) Stop() error { close(c.quit) c.wg.Wait() - c.cfg.BlockEpochs.Cancel() - return nil } @@ -1293,7 +1291,10 @@ func (c *ChannelArbitrator) UpdateContractSignals(newSignals *ContractSignals) { func (c *ChannelArbitrator) channelAttendant(bestHeight int32) { // TODO(roasbeef): tell top chain arb we're done - defer c.wg.Done() + defer func() { + c.cfg.BlockEpochs.Cancel() + c.wg.Done() + }() for { select {
contractcourt/channel_arbitrator: stop block epoch on channel attendant exit
lightningnetwork_lnd
train
go
e1671f631c3cca52aca5a987adb1fd97202a7e62
diff --git a/influx-line-format.go b/influx-line-format.go index <HASH>..<HASH> 100644 --- a/influx-line-format.go +++ b/influx-line-format.go @@ -1,7 +1,9 @@ package csv import ( + "fmt" "io" + "os" "sort" "strconv" "time" @@ -33,7 +35,9 @@ func (p *InfluxLineFormatProcess) Run(reader Reader, out io.Writer, errCh chan<- } else { maxLen := len(p.Measurement) + count := 1 for data := range reader.C() { + count++ stringTs := data.Get(p.Timestamp) if ts, err := time.ParseInLocation(p.Format, stringTs, location); err != nil { @@ -72,7 +76,9 @@ func (p *InfluxLineFormatProcess) Run(reader Reader, out io.Writer, errCh chan<- buffer = append(buffer, "="...) buffer = append(buffer, v...) } + if appended == 0 { + fmt.Fprintf(os.Stderr, "%d: dropping field-less point\n", count) continue }
be noisy if we drop a point because it has no values.
wildducktheories_go-csv
train
go
44b64dad760dea52d12a31123014b820a8e15793
diff --git a/apollo/client.py b/apollo/client.py index <HASH>..<HASH> 100644 --- a/apollo/client.py +++ b/apollo/client.py @@ -3,12 +3,10 @@ import json import requests import logging - try: from shlex import quote except ImportError: from pipes import quote - log = logging.getLogger()
Fix support for python <I> (2)
galaxy-genome-annotation_python-apollo
train
py
72e3104ae4ee2661743875dc7ed864944690e042
diff --git a/util/configv3/config.go b/util/configv3/config.go index <HASH>..<HASH> 100644 --- a/util/configv3/config.go +++ b/util/configv3/config.go @@ -233,15 +233,15 @@ func WriteConfig(c *Config) error { if err != nil { return err } + tempConfigFile.Close() + tempConfigFileName := tempConfigFile.Name() - go catchSignal(sig, tempConfigFile) + go catchSignal(sig, tempConfigFileName) - tempConfigFileName := tempConfigFile.Name() err = ioutil.WriteFile(tempConfigFileName, rawConfig, 0600) if err != nil { return err } - tempConfigFile.Close() return os.Rename(tempConfigFileName, ConfigFilePath()) } @@ -250,11 +250,10 @@ func WriteConfig(c *Config) error { // Interrupt for removing temporarily created config files before the program // ends. Note: we cannot intercept a `kill -9`, so a well-timed `kill -9` // will allow a temp config file to linger. -func catchSignal(sig chan os.Signal, tempConfigFile *os.File) { +func catchSignal(sig chan os.Signal, tempConfigFileName string) { select { case <-sig: - tempConfigFile.Close() - _ = os.Remove(tempConfigFile.Name()) + _ = os.Remove(tempConfigFileName) os.Exit(2) } }
close the file right away to prevent windows race conditions
cloudfoundry_cli
train
go
85ad36c9d771da248248f0ef670b3ed6bbf8740d
diff --git a/owner/src/main/java/org/aeonbits/owner/loaders/XMLLoader.java b/owner/src/main/java/org/aeonbits/owner/loaders/XMLLoader.java index <HASH>..<HASH> 100644 --- a/owner/src/main/java/org/aeonbits/owner/loaders/XMLLoader.java +++ b/owner/src/main/java/org/aeonbits/owner/loaders/XMLLoader.java @@ -33,7 +33,7 @@ import java.util.Stack; */ public class XMLLoader implements Loader { - private volatile SAXParserFactory factory = null; + private transient volatile SAXParserFactory factory = null; private SAXParserFactory factory() { if (factory == null) {
fixing serialization issue happening with some jdks
lviggiano_owner
train
java
e04058557205d59b8006d3f3b8deef6799de418b
diff --git a/pyfritzhome/errors.py b/pyfritzhome/errors.py index <HASH>..<HASH> 100644 --- a/pyfritzhome/errors.py +++ b/pyfritzhome/errors.py @@ -7,6 +7,3 @@ class LoginError(Exception): class InvalidError(Exception): pass - -class NotImplemented(Exception): - pass
remove redfine of built-in exception
hthiery_python-fritzhome
train
py
52ea1a6aa15b3f336e33986c35bcf084fcee4d47
diff --git a/lib/request.js b/lib/request.js index <HASH>..<HASH> 100644 --- a/lib/request.js +++ b/lib/request.js @@ -3,6 +3,7 @@ const { XMLHttpRequest } = require('xmlhttprequest'); function Response (request, sourceUrl) { this.request = request; + this.status = request.status; this.content = request.responseText; this.json = function () { return JSON.parse(this.content);
Response.status added from request.status XHR obj
smappi_smappi-cl
train
js
6dbde83f5ed1449b27770517612ff4e4e4b00cc0
diff --git a/vraptor-core/src/main/java/br/com/caelum/vraptor/ioc/cdi/ListProducer.java b/vraptor-core/src/main/java/br/com/caelum/vraptor/ioc/cdi/ListProducer.java index <HASH>..<HASH> 100644 --- a/vraptor-core/src/main/java/br/com/caelum/vraptor/ioc/cdi/ListProducer.java +++ b/vraptor-core/src/main/java/br/com/caelum/vraptor/ioc/cdi/ListProducer.java @@ -11,8 +11,11 @@ import javax.enterprise.inject.spi.BeanManager; import javax.enterprise.inject.spi.CDI; import javax.enterprise.inject.spi.InjectionPoint; +/** + * @deprecated This class will be deleted very soon + */ public class ListProducer { - + @SuppressWarnings({ "rawtypes", "unchecked" }) @Produces public <T> List<T> producesList(InjectionPoint injectionPoint){ @@ -22,9 +25,9 @@ public class ListProducer { BeanManager beanManager = currentCDI.getBeanManager(); Set<Bean<?>> beans = beanManager.getBeans(klass); ArrayList objects = new ArrayList(); - for (Bean<?> bean : beans) { + for (Bean<?> bean : beans) { objects.add(currentCDI.select(bean.getBeanClass()).get()); } return objects; } -} +} \ No newline at end of file
deprecating ListProducer for now
caelum_vraptor4
train
java
258a56b473edea843eb20e80bbc7bf49eb040a32
diff --git a/site/assets/js/search.js b/site/assets/js/search.js index <HASH>..<HASH> 100644 --- a/site/assets/js/search.js +++ b/site/assets/js/search.js @@ -40,7 +40,7 @@ // When in production, return the result as is, // otherwise remove our url from it. // eslint-disable-next-line no-negated-condition - hit.url = currentUrl.indexOf(liveUrl) !== -1 ? + hit.url = currentUrl.indexOf(liveUrl) !== -1 ? // lgtm [js/incomplete-url-substring-sanitization] hit.url : hit.url.replace(liveUrl, '')
site/assets/js/search.js: ignore the LGTM alert (#<I>)
twbs_bootstrap
train
js
e7416b630855614410058ae3e6ae006d3fc0b385
diff --git a/packages/lib/test/application/management/PackagedAppManager.test.js b/packages/lib/test/application/management/PackagedAppManager.test.js index <HASH>..<HASH> 100644 --- a/packages/lib/test/application/management/PackagedAppManager.test.js +++ b/packages/lib/test/application/management/PackagedAppManager.test.js @@ -28,6 +28,12 @@ contract('PackagedAppManager', ([_, managerOwner, packageOwner, directoryOwner, this.firstVersionDirectory = await ContractDirectory.new({ from: directoryOwner }) }) + describe('when the package address is null', function () { + it('reverts', async function () { + await assertRevert(PackagedAppManager.new(0, 'dummy', this.factory.address)) + }) + }) + describe('when the given package does not support the required version', function () { it('reverts', async function () { await assertRevert(PackagedAppManager.new(this.package.address, version_0, this.factory.address, { from: managerOwner }))
tests: add test for PackagedAppManager with null address
zeppelinos_zos
train
js
5f94effa7969c4d1d71d7ddcbf6902b4b1c1e780
diff --git a/js/bootstrap-select.js b/js/bootstrap-select.js index <HASH>..<HASH> 100644 --- a/js/bootstrap-select.js +++ b/js/bootstrap-select.js @@ -2548,6 +2548,10 @@ ) ) { that.$button.trigger('click.bs.dropdown.data-api'); + + if (that.options.liveSearch) { + return; + } } if (e.which === keyCodes.ESCAPE && isActive) {
auto-fill live search when button is focused and a character is typed (fixes regression introduced in <I>) (#<I>)
snapappointments_bootstrap-select
train
js
4307c3438e11ce72e6cac21c9daecbadb3bcf676
diff --git a/src/core.js b/src/core.js index <HASH>..<HASH> 100644 --- a/src/core.js +++ b/src/core.js @@ -229,7 +229,7 @@ $.fn.powerTip.showHide = function(element, event) { * @param {jQuery.Event=} event jQuery event. */ $.fn.powerTip.show = function(element, event) { - if (event.pageX) { + if (typeof event.pageX === 'number') { // for mouse events, pass event to show (for hover intent and mouse tracking) $.powerTip.show(element, event); } else {
Changed mouse-event check to use typeof. Although unlikely in the real world, it is possible for event.pageX to be 0. Related to pull request #<I>.
stevenbenner_jquery-powertip
train
js
1e9806950d95b8b62c72bf498c6747543b39eb92
diff --git a/salt/cache/__init__.py b/salt/cache/__init__.py index <HASH>..<HASH> 100644 --- a/salt/cache/__init__.py +++ b/salt/cache/__init__.py @@ -2,12 +2,15 @@ ''' Loader mechanism for caching data, with data expirations, etc. -.. versionadded:: carbon +.. versionadded:: Carbon ''' + +# Import Python libs from __future__ import absolute_import -import os -import salt.loader import time + +# Import Salt lobs +import salt.loader from salt.payload import Serial
Clean up imports in salt/cache/__init__.py the 'os' import is not used, and splitting them out into python vs. salt imports makes them easier to read and more consistent with other salt files
saltstack_salt
train
py
bd86a0faf6367edfd754760b67d3f1f2918aaa35
diff --git a/werkzeug/http.py b/werkzeug/http.py index <HASH>..<HASH> 100644 --- a/werkzeug/http.py +++ b/werkzeug/http.py @@ -91,6 +91,8 @@ def quote_header_value(value, extra_chars='', allow_token=True): :param allow_token: if this is enabled token values are returned unchanged. """ + if isinstance(value, bytes): + value = bytes_to_wsgi(value) value = str(value) if allow_token: token_chars = _token_chars | set(extra_chars) @@ -819,6 +821,7 @@ def dump_cookie(key, value='', max_age=None, expires=None, path='/', raise TypeError('invalid key %r' % key) if isinstance(value, text_type): value = value.encode(charset) + value = quote_header_value(value) morsel = _ExtendedMorsel(key, value) if isinstance(max_age, timedelta):
ensure cookie dumping works on py3
pallets_werkzeug
train
py
599c0fe2f079a7442c64b7e7a29c7d63df5bc01b
diff --git a/apigateway.go b/apigateway.go index <HASH>..<HASH> 100644 --- a/apigateway.go +++ b/apigateway.go @@ -758,6 +758,12 @@ func (resource *Resource) NewMethod(httpMethod string, defaultHTTPStatusCode int, possibleHTTPStatusCodeResponses ...int) (*Method, error) { + if OptionsGlobal.Logger != nil && len(possibleHTTPStatusCodeResponses) != 0 { + OptionsGlobal.Logger.WithFields(logrus.Fields{ + "possibleHTTPStatusCodeResponses": possibleHTTPStatusCodeResponses, + }).Debug("The set of all HTTP status codes is no longer required for NewMethod(...). Any valid HTTP status code can be returned starting with v1.8.0.") + } + // http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-method-settings.html#how-to-method-settings-console keyname := httpMethod existingMethod, exists := resource.Methods[keyname]
Add log message about not needing to supply all the status codes.
mweagle_Sparta
train
go
234356101af693f5f8728e1be4bc2a2db5ba797d
diff --git a/lib/onebox/engine/youtube_onebox.rb b/lib/onebox/engine/youtube_onebox.rb index <HASH>..<HASH> 100644 --- a/lib/onebox/engine/youtube_onebox.rb +++ b/lib/onebox/engine/youtube_onebox.rb @@ -28,6 +28,8 @@ module Onebox end nil + rescue + return nil end def placeholder_html @@ -70,6 +72,7 @@ module Onebox elsif params['t'] start = params['t'] elsif uri.fragment && uri.fragment.start_with?('t=') + # referencing uri is safe here because any throws were already caught by video_id returning nil # remove the t= from the start start = uri.fragment[2..-1] end @@ -99,11 +102,11 @@ module Onebox (h * 60 * 60) + (m * 60) + s else - puts 'warning - nil from parse_timestring' nil end end + # Note: May throw! Make sure to recue. def uri @_uri ||= URI(@url) end @@ -123,6 +126,8 @@ module Onebox end params end + rescue + return {} end end
Make sure that no URI parsing exceptions are leaked
discourse_onebox
train
rb
700976067f40d5b20b6aec497dca1abae30d8ff5
diff --git a/de.tudarmstadt.ukp.wikipedia.api/src/test/java/de/tudarmstadt/ukp/wikipedia/api/PageTest.java b/de.tudarmstadt.ukp.wikipedia.api/src/test/java/de/tudarmstadt/ukp/wikipedia/api/PageTest.java index <HASH>..<HASH> 100644 --- a/de.tudarmstadt.ukp.wikipedia.api/src/test/java/de/tudarmstadt/ukp/wikipedia/api/PageTest.java +++ b/de.tudarmstadt.ukp.wikipedia.api/src/test/java/de/tudarmstadt/ukp/wikipedia/api/PageTest.java @@ -86,9 +86,9 @@ public class PageTest { fail("A WikiApiException occured while getting the page " + title); } - String text = "Wikipedia API ist die wichtigste Software überhaupt. Wikipedia API."+LF+ - "Nicht zu übertreffen."+LF+"Unglaublich"+LF+"http://www.ukp.tu-darmstadt.de"+LF+"en:Wikipedia API fi:WikipediaAPI"; + String text = "Wikipedia API ist die wichtigste Software überhaupt. Wikipedia API.\nNicht zu übertreffen.\nUnglaublich\nhttp://www.ukp.tu-darmstadt.de\nen:Wikipedia API fi:WikipediaAPI"; + try{ assertEquals(text, p.getPlainText()); }catch(Exception e){
Fixed testPlainText to work system independently (no line.separator property in assertions)
dkpro_dkpro-jwpl
train
java
0586607409c6ef3a0b2072e718828754e9ca7988
diff --git a/bakery/management/commands/publish.py b/bakery/management/commands/publish.py index <HASH>..<HASH> 100644 --- a/bakery/management/commands/publish.py +++ b/bakery/management/commands/publish.py @@ -156,7 +156,7 @@ in settings.py or provide it with --aws-bucket-name" return files_list - def sync_s3(self, dirname, names): + def sync_s3(self): """ Walk through our local file list, and match them wtih the list of keys in the S3 bucket. @@ -216,9 +216,7 @@ in settings.py or provide it with --aws-bucket-name" self.local_files = self.build_local_files_list() - # walk through the build directory - # for (dirpath, dirnames, filenames) in os.walk(self.build_dir): - # self.sync_s3(dirpath, filenames) + self.sync_s3() # delete anything that's left in our keys dict for key in self.keys:
great way to delete all files is to never call the sync_s3 command
datadesk_django-bakery
train
py
53819df4955b2e3f5f92c10afb4a651584e4f1c8
diff --git a/src/stateManagement/imageIdSpecificStateManager.js b/src/stateManagement/imageIdSpecificStateManager.js index <HASH>..<HASH> 100755 --- a/src/stateManagement/imageIdSpecificStateManager.js +++ b/src/stateManagement/imageIdSpecificStateManager.js @@ -36,12 +36,14 @@ function newImageIdSpecificToolStateManager() { // As modules that restore saved state function addImageIdSpecificToolState(element, toolType, data) { const enabledElement = external.cornerstone.getEnabledElement(element); - // If we don't have any tool state for this imageId, add an empty object - if ( - !enabledElement.image || - toolState.hasOwnProperty(enabledElement.image.imageId) === false - ) { + // If we don't have an image for this element exit early + if (!enabledElement.image) { + return; + } + + // If we don't have any tool state for this imageId, add an empty object + if (toolState.hasOwnProperty(enabledElement.image.imageId) === false) { toolState[enabledElement.image.imageId] = {}; }
re-implements the imageIdSpecificStateManager.add bugfix
cornerstonejs_cornerstoneTools
train
js
1b9da369742cba770be9ef914e7b8190b34ad893
diff --git a/tests.py b/tests.py index <HASH>..<HASH> 100644 --- a/tests.py +++ b/tests.py @@ -1292,6 +1292,14 @@ class TestCheckManifest(unittest.TestCase): self.assertEqual(str(cm.exception), "This is not a Python project (no setup.py).") + def test_forgot_to_git_add_anything(self): + from check_manifest import check_manifest, Failure + self._create_repo_with_code(add_to_vcs=False) + with self.assertRaises(Failure) as cm: + check_manifest() + self.assertEqual(str(cm.exception), + "There are no files added to version control!") + def test_all_is_well(self): from check_manifest import check_manifest self._create_repo_with_code()
Test coverage for empty VCS repo case
mgedmin_check-manifest
train
py
ff9de5f1f2f7f6846cb46007c98880cadd185766
diff --git a/reana_commons/snakemake.py b/reana_commons/snakemake.py index <HASH>..<HASH> 100644 --- a/reana_commons/snakemake.py +++ b/reana_commons/snakemake.py @@ -73,6 +73,7 @@ def snakemake_load(workflow_file, **kwargs): "environment": rule._container_img.replace("docker://", ""), "inputs": dict(rule._input), "params": dict(rule._params), + "outputs": dict(rule._output), "commands": [rule.shellcmd], } for rule in snakemake_workflow.rules
snakemake: include outputs in workflow representation closes reanahub/reana-client#<I>
reanahub_reana-commons
train
py
47a4371fea4427ecf362409acbc4b6b7f8565dfd
diff --git a/tests/test_tokenizer.py b/tests/test_tokenizer.py index <HASH>..<HASH> 100644 --- a/tests/test_tokenizer.py +++ b/tests/test_tokenizer.py @@ -119,6 +119,13 @@ def test_bracket_period(EN): tokens = EN(text) assert tokens[len(tokens) - 1].orth_ == u'.' + +def test_ie(EN): + text = u"It's mediocre i.e. bad." + tokens = EN(text) + assert len(tokens) == 6 + assert tokens[3].orth_ == "i.e." + #def test_cnts7(): # text = 'But then the 6,000-year ice age came...' # tokens = EN.tokenize(text)
* Upd tokenizer with i.e. tests
explosion_spaCy
train
py
652eaee3521e99c1f1dbba8d310baec050231548
diff --git a/public/js/utils/source-map-worker.js b/public/js/utils/source-map-worker.js index <HASH>..<HASH> 100644 --- a/public/js/utils/source-map-worker.js +++ b/public/js/utils/source-map-worker.js @@ -82,7 +82,7 @@ function getOriginalTexts(generatedSource, generatedText) { function getOriginalSourcePosition(generatedSource, { column, line }) { const consumer = _getConsumer(generatedSource.id); - // if there is not a consumer, then its a generated source without a map + // if there is not a consumer, then it's a generated source without a map if (!consumer) { return { url: generatedSource.url,
its to it's in source-map-worker.js comment
firefox-devtools_debugger
train
js
8752c50ad1282d86cad473c332773ecc58107cc2
diff --git a/sos/plugins/logrotate.py b/sos/plugins/logrotate.py index <HASH>..<HASH> 100644 --- a/sos/plugins/logrotate.py +++ b/sos/plugins/logrotate.py @@ -24,6 +24,7 @@ class LogRotate(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): self.add_copy_spec([ "/etc/logrotate*", "/var/lib/logrotate.status", + "/var/lib/logrotate/logrotate.status", self.var_puppet_gen + "/etc/logrotate-crond.conf", self.var_puppet_gen + "/var/spool/cron/root" ])
[logrotate] fix path for logrotate.status in RHEL7/CentOS7 In RHEL7/CentOS7 logrotate.status is placed in /var/lib/logrotate rather then directly in /var/lib. Resolves: #<I>
sosreport_sos
train
py
a902a34b9f066111deaa420c94d79f1f10d944ee
diff --git a/presto-main/src/main/java/com/facebook/presto/operator/repartition/OptimizedPartitionedOutputOperator.java b/presto-main/src/main/java/com/facebook/presto/operator/repartition/OptimizedPartitionedOutputOperator.java index <HASH>..<HASH> 100644 --- a/presto-main/src/main/java/com/facebook/presto/operator/repartition/OptimizedPartitionedOutputOperator.java +++ b/presto-main/src/main/java/com/facebook/presto/operator/repartition/OptimizedPartitionedOutputOperator.java @@ -618,10 +618,11 @@ public class OptimizedPartitionedOutputOperator { // Create buffers has to be done after seeing the first page. if (blockEncodingBuffers == null) { - blockEncodingBuffers = new BlockEncodingBuffer[channelCount]; + BlockEncodingBuffer[] buffers = new BlockEncodingBuffer[channelCount]; for (int i = 0; i < channelCount; i++) { - blockEncodingBuffers[i] = createBlockEncodingBuffers(decodedBlocks[i]); + buffers[i] = createBlockEncodingBuffers(decodedBlocks[i]); } + blockEncodingBuffers = buffers; } }
Harden blockEncodingBuffers in OptimizedPartitionedOutputOperator
prestodb_presto
train
java
535eb92b84e79e3b548c70231f2d13b8d10e6eb1
diff --git a/pkg/node/manager.go b/pkg/node/manager.go index <HASH>..<HASH> 100644 --- a/pkg/node/manager.go +++ b/pkg/node/manager.go @@ -25,6 +25,7 @@ import ( "github.com/cilium/cilium/pkg/logging" "github.com/cilium/cilium/pkg/logging/logfields" "github.com/cilium/cilium/pkg/maps/tunnel" + "github.com/cilium/cilium/pkg/mtu" "github.com/sirupsen/logrus" "github.com/vishvananda/netlink" @@ -191,6 +192,12 @@ func replaceNodeRoute(ip *net.IPNet) { } route := netlink.Route{LinkIndex: link.Attrs().Index, Dst: ip, Gw: via, Src: local} + // If the route includes the local address, then the route is for + // local containers and we can use a high MTU for transmit. Otherwise, + // it needs to be able to fit within the MTU of tunnel devices. + if !ip.Contains(local) { + route.MTU = mtu.TunnelMTU + } scopedLog := log.WithField(logfields.Route, route) if err := netlink.RouteReplace(&route); err != nil {
node: Configure route MTUs depending on destination Configure MTU for routes such that routes to local destinations will have MTU <I>, whereas routes to other nodes use the tunnel MTU.
cilium_cilium
train
go
2489677c2aae56b309286be131746f704172f5c4
diff --git a/lib/librarian/chef/source/site.rb b/lib/librarian/chef/source/site.rb index <HASH>..<HASH> 100644 --- a/lib/librarian/chef/source/site.rb +++ b/lib/librarian/chef/source/site.rb @@ -207,9 +207,15 @@ module Librarian dependency_cache_path.mkpath metadata_cache_path = metadata_cache_path(dependency) unless metadata_cache_path.exist? - dep_uri = dependency_uri(dependency) + dep_uri = URI.parse(dependency_uri(dependency)) debug { "Caching #{dep_uri}" } - metadata_blob = Net::HTTP.get(URI.parse(dep_uri)) + http = Net::HTTP.new(dep_uri.host, dep_uri.port) + request = Net::HTTP::Get.new(dep_uri.path) + response = http.start{|http| http.request(request)} + unless Net::HTTPSuccess === response + raise Error, "Could not cache #{dependency} from #{dep_uri} because #{response.code} #{response.message}!" + end + metadata_blob = response.body JSON.parse(metadata_blob) # check that it's JSON metadata_cache_path(dependency).open('wb') do |f| f.write(metadata_blob)
A little bit of handling in case the chef site source can't find a dependency.
applicationsonline_librarian
train
rb
a090076323955cc24894deba59a3f0faf3868809
diff --git a/cloudvolume/datasource/graphene/mesh/sharded.py b/cloudvolume/datasource/graphene/mesh/sharded.py index <HASH>..<HASH> 100644 --- a/cloudvolume/datasource/graphene/mesh/sharded.py +++ b/cloudvolume/datasource/graphene/mesh/sharded.py @@ -149,13 +149,9 @@ class GrapheneShardedMeshSource(GrapheneUnshardedMeshSource): filenames = self.get_fragment_filenames(seg_id, level=level, bbox=bounding_box) lists = self.parse_manifest_filenames(filenames) - files = [] + meshes = [] if lists['dynamic']: - files = CloudFiles(dynamic_cloudpath, green=self.config.green).get(lists['dynamic']) - - meshes = [ - f['content'] for f in files - ] + meshes = CloudFiles(dynamic_cloudpath, green=self.config.green).get(lists['dynamic']) fetches = [] for layer_id, filename, byte_start, size in lists['initial']: @@ -166,7 +162,6 @@ class GrapheneShardedMeshSource(GrapheneUnshardedMeshSource): }) cloudpath = self.meta.join(self.meta.meta.cloudpath, self.meta.mesh_path, 'initial') - raw_binaries = [] initial_meshes = CloudFiles(cloudpath, green=self.config.green).get(fetches) meshes += initial_meshes
fix: incompatibility between inital and dynamic meshes (#<I>)
seung-lab_cloud-volume
train
py
933df911bcdcb20aabd866dbfded3b4550315042
diff --git a/src/main/java/com/sonymobile/tools/gerrit/gerritevents/dto/events/RefReplicated.java b/src/main/java/com/sonymobile/tools/gerrit/gerritevents/dto/events/RefReplicated.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/sonymobile/tools/gerrit/gerritevents/dto/events/RefReplicated.java +++ b/src/main/java/com/sonymobile/tools/gerrit/gerritevents/dto/events/RefReplicated.java @@ -40,6 +40,15 @@ import com.sonymobile.tools.gerrit.gerritevents.dto.GerritEventType; public class RefReplicated extends GerritTriggeredEvent { /** + * Replication failed status. + */ + public static final String FAILED_STATUS = "failed"; + /** + * Replication succeeded status. + */ + public static final String SUCCEEDED_STATUS = "succeeded"; + + /** * Project path in Gerrit. */ private String project;
Added lost RefReplicated constants
sonyxperiadev_gerrit-events
train
java
764a2799ef673de7df329ba1fad67f6ed1127d70
diff --git a/lib/proinsias/version.rb b/lib/proinsias/version.rb index <HASH>..<HASH> 100644 --- a/lib/proinsias/version.rb +++ b/lib/proinsias/version.rb @@ -1,3 +1,3 @@ module Proinsias - VERSION = "0.5.0" + VERSION = "0.6.0" end
Bump proinsias to <I>
elclavijero_proinsias
train
rb
4dfe10cfa45ee4a5adb5120b2f9f8d51a610f5cf
diff --git a/benchmark/benchmark.rb b/benchmark/benchmark.rb index <HASH>..<HASH> 100755 --- a/benchmark/benchmark.rb +++ b/benchmark/benchmark.rb @@ -18,7 +18,7 @@ def compare_scrub_methods puts Loofah.scrub_fragment(snip, :escape).to_s puts "--" puts HTMLFilter.new.filter(snip) - puts Loofah::Helpers.sanitize(snip) + puts Loofah.scrub_fragment(snip, :strip).to_s puts end diff --git a/benchmark/helper.rb b/benchmark/helper.rb index <HASH>..<HASH> 100644 --- a/benchmark/helper.rb +++ b/benchmark/helper.rb @@ -9,6 +9,10 @@ require "sanitize" require 'hitimes' require 'htmlfilter' +unless defined?(HTMLFilter) + HTMLFilter = HtmlFilter +end + class RailsSanitize include ActionView::Helpers::SanitizeHelper extend ActionView::Helpers::SanitizeHelper::ClassMethods
fixing trans's commit to work with the current gem class names.
flavorjones_loofah-activerecord
train
rb,rb
d1d17314b2280b20fc4a825e68987b77ac989c53
diff --git a/pylast/__init__.py b/pylast/__init__.py index <HASH>..<HASH> 100644 --- a/pylast/__init__.py +++ b/pylast/__init__.py @@ -98,12 +98,11 @@ DOMAIN_RUSSIAN = 9 DOMAIN_JAPANESE = 10 DOMAIN_CHINESE = 11 -# COVER_X is deprecated since 2.1.0 and will be removed in a future version -SIZE_SMALL = COVER_SMALL = 0 -SIZE_MEDIUM = COVER_MEDIUM = 1 -SIZE_LARGE = COVER_LARGE = 2 -SIZE_EXTRA_LARGE = COVER_EXTRA_LARGE = 3 -SIZE_MEGA = COVER_MEGA = 4 +SIZE_SMALL = 0 +SIZE_MEDIUM = 1 +SIZE_LARGE = 2 +SIZE_EXTRA_LARGE = 3 +SIZE_MEGA = 4 IMAGES_ORDER_POPULARITY = "popularity" IMAGES_ORDER_DATE = "dateadded"
Remove deprecated COVER_X constants
pylast_pylast
train
py
ae210b0add74e75238589028c1f8b89a1bc30c71
diff --git a/src/Graviton/RestBundle/Listener/ValidationRequestListener.php b/src/Graviton/RestBundle/Listener/ValidationRequestListener.php index <HASH>..<HASH> 100644 --- a/src/Graviton/RestBundle/Listener/ValidationRequestListener.php +++ b/src/Graviton/RestBundle/Listener/ValidationRequestListener.php @@ -54,7 +54,8 @@ class ValidationRequestListener // if PATCH is required, refactor the method or do something else $request = $event->getRequest(); - if (empty($request->getContent())) { + $content = $request->getContent(); + if (empty($content)) { $isJson = true; } else { $isJson = strtolower(substr($request->headers->get('content-type'), 0, 16)) == 'application/json'; @@ -63,7 +64,6 @@ class ValidationRequestListener $controller = $event->getController(); // Moved this from RestController to ValidationListener (don't know if necessary) - $content = $request->getContent(); if (is_resource($content)) { throw new \LogicException('unexpected resource in validation'); }
Smallish php<I> refactor This one also make the code a bit more concise so I'm happy with it. There are probably other cases where I'll be to lazy to touch anything.
libgraviton_graviton
train
php
dd7589bdafde48b1cb10b8f813e72eb43a217cb6
diff --git a/blockservice/blockservice.go b/blockservice/blockservice.go index <HASH>..<HASH> 100644 --- a/blockservice/blockservice.go +++ b/blockservice/blockservice.go @@ -78,6 +78,8 @@ func (bs *blockService) Exchange() exchange.Interface { return bs.exchange } +// NewSession creates a bitswap session that allows for controlled exchange of +// wantlists to decrease the bandwidth overhead. func NewSession(ctx context.Context, bs BlockService) *Session { exchange := bs.Exchange() if bswap, ok := exchange.(*bitswap.Bitswap); ok { diff --git a/exchange/bitswap/wantlist/wantlist.go b/exchange/bitswap/wantlist/wantlist.go index <HASH>..<HASH> 100644 --- a/exchange/bitswap/wantlist/wantlist.go +++ b/exchange/bitswap/wantlist/wantlist.go @@ -79,6 +79,7 @@ func (w *ThreadSafe) Add(c *cid.Cid, priority int, ses uint64) bool { return true } +// AddEntry adds given Entry to the wantlist. For more information see Add method. func (w *ThreadSafe) AddEntry(e *Entry, ses uint64) bool { w.lk.Lock() defer w.lk.Unlock()
bitswap: add few method comments License: MIT
ipfs_go-ipfs
train
go,go
28891a9fdc4e7b9b5e94705c94c84af0912c7d17
diff --git a/config/projects/chefdk.rb b/config/projects/chefdk.rb index <HASH>..<HASH> 100644 --- a/config/projects/chefdk.rb +++ b/config/projects/chefdk.rb @@ -34,6 +34,18 @@ else install_dir "#{default_root}/#{name}" end +# As of 27 October 2014, the newest CA cert bundle does not work with AWS's +# root cert. See: +# * https://github.com/opscode/chef-dk/issues/199 +# * https://blog.mozilla.org/security/2014/09/08/phasing-out-certificates-with-1024-bit-rsa-keys/ +# * https://forums.aws.amazon.com/thread.jspa?threadID=164095 +# * https://github.com/opscode/omnibus-supermarket/commit/89197026af2931de82cfdc13d92ca2230cced3b6 +# +# For now we resolve it by using an older version of the cert. This only works +# if you have this version of the CA bundle stored via S3 caching (which Chef +# Software does). +override :cacerts, version: '2014.08.20' + override :berkshelf, version: "v3.1.5" override :bundler, version: "1.7.2" override :chef, version: "11.16.0"
Use an older version of CA certs to fix S3 cert checks AWS Certificate cannot be verified by the latest version of the CA bundle, lock to an older one that works until either AWS or the CA bundle fixes the issue.
chef_chef
train
rb
deb0a07b46d29718e79080d715ece64096282cc7
diff --git a/lib/calculated_attributes.rb b/lib/calculated_attributes.rb index <HASH>..<HASH> 100644 --- a/lib/calculated_attributes.rb +++ b/lib/calculated_attributes.rb @@ -6,9 +6,10 @@ require 'calculated_attributes/rails_patches' require 'calculated_attributes/arel_patches' raise "Unsupported ActiveRecord version: #{ActiveRecord::VERSION::MAJOR}" unless [3, 4, 5, 6].include? ActiveRecord::VERSION::MAJOR -# Rails 5.2 has its own patches which are different from 5.0/5.1. In every other +# Rails 5.2 has its own patches which are different from 5.0. In every other # case, just require the patch file for the major version. -if Gem::Version.new(ActiveRecord::VERSION::STRING).canonical_segments.take(2) == [5, 2] +versions = Gem::Version.new(ActiveRecord::VERSION::STRING).canonical_segments.take(2) +if versions == [5, 2] || versions == [5, 1] require 'calculated_attributes/rails_5_2_patches' else require "calculated_attributes/rails_#{ActiveRecord::VERSION::MAJOR}_patches"
Update to support <I> The change was back ported to <I> <URL>
aha-app_calculated_attributes
train
rb
c60fcf1dda08c3cfda89e1465e436b83bc365614
diff --git a/bcloud/CloudPage.py b/bcloud/CloudPage.py index <HASH>..<HASH> 100644 --- a/bcloud/CloudPage.py +++ b/bcloud/CloudPage.py @@ -237,6 +237,7 @@ class CloudPage(Gtk.Box): def add_local_bt_task(self): '''从本地上传种子到服务器, 再创建离线下载任务''' self.check_first() + print('Local BT task not supported right now.') # Open API def add_link_task(self): @@ -268,7 +269,7 @@ class CloudPage(Gtk.Box): if response != Gtk.ResponseType.OK or not len(source_url): return - if source_url.startswith('magent'): + if source_url.startswith('magnet'): self.add_cloud_bt_task(source_url) return diff --git a/bcloud/VCodeDialog.py b/bcloud/VCodeDialog.py index <HASH>..<HASH> 100644 --- a/bcloud/VCodeDialog.py +++ b/bcloud/VCodeDialog.py @@ -3,6 +3,7 @@ # Use of this source code is governed by GPLv3 license that can be found # in http://www.gnu.org/licenses/gpl-3.0.html +import os from gi.repository import Gtk
Show file chooser dialog when downloading magnet files
XuShaohua_bcloud
train
py,py
3faa957f3267fe901301270bcbc121a7426c5a90
diff --git a/jquery.geocomplete.js b/jquery.geocomplete.js index <HASH>..<HASH> 100644 --- a/jquery.geocomplete.js +++ b/jquery.geocomplete.js @@ -116,6 +116,12 @@ 'click', $.proxy(this.mapClicked, this) ); + + google.maps.event.addListener( + this.map, + 'zoom_changed', + $.proxy(this.mapZoomed, this) + ); }, // Add a marker with the provided `markerOptions` but only @@ -423,6 +429,10 @@ this.trigger("geocode:click", event.latLng); }, + mapZoomed: function(event) { + this.trigger("geocode:zoom", this.map.getZoom()); + }, + // Restore the old position of the marker to the last now location. resetMarker: function(){ this.marker.setPosition(this.data.location);
zoom_changed event support listen on zoom_changed event and trigger geocoder:zoom with the new zoom level
ubilabs_geocomplete
train
js
8475ea70664a86ac8c46897207f1e80c0b1e8b6d
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,12 @@ class build_ext(_build_ext): # see http://stackoverflow.com/q/19919905 for explanation def finalize_options(self): _build_ext.finalize_options(self) - __builtins__.__NUMPY_SETUP__ = False + # __builtins__ is a dict when this module isn't __main__ + # see https://docs.python.org/2/reference/executionmodel.html + if isinstance(__builtins__, dict): + __builtins__['__NUMPY_SETUP__'] = False + else: + __builtins__.__NUMPY_SETUP__ = False import numpy as np self.include_dirs.append(np.get_include())
handle setup.py edge case where it's not run as __main__ <URL>
HIPS_autograd
train
py
28d19f30fc9c96687596255b0cb7ff6c7e472946
diff --git a/src/test/java/org/jooq/lambda/SeqTest.java b/src/test/java/org/jooq/lambda/SeqTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/jooq/lambda/SeqTest.java +++ b/src/test/java/org/jooq/lambda/SeqTest.java @@ -20,8 +20,8 @@ import static java.util.Comparator.comparing; import static java.util.stream.Collectors.counting; import static java.util.stream.Collectors.groupingBy; import static java.util.stream.Collectors.joining; -import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.mapping; +import static java.util.stream.Collectors.toList; import static org.hamcrest.CoreMatchers.hasItems; import static org.jooq.lambda.Utils.assertThrows; import static org.jooq.lambda.tuple.Tuple.collectors; @@ -79,7 +79,7 @@ public class SeqTest { } @Test - public void testTheSameBehaviorAsGroupBy() throws Exception { + public void testGroupedSameBehaviorAsGroupBy() throws Exception { Random r = new Random(System.nanoTime()); int runs = r.nextInt(127) + 1; for (int i = 0; i < runs; i++) {
[#<I>] Rename test of the "grouped" category
jOOQ_jOOL
train
java
412e64613c230fce1a534f457dba7b8fc0fb0ad7
diff --git a/lib/ach/records/file_header.rb b/lib/ach/records/file_header.rb index <HASH>..<HASH> 100644 --- a/lib/ach/records/file_header.rb +++ b/lib/ach/records/file_header.rb @@ -5,7 +5,7 @@ module ACH::Records const_field :record_type, '1' const_field :priority_code, '01' field :immediate_destination, String, lambda { |f| f.rjust(10) }, nil, /\A(\d{9,10}|)\z/ - field :immediate_origin, String, lambda { |f| f.rjust(10) }, nil, /\A[A-Z\d\s]{1}?\d{9}\z/ + field :immediate_origin, String, lambda { |f| f.rjust(10) }, nil, /\A[A-Z\d\s]{1}?\d{9}\s?\z/ field :transmission_datetime, Time, lambda { |f| f.strftime('%y%m%d%H%M')}, lambda { Time.now }
IMS-<I> allow appending space to immediate origin
jm81_ach
train
rb
8d4b24b68d57d1601a8042c8e51981320d87066e
diff --git a/code/cms/DMSUploadField.php b/code/cms/DMSUploadField.php index <HASH>..<HASH> 100644 --- a/code/cms/DMSUploadField.php +++ b/code/cms/DMSUploadField.php @@ -57,6 +57,15 @@ class DMSUploadField extends UploadField { return true; } + + public function isDisabled() { + return (parent::isDisabled() || !$this->isSaveable()); + } + + public function isSaveable() { + return (!empty($this->getRecord()->ID)); + } + /** * Action to handle upload of a single file *
FIX Don't show the upload field when inappropriate This fix is quite ugly, but in theory, it's fine. By ugly, I mean the interface is kind of weird without it. Because <I> allows uploading when a DataObject doesn't exist, we need to override the new defaults to not allow such if the DO isn't saved yet.
silverstripe_silverstripe-dms
train
php
72177945d085a2523660fb5c43975f17ea1a9e90
diff --git a/src/Commands/RsyncCommand.php b/src/Commands/RsyncCommand.php index <HASH>..<HASH> 100644 --- a/src/Commands/RsyncCommand.php +++ b/src/Commands/RsyncCommand.php @@ -93,7 +93,7 @@ class RsyncCommand extends TerminusCommand implements SiteAwareInterface } $this->log()->notice('Running {cmd}', ['cmd' => "rsync $rsyncOptionString $src $dest"]); - $this->passthru("rsync $rsyncOptionString --ipv4 --exclude=.git -e 'ssh -p 2222' $src $dest "); + $this->passthru("rsync $rsyncOptionString --ipv4 --exclude=.git -e 'ssh -p 2222' '$src' '$dest' "); } protected function passthru($command)
put paths in quotes to preserve spaces etc
pantheon-systems_terminus-rsync-plugin
train
php
ef6d34c7cb4465d79b9242e9a843fd2d82d8c6e7
diff --git a/client/views/panels/manager.js b/client/views/panels/manager.js index <HASH>..<HASH> 100644 --- a/client/views/panels/manager.js +++ b/client/views/panels/manager.js @@ -26,6 +26,7 @@ define([ tabMenu: false, newTab: false, draggable: false, + keyboardShortcuts: false, maxTabsPerSection: 1 }, this); this.tabs.$el.appendTo(this.$el); diff --git a/client/views/tabs/base.js b/client/views/tabs/base.js index <HASH>..<HASH> 100644 --- a/client/views/tabs/base.js +++ b/client/views/tabs/base.js @@ -62,6 +62,8 @@ define([ var navs = {}; container = container || this; + if (!this.tab.manager.options.keyboardShortcuts) return; + _.each(navigations, function(method, key) { navs[key] = _.bind(function() { // Trigger only if active tab diff --git a/client/views/tabs/manager.js b/client/views/tabs/manager.js index <HASH>..<HASH> 100644 --- a/client/views/tabs/manager.js +++ b/client/views/tabs/manager.js @@ -43,7 +43,10 @@ define([ maxTabsPerSection: -1, // Tabs are draggable - draggable: true + draggable: true, + + // Enable keyboard shortcuts + keyboardShortcuts: true }, events: {},
Fix keyboard shortcuts in tabs of lateral panels
CodeboxIDE_codebox
train
js,js,js
163454328f37f6651210945d50386ca894e2ce6a
diff --git a/resource_arm_managed_disk.go b/resource_arm_managed_disk.go index <HASH>..<HASH> 100644 --- a/resource_arm_managed_disk.go +++ b/resource_arm_managed_disk.go @@ -2,12 +2,13 @@ package azurerm import ( "fmt" - "github.com/Azure/azure-sdk-for-go/arm/disk" - "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" "log" "net/http" "strings" + + "github.com/Azure/azure-sdk-for-go/arm/disk" + "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform/helper/validation" ) func resourceArmManagedDisk() *schema.Resource { @@ -90,9 +91,9 @@ func resourceArmManagedDisk() *schema.Resource { func validateDiskSizeGB(v interface{}, k string) (ws []string, errors []error) { value := v.(int) - if value < 1 || value > 1023 { + if value < 1 || value > 4095 { errors = append(errors, fmt.Errorf( - "The `disk_size_gb` can only be between 1 and 1023")) + "The `disk_size_gb` can only be between 1 and 4095")) } return }
Adding support for 4TB disks
terraform-providers_terraform-provider-azurerm
train
go
02004d8c187bc51c28bc9d89e4edecf5096781a7
diff --git a/mpldatacursor.py b/mpldatacursor.py index <HASH>..<HASH> 100644 --- a/mpldatacursor.py +++ b/mpldatacursor.py @@ -75,14 +75,15 @@ def datacursor(artists=None, axes=None, tolerance=5, formatter=None, + ax.images return artists - if not cbook.iterable(axes): - axes = [axes] - # If no axes are specified, get all axes. if axes is None: - figs = pylab_helpers.Gcf.figs.values() + managers = pylab_helpers.Gcf.get_all_fig_managers() + figs = [manager.canvas.figure for manager in managers] axes = [ax for fig in figs for ax in fig.axes] + if not cbook.iterable(axes): + axes = [axes] + # If no artists are specified, get all manually plotted artists in all of # the specified axes. if artists is None:
Bugfix for "datacursor" when no artists or axes are specified
joferkington_mpldatacursor
train
py
56cf1d45cffbf68340be9c7258f54402dee02243
diff --git a/modules/clipboard.js b/modules/clipboard.js index <HASH>..<HASH> 100644 --- a/modules/clipboard.js +++ b/modules/clipboard.js @@ -107,8 +107,8 @@ class Clipboard extends Module { this.container.focus(); this.quill.selection.update(Quill.sources.SILENT); setTimeout(() => { - this.quill.scrollingContainer.scrollTop = scrollTop; this.onPaste(e, range); + this.quill.scrollingContainer.scrollTop = scrollTop; this.quill.focus(); this.container.innerHTML = ''; }, 1);
onPaste might shift scrolling so run after
quilljs_quill
train
js
ac37c7d6852bb1e809990d9e92b127ecd8bdfc76
diff --git a/gremlin-python/src/main/jython/setup.py b/gremlin-python/src/main/jython/setup.py index <HASH>..<HASH> 100644 --- a/gremlin-python/src/main/jython/setup.py +++ b/gremlin-python/src/main/jython/setup.py @@ -51,9 +51,12 @@ install_requires = [ 'isodate>=0.6.0,<1.0.0' ] -if sys.version_info < (3,2): +if sys.version_info < (3, 2): install_requires += ['futures>=3.0.5,<4.0.0'] +if sys.version_info < (3, 5): + install_requires += ['pyparsing>=2.4.6,<3.0.0'] + setup( name='gremlinpython', version=version,
Pinned pyparsing to versions prior to <I> <I> doesn't seem to support earlier version of python anymore CTR
apache_tinkerpop
train
py
770db5f626338e43da54d7e3976e739c44f5f7a9
diff --git a/extended-template-parts.php b/extended-template-parts.php index <HASH>..<HASH> 100644 --- a/extended-template-parts.php +++ b/extended-template-parts.php @@ -40,6 +40,9 @@ */ function get_extended_template_part( $slug, $name = '', array $vars = [], array $args = [] ) { $template = new Extended_Template_Part( $slug, $name, $vars, $args ); + $dir = $template->args['dir']; + /* This action is documented in WordPress core: wp-includes/general-template.php */ + do_action( "get_template_part_{$dir}/{$slug}", "{$dir}/{$slug}", $name ); echo $template->get_output(); // WPCS: XSS ok. }
Fire the same `get_template_part_{$slug}` action that WordPress core does when loading a template part.
johnbillion_extended-template-parts
train
php
a2a3caf64378dd0730008ad05ef061c53703dcee
diff --git a/modelx/core/system.py b/modelx/core/system.py index <HASH>..<HASH> 100644 --- a/modelx/core/system.py +++ b/modelx/core/system.py @@ -124,14 +124,18 @@ class System: return from ipykernel.kernelapp import IPKernelApp + self.shell = IPKernelApp.instance().shell # None in PyCharm console - self.shell = IPKernelApp.instance().shell + if not self.shell and is_ipython(): + self.shell = get_ipython() - if self.shell: # is set to None in PyCharm + if self.shell: shell_class = type(self.shell) shell_class.default_showtraceback = shell_class.showtraceback shell_class.showtraceback = custom_showtraceback self.is_ipysetup = True + else: + raise RuntimeError("IPython shell not found.") def restore_ipython(self): """Restore default IPython showtraceback"""
FIX: setup_ipython to get shell from get_ipython()
fumitoh_modelx
train
py
b840e817cc0c4f8fa9fb978a23ee7fc13318514b
diff --git a/src/main/java/water/exec/ASTOp.java b/src/main/java/water/exec/ASTOp.java index <HASH>..<HASH> 100644 --- a/src/main/java/water/exec/ASTOp.java +++ b/src/main/java/water/exec/ASTOp.java @@ -718,8 +718,8 @@ abstract class ASTBinOp extends ASTOp { if(chks[i].isNA0(r)) { n.addNum(Double.NaN); continue; } rv = chks[i].at0(r); } else { - if (Double.isNaN(df0)) { n.addNum(Double.NaN); continue; } - rv = df0; + if (Double.isNaN(df1)) { n.addNum(Double.NaN); continue; } + rv = df1; } n.addNum(bin.op(lv, rv)); }
missed the RHS double in the ASTBinOp
h2oai_h2o-2
train
java
26ff73c36312eaa0946b265b133c744a1554f92c
diff --git a/features/step_definitions/cli_steps.rb b/features/step_definitions/cli_steps.rb index <HASH>..<HASH> 100644 --- a/features/step_definitions/cli_steps.rb +++ b/features/step_definitions/cli_steps.rb @@ -22,16 +22,6 @@ When /^I wait (\d+) seconds?$/ do |arg1| sleep arg1.to_i end -# TODO: Remove after pull request is merged in cucumber.rb from Aruba -When /^I wait for (?:output|stdout) to contain "([^"]*)"$/ do |expected| - Timeout::timeout(exit_timeout) do - loop do - break if assert_partial_output_interactive(expected) - sleep 0.1 - end - end -end - Given /^that I create a valid app under "([^"]*)"$/ do |path| steps %Q{ When I run `ahn create #{path}`
[CS] Remove step definitions duplicated from Aruba
adhearsion_adhearsion
train
rb
dc2c8008d98e7e895f80567c572c9c6800f28289
diff --git a/websocket.py b/websocket.py index <HASH>..<HASH> 100644 --- a/websocket.py +++ b/websocket.py @@ -162,8 +162,8 @@ def create_connection(url, timeout=None, **options): If you set "header" dict object, you can set your own custom header. >>> conn = create_connection("ws://echo.websocket.org/", - ... header={"User-Agent: MyProgram", - ... "x-custom: header"}) + ... header=["User-Agent: MyProgram", + ... "x-custom: header"]) timeout: socket timeout time. This value is integer.
header argument is sequence insted of dict
websocket-client_websocket-client
train
py
baea5a35e0d1a284a1dc9bcea9e1b07c280d97f1
diff --git a/dht.go b/dht.go index <HASH>..<HASH> 100644 --- a/dht.go +++ b/dht.go @@ -53,7 +53,6 @@ type IpfsDHT struct { providers *providers.ProviderManager birth time.Time // When this peer started up - diaglock sync.Mutex // lock to make diagnostics work better Validator record.Validator // record validator funcs Selector record.Selector // record selection funcs
Remove diaglock as per #<I>
libp2p_go-libp2p-kad-dht
train
go
7a0eaf45e4411eb2005e256c431fe1df8db3b4bd
diff --git a/lib/virtualbox/dvd.rb b/lib/virtualbox/dvd.rb index <HASH>..<HASH> 100644 --- a/lib/virtualbox/dvd.rb +++ b/lib/virtualbox/dvd.rb @@ -7,5 +7,12 @@ module VirtualBox parse_raw(raw) end end + + # Deletes the DVD from VBox managed list, but not actually from + # disk itself. + def destroy + Command.vboxmanage("closemedium dvd #{uuid} --delete") + return $?.to_i == 0 + end end end \ No newline at end of file diff --git a/lib/virtualbox/hard_drive.rb b/lib/virtualbox/hard_drive.rb index <HASH>..<HASH> 100644 --- a/lib/virtualbox/hard_drive.rb +++ b/lib/virtualbox/hard_drive.rb @@ -10,5 +10,10 @@ module VirtualBox parse_raw(raw) end end + + def destroy + Command.vboxmanage("closemedium disk #{uuid} --delete") + return $?.to_i == 0 + end end end \ No newline at end of file
HardDrive and DVD images can now be destroyed
mitchellh_virtualbox
train
rb,rb
daf47705cba725e7f3da3327581c665567553af0
diff --git a/kernel/classes/datatypes/ezdatetime/ezdatetimetype.php b/kernel/classes/datatypes/ezdatetime/ezdatetimetype.php index <HASH>..<HASH> 100644 --- a/kernel/classes/datatypes/ezdatetime/ezdatetimetype.php +++ b/kernel/classes/datatypes/ezdatetime/ezdatetimetype.php @@ -625,7 +625,7 @@ class eZDateTimeType extends eZDataType default: { - $default = null; + return array(); } }
Fix EZP-<I>: ezdatetime with no default value causes class edit to fail According to the other datatypes I have checked, it should return an empty array in this case.
ezsystems_ezpublish-legacy
train
php
11bb94a7e58cbbcd72a899974b6c1a81c3bc63fd
diff --git a/storage/metric/memory.go b/storage/metric/memory.go index <HASH>..<HASH> 100644 --- a/storage/metric/memory.go +++ b/storage/metric/memory.go @@ -348,8 +348,20 @@ func (s memorySeriesStorage) Close() (err error) { return } -func (s memorySeriesStorage) GetAllMetricNames() ([]string, error) { - panic("not implemented") +func (s memorySeriesStorage) GetAllMetricNames() (metrics []string, err error) { + metricSet := map[string]bool{} + for _, series := range s.fingerprintToSeries { + if metricName, ok := series.metric["name"]; !ok { + err = fmt.Errorf("Found timeseries without metric name label: %v", series.metric) + } else { + metricSet[string(metricName)] = true + } + } + for metricName := range metricSet { + metrics = append(metrics, metricName) + } + sort.Strings(metrics) + return } func (s memorySeriesStorage) ForEachSample(builder IteratorsForFingerprintBuilder) (err error) {
Implement GetAllMetricNames() for memory storage.
prometheus_prometheus
train
go
0cac77dfa1c598d25a4be93f92b5559b9092b8bc
diff --git a/code/actions/BetterButtonCustomAction.php b/code/actions/BetterButtonCustomAction.php index <HASH>..<HASH> 100755 --- a/code/actions/BetterButtonCustomAction.php +++ b/code/actions/BetterButtonCustomAction.php @@ -42,12 +42,6 @@ class BetterButtonCustomAction extends BetterButtonAction { protected $redirectURL; - /** - * The success message on completion of the action - * @var string - */ - protected $successMessage; - /** * Builds the button @@ -122,27 +116,6 @@ class BetterButtonCustomAction extends BetterButtonAction { /** - * Sets the success message when action complets - * @param string $message - * @return BetterButtonCustomAction - */ - public function setSuccessMessage($message) { - $this->successMessage = $message; - - return $this; - } - - - /** - * Gets the success message - * @return string - */ - public function getSuccessMessage() { - return $this->successMessage; - } - - - /** * Gets the link for the button * @return string */
API CHANGE: Remove successMessage from BetterButtonCustomAction
unclecheese_silverstripe-gridfield-betterbuttons
train
php
bbb0c62bc8b07d87dcb9d4ef552d7ed8908217ca
diff --git a/kie-remote/kie-remote-services/src/test/java/org/kie/remote/services/rest/query/RemoteServicesQueryDataTest.java b/kie-remote/kie-remote-services/src/test/java/org/kie/remote/services/rest/query/RemoteServicesQueryDataTest.java index <HASH>..<HASH> 100644 --- a/kie-remote/kie-remote-services/src/test/java/org/kie/remote/services/rest/query/RemoteServicesQueryDataTest.java +++ b/kie-remote/kie-remote-services/src/test/java/org/kie/remote/services/rest/query/RemoteServicesQueryDataTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 JBoss Inc + * Copyright 2015 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
added missing correct license header closes #<I>
kiegroup_droolsjbpm-integration
train
java
853493a57519769ff01a580a1c7ecf7aece89170
diff --git a/core/src/main/java/com/orientechnologies/orient/core/db/ODatabaseRecordWrapperAbstract.java b/core/src/main/java/com/orientechnologies/orient/core/db/ODatabaseRecordWrapperAbstract.java index <HASH>..<HASH> 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/db/ODatabaseRecordWrapperAbstract.java +++ b/core/src/main/java/com/orientechnologies/orient/core/db/ODatabaseRecordWrapperAbstract.java @@ -151,6 +151,10 @@ public abstract class ODatabaseRecordWrapperAbstract<DB extends ODatabaseRecord> return underlying.getUser(); } + public void setUser(OUser user) { + underlying.setUser(user); + } + public OMetadata getMetadata() { return underlying.getMetadata(); }
Update core/src/main/java/com/orientechnologies/orient/core/db/ODatabaseRecordWrapperAbstract.java Allow set user back to current database instance
orientechnologies_orientdb
train
java
e94c1b3493eed6e273bc0a2cb729c31b1051b3e3
diff --git a/src/selection.js b/src/selection.js index <HASH>..<HASH> 100644 --- a/src/selection.js +++ b/src/selection.js @@ -75,7 +75,7 @@ export default class FeatureSelection { // Any pending selection requests pendingRequests() { - return this.requests; + return Object.keys(this.requests).length && this.requests; } clearPendingRequests() {
only return pending selection list when more than zero
tangrams_tangram
train
js
a1a90fed31a50cf261d5786087b6710da82db077
diff --git a/src/Twig/EasyAdminTwigExtension.php b/src/Twig/EasyAdminTwigExtension.php index <HASH>..<HASH> 100644 --- a/src/Twig/EasyAdminTwigExtension.php +++ b/src/Twig/EasyAdminTwigExtension.php @@ -262,7 +262,7 @@ class EasyAdminTwigExtension extends \Twig_Extension } elseif (null !== $primaryKeyValue) { $templateParameters['value'] = sprintf('%s #%s', $targetEntityConfig['name'], $primaryKeyValue); } else { - $templateParameters['value'] = $this->getClassShortName($templateParameters['field_options']['targetEntity']); + $templateParameters['value'] = null; } // if the associated entity is managed by EasyAdmin, and the "show"
display NONE label on null associations This will fix #<I> and #<I>
EasyCorp_EasyAdminBundle
train
php
d6ca1e81868b140f044b0ba56c2c2e72a2d62c61
diff --git a/src/Adyen/Client.php b/src/Adyen/Client.php index <HASH>..<HASH> 100644 --- a/src/Adyen/Client.php +++ b/src/Adyen/Client.php @@ -104,6 +104,16 @@ class Client $this->_config->set('endpoint', $url); } + /** + * Set directory lookup URL + * + * @param $url + */ + public function setDirectoryLookupUrl($url) + { + $this->_config->set('endpointDirectorylookup', $url); + } + public function setMerchantAccount($merchantAccount) { $this->_config->set('merchantAccount', $merchantAccount); @@ -217,4 +227,4 @@ class Client return $logger; } -} \ No newline at end of file +}
Added a method to set the directory lookup URL.
Adyen_adyen-php-api-library
train
php
bf3863eb335b0414a4a93686cee23e8cf64a32f2
diff --git a/Dailymotion.php b/Dailymotion.php index <HASH>..<HASH> 100644 --- a/Dailymotion.php +++ b/Dailymotion.php @@ -612,6 +612,7 @@ class Dailymotion CURLOPT_CONNECTTIMEOUT => $this->connectionTimeout, CURLOPT_TIMEOUT => $this->timeout, CURLOPT_PROXY => $this->proxy, + CURLOPT_SSLVERSION => 3, // See http://bit.ly/I1OYCn CURLOPT_USERAGENT => sprintf('Dailymotion-PHP/%s (PHP %s; %s)', self::VERSION, PHP_VERSION, php_sapi_name()), CURLOPT_HEADER => true, CURLOPT_RETURNTRANSFER => true,
Force SSL version to workaround SSL timeout with some PHP installations
dailymotion_dailymotion-sdk-php
train
php
1493e450c2ab80531b2057b7fa72c3bf139961e6
diff --git a/lib/ronin/extensions/regexp.rb b/lib/ronin/extensions/regexp.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/extensions/regexp.rb +++ b/lib/ronin/extensions/regexp.rb @@ -28,10 +28,10 @@ class Regexp MAC = /[0-9a-fA-F]{2}(?::[0-9a-fA-F]{2}){5}/ # A regular expression for matching IPv4 Addresses. - IPv4 = /#{OCTET}(?:\.#{OCTET}){3}/ + IPv4 = /#{OCTET}(?:\.#{OCTET}){3}(?:\/\d{1,2})?/ # A regular expression for matching IPv6 Addresses. - IPv6 = /::ffff:#{IPv4}|(?:::)?[0-9a-f]{1,4}(::?[0-9a-f]{1,4}){,7}(?:::)?/ + IPv6 = /::ffff:#{IPv4}|(?:::)?[0-9a-f]{1,4}(::?[0-9a-f]{1,4}){,7}(?:::)?(?:\/\d{1,3})?/ # A regular expression for matching IP Addresses. IP = /#{IPv4}|#{IPv6}/
Also match the netmasks of the IPv4 and IPv6 addresses.
ronin-ruby_ronin-support
train
rb
07eeb4794c4cdd855a7045bdec5e02a79fcdea38
diff --git a/src/java/voldemort/cluster/failuredetector/AbstractFailureDetector.java b/src/java/voldemort/cluster/failuredetector/AbstractFailureDetector.java index <HASH>..<HASH> 100644 --- a/src/java/voldemort/cluster/failuredetector/AbstractFailureDetector.java +++ b/src/java/voldemort/cluster/failuredetector/AbstractFailureDetector.java @@ -216,8 +216,8 @@ public abstract class AbstractFailureDetector implements FailureDetector { if(nodeStatus == null) { logger.warn("creating new node status for node " + node + " for failure detector."); - nodeStatusMap.put(node, createNodeStatus(node, failureDetectorConfig.getTime() - .getMilliseconds())); + nodeStatus = createNodeStatus(node, failureDetectorConfig.getTime().getMilliseconds()); + nodeStatusMap.put(node, nodeStatus); } return nodeStatus;
Returning the new NodeStatus() object if previous nodeStatus was null.
voldemort_voldemort
train
java
83ffd9b660d12c4d7b7b8a1b23fc9fd265bacb65
diff --git a/security/api/src/main/java/org/jboss/as/security/api/ConnectionSecurityContext.java b/security/api/src/main/java/org/jboss/as/security/api/ConnectionSecurityContext.java index <HASH>..<HASH> 100644 --- a/security/api/src/main/java/org/jboss/as/security/api/ConnectionSecurityContext.java +++ b/security/api/src/main/java/org/jboss/as/security/api/ConnectionSecurityContext.java @@ -72,7 +72,7 @@ public class ConnectionSecurityContext { if (localIdentity != null) { final Principal principal = localIdentity.getPrincipal(); final String realm = principal instanceof RealmPrincipal ? ((RealmPrincipal) principal).getRealm() : null; - principals.add(new RealmUser(realm, principal.getName())); + principals.add(realm == null ? new RealmUser(principal.getName()) : new RealmUser(realm, principal.getName())); for (String role : localIdentity.getRoles()) { principals.add(new RealmGroup(role)); principals.add(new RealmRole(role));
WFLY-<I>: prevent IllegalStateException while creation of RealmUser without realm
wildfly_wildfly
train
java
81f0f001e286bba02ed4317023923a2c81ec6a63
diff --git a/app/helpers/wafflemix/application_helper.rb b/app/helpers/wafflemix/application_helper.rb index <HASH>..<HASH> 100644 --- a/app/helpers/wafflemix/application_helper.rb +++ b/app/helpers/wafflemix/application_helper.rb @@ -14,7 +14,7 @@ module Wafflemix icon_bar += content_tag(:span, '', :class => 'icon-bar') icon_bar.html_safe end - container_content += link_to('WaffleMix', main_app.root_path, :class => 'brand') + container_content += link_to('WaffleMix', root_path, :class => 'brand') container_content += content_tag(:div, '', :class => 'nav-collapse collapse') do content_tag(:ul, :class => 'nav') do top_nav_links.html_safe
Root path is now set in main app.
jrissler_wafflemix
train
rb
82be81b3c7f90f174393c7a73f8a374d03b7f5d4
diff --git a/js/src/forum/addComposerAutocomplete.js b/js/src/forum/addComposerAutocomplete.js index <HASH>..<HASH> 100644 --- a/js/src/forum/addComposerAutocomplete.js +++ b/js/src/forum/addComposerAutocomplete.js @@ -46,7 +46,7 @@ export default function addComposerAutocomplete() { $textarea .after($container) - .on('click keyup', function(e) { + .on('click keyup input', function(e) { // Up, down, enter, tab, escape, left, right. if ([9, 13, 27, 40, 38, 37, 39].indexOf(e.which) !== -1) return;
Trigger mention autocomplete on any kind of input
flarum_mentions
train
js
ac09e3851851c27a80e7f283299553127c30a3a0
diff --git a/src/shared/get-support.js b/src/shared/get-support.js index <HASH>..<HASH> 100644 --- a/src/shared/get-support.js +++ b/src/shared/get-support.js @@ -7,7 +7,7 @@ function calcSupport() { const document = getDocument(); return { - smoothScroll: 'scrollBehavior' in document.documentElement.style, + smoothScroll: document.documentElement && 'scrollBehavior' in document.documentElement.style, touch: !!( 'ontouchstart' in window ||
fix(core): double check for documentElement in smoothScroll detection
nolimits4web_swiper
train
js
f0750c5e689918c78873484c95f91da4a0c22666
diff --git a/src/Codesleeve/AssetPipeline/Filters/JSTFilter.php b/src/Codesleeve/AssetPipeline/Filters/JSTFilter.php index <HASH>..<HASH> 100644 --- a/src/Codesleeve/AssetPipeline/Filters/JSTFilter.php +++ b/src/Codesleeve/AssetPipeline/Filters/JSTFilter.php @@ -41,7 +41,9 @@ class JSTFilter implements FilterInterface { $base = $asset->getSourceRoot(); - $file = pathinfo($asset->getSourcePath())['filename']; + $file = pathinfo($asset->getSourcePath()); + $file = $file['filename']; + $file = str_replace('\\', '/', $file); $path = '';
seperating 1 line into 2 lines for backwards compatibility (maybe...)
CodeSleeve_asset-pipeline
train
php
bd8cb374ee647ba0affc5e0d42a17f90d32c0404
diff --git a/packages/ember-htmlbars/lib/main.js b/packages/ember-htmlbars/lib/main.js index <HASH>..<HASH> 100644 --- a/packages/ember-htmlbars/lib/main.js +++ b/packages/ember-htmlbars/lib/main.js @@ -12,7 +12,6 @@ import makeBoundHelper from "ember-htmlbars/system/make_bound_helper"; import { registerHelper, - helper, default as helpers } from "ember-htmlbars/helpers"; import { viewHelper } from "ember-htmlbars/helpers/view";
[BUGFIX beta] Remove vestigial `helper` import in ember-htmlbars * Resolves JSHint error
emberjs_ember.js
train
js
8f2a3f8884cf1ff10be1f8af5ba58c2145c71d7c
diff --git a/lib/oxygen.js b/lib/oxygen.js index <HASH>..<HASH> 100644 --- a/lib/oxygen.js +++ b/lib/oxygen.js @@ -236,8 +236,8 @@ module.exports.Runner = function () { } else if (msg.level === 'WARN') { logger.warn(msg.msg); } - - if (msg.issuer === DEFAULT_ISSUER) { + + if (msg.src === DEFAULT_ISSUER) { ee.emit('log-add', msg.level, msg.msg, msg.time); } } else if (msg.event && msg.event === 'init-success') {
Fix log-add event not being emited
oxygenhq_oxygen
train
js
b4dbb2a31d51848173c9d5446a5e315aaaaf1da6
diff --git a/apiserver/facades/client/application/application.go b/apiserver/facades/client/application/application.go index <HASH>..<HASH> 100644 --- a/apiserver/facades/client/application/application.go +++ b/apiserver/facades/client/application/application.go @@ -2148,7 +2148,8 @@ func (api *APIBase) setApplicationConfig(arg params.ApplicationConfigSet) error } // We need a guard on the API server-side for direct API callers such as - // python-libjuju. Always default to the master branch. + // python-libjuju, and for older clients. + // Always default to the master branch. if arg.Generation == "" { arg.Generation = model.GenerationMaster } @@ -2223,7 +2224,8 @@ func (api *APIBase) unsetApplicationConfig(arg params.ApplicationUnset) error { if len(charmSettings) > 0 { // We need a guard on the API server-side for direct API callers such as - // python-libjuju. Always default to the master branch. + // python-libjuju, and for older clients. + // Always default to the master branch. if arg.BranchName == "" { arg.BranchName = model.GenerationMaster }
Adds comment detail to application API server for defaulting config branch name.
juju_juju
train
go
4272ac390d77a26ed57c8a83ba6543bf3f8eadab
diff --git a/lib/gclitest/testCli.js b/lib/gclitest/testCli.js index <HASH>..<HASH> 100644 --- a/lib/gclitest/testCli.js +++ b/lib/gclitest/testCli.js @@ -130,7 +130,7 @@ exports.testTsv = function() { test.is( 'VVVVI', statuses); test.is(Status.ERROR, status); test.is(0, assignC.paramIndex); - test.is(2, assignC.getPredictions().length); + test.ok(assignC.getPredictions().length >= 2); test.is(commands.option1, assignC.getPredictions()[0].value); test.is(commands.option2, assignC.getPredictions()[1].value); test.is('tsv', requ.commandAssignment.getValue().name); @@ -141,7 +141,7 @@ exports.testTsv = function() { test.is( 'VVVVIIIIII', statuses); test.is(Status.ERROR, status); test.is(0, assignC.paramIndex); - test.is(2, assignC.getPredictions().length); + test.ok(assignC.getPredictions().length >= 2); test.is(commands.option1, assignC.getPredictions()[0].value); test.is(commands.option2, assignC.getPredictions()[1].value); test.is('tsv', requ.commandAssignment.getValue().name);
Bug <I> (fuzzy): Tests for match counts need to be broader
joewalker_gcli
train
js
d902e144f094fcfd090f64db615f86811faf12cf
diff --git a/sos/report/plugins/auditd.py b/sos/report/plugins/auditd.py index <HASH>..<HASH> 100644 --- a/sos/report/plugins/auditd.py +++ b/sos/report/plugins/auditd.py @@ -21,7 +21,8 @@ class Auditd(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): def setup(self): self.add_copy_spec([ "/etc/audit/auditd.conf", - "/etc/audit/audit.rules" + "/etc/audit/audit.rules", + "/etc/audit/plugins.d/" ]) self.add_cmd_output([ "ausearch --input-logs -m avc,user_avc -ts today",
[auditd] Get auditd plugins.d contents Resolves: #<I>
sosreport_sos
train
py
6ab325bb0a05cb04dcce74bcfd1ab0abfa4b905d
diff --git a/Classes/Utility/DatabaseUtility.php b/Classes/Utility/DatabaseUtility.php index <HASH>..<HASH> 100644 --- a/Classes/Utility/DatabaseUtility.php +++ b/Classes/Utility/DatabaseUtility.php @@ -312,35 +312,11 @@ class DatabaseUtility return $ret; } - /** - * Sanitize field for sql usage - * - * @param string $field SQL relation attribute - * - * @return string - */ - public static function sanitizeSqlField($field) - { - return preg_replace('/[^_a-zA-Z0-9\.]/', '', $field); - } - ########################################################################### # Helper functions ########################################################################### /** - * Sanitize table for sql usage - * - * @param string $table SQL Table - * - * @return string - */ - public static function sanitizeSqlTable($table) - { - return preg_replace('/[^_a-zA-Z0-9]/', '', $table); - } - - /** * Add condition to query * * @param array|string $condition Condition
[TASK] no need to sanitize user input to process table / attribute names. It would not be safe anyways. If ever user input for table or attribute names needs to be processed, an exact match would be much safer. Therefore, there's nothing to sanitize. Fixes #<I>
webdevops_TYPO3-metaseo
train
php
47413a2792fb772f4bdcf7a61a843b495464feae
diff --git a/ez_setup.py b/ez_setup.py index <HASH>..<HASH> 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -30,7 +30,7 @@ try: except ImportError: USER_SITE = None -DEFAULT_VERSION = "18.0" +DEFAULT_VERSION = "18.1" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" DEFAULT_SAVE_DIR = os.curdir diff --git a/setuptools/version.py b/setuptools/version.py index <HASH>..<HASH> 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '18.0' +__version__ = '18.1'
Bumped to <I> in preparation for next release.
pypa_setuptools
train
py,py
429bbb0edc104f0603a1060cf7593e3a63d445fa
diff --git a/oa-oauth/lib/omniauth/strategies/netflix.rb b/oa-oauth/lib/omniauth/strategies/netflix.rb index <HASH>..<HASH> 100644 --- a/oa-oauth/lib/omniauth/strategies/netflix.rb +++ b/oa-oauth/lib/omniauth/strategies/netflix.rb @@ -53,6 +53,7 @@ module OmniAuth 'nickname' => user['nickname'], 'first_name' => user['first_name'], 'last_name' => user['last_name'], + 'name' => "#{user['first_name']} #{user['last_name']}" } end
NetFlix Auth Hash Schema must contain a required ['user_info']['name'] entry.
omniauth_omniauth
train
rb
32597388471735c328d741bb9b29bf32f82e542f
diff --git a/scapy/asn1fields.py b/scapy/asn1fields.py index <HASH>..<HASH> 100644 --- a/scapy/asn1fields.py +++ b/scapy/asn1fields.py @@ -282,7 +282,7 @@ class ASN1F_SEQUENCE_OF(ASN1F_SEQUENCE): class ASN1F_PACKET(ASN1F_field): holds_packets = 1 def __init__(self, name, default, cls): - ASN1_field.__init__(self, name, default) + ASN1F_field.__init__(self, name, default) self.cls = cls def i2m(self, pkt, x): if x is None:
typo in scapy/asn1fields.py
secdev_scapy
train
py
d921624d557d9c4ec0f7d80de5fa3557f71fe932
diff --git a/src/TextBox.js b/src/TextBox.js index <HASH>..<HASH> 100644 --- a/src/TextBox.js +++ b/src/TextBox.js @@ -268,6 +268,7 @@ export default class TextBox extends BaseClass { const rtl = detectRTL(); update + .order() .style("pointer-events", d => this._pointerEvents(d.data, d.i)) .each(function(d) {
fixes re-ordering of TextBox DOM elements on redraw
d3plus_d3plus-text
train
js
a88aa228749eed6ec3c2990e32a0e5d35937fe93
diff --git a/django_tenants/postgresql_backend/base.py b/django_tenants/postgresql_backend/base.py index <HASH>..<HASH> 100644 --- a/django_tenants/postgresql_backend/base.py +++ b/django_tenants/postgresql_backend/base.py @@ -165,3 +165,6 @@ class FakeTenant: def __init__(self, schema_name, tenant_type=None): self.schema_name = schema_name self.tenant_type = tenant_type + + def get_tenant_type(self): + return self.tenant_type
Fixed a problem with FakeTenant
tomturner_django-tenants
train
py
1c408adcabee4d1c8bcfb78fda667bdae7d5d134
diff --git a/routing/chainview/neutrino.go b/routing/chainview/neutrino.go index <HASH>..<HASH> 100644 --- a/routing/chainview/neutrino.go +++ b/routing/chainview/neutrino.go @@ -236,7 +236,7 @@ func (c *CfFilteredChainView) FilterBlock(blockHash *chainhash.Hash) (*FilteredB // Next, using the block, hash, we'll fetch the compact filter for this // block. We only require the regular filter as we're just looking for // outpoint that have been spent. - filter, err := c.p2pNode.GetCFilter(*blockHash, false) + filter, err := c.p2pNode.GetCFilter(*blockHash, wire.GCSFilterRegular) if err != nil { return nil, err }
routing/chainview: update neutrino driver to comply with BIP
lightningnetwork_lnd
train
go
87624a11df496b482b6e353213d25cf532ac52dc
diff --git a/lib/launchy/cli.rb b/lib/launchy/cli.rb index <HASH>..<HASH> 100644 --- a/lib/launchy/cli.rb +++ b/lib/launchy/cli.rb @@ -65,13 +65,11 @@ module Launchy def good_run( argv, env ) if parse( argv, env ) then - Launchy.open( argv.shift, options ) + Launchy.open( argv.shift, options ) { |u, o, e| error_output( e ) } return true else return false end - rescue StandardError => e - error_output( e ) end def error_output( error )
Have the commandline program use the new block feature.
copiousfreetime_launchy
train
rb
b91c3bd658ffd6f782bbb30356a5eadf212b4595
diff --git a/lib/handlers/session.js b/lib/handlers/session.js index <HASH>..<HASH> 100644 --- a/lib/handlers/session.js +++ b/lib/handlers/session.js @@ -9,6 +9,9 @@ var errors = require('../errors'); var Observable = utils.Observable; var passport = require('passport'); +var sendy = require('../addons/sendy'); + + module.exports = Observable.extend({ constructor: function SessionHandler(sandbox) { Observable.apply(this, arguments); @@ -143,6 +146,12 @@ module.exports = Observable.extend({ key = req.param('key', '').trim(), _this = this; + var subscribed = req.param('subscribed'); + if (subscribed !== undefined) { + subscribed = subscribed === 'true' ? true : false; + sendy.setSubscribed(email, !!subscribed); + } + if ('name' in req.params && req.user.name !== req.param('name')) { return this.respond(req, res, 400, { ok: false,
Check for subscribed param and set accordingly on routeSetHome
jsbin_jsbin
train
js
e9e79f40c966bae44b03b8a9b111c0b6249a21c6
diff --git a/core/src/main/java/com/linecorp/armeria/server/Server.java b/core/src/main/java/com/linecorp/armeria/server/Server.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/linecorp/armeria/server/Server.java +++ b/core/src/main/java/com/linecorp/armeria/server/Server.java @@ -204,7 +204,7 @@ public final class Server implements AutoCloseable { final MeterRegistry meterRegistry = config().meterRegistry(); meterRegistry.gauge("armeria.server.pendingResponses", gracefulShutdownSupport, GracefulShutdownSupport::pendingResponses); - meterRegistry.gauge("armeria.server.numConnections", connectionLimitingHandler, + meterRegistry.gauge("armeria.server.connections", connectionLimitingHandler, ConnectionLimitingHandler::numConnections); }
Rename 'armeria.server.numConnections` to `armeria.server.connections` (#<I>) Motivation: `numConnections` violates the Prometheus naming convention Modifications: - Rename 'armeria.server.numConnections` to `armeria.server.connections` Result: Consistency
line_armeria
train
java
bdc7ace15615068db2b35b75ef579fc7df85085c
diff --git a/lib/csvlint/validate.rb b/lib/csvlint/validate.rb index <HASH>..<HASH> 100644 --- a/lib/csvlint/validate.rb +++ b/lib/csvlint/validate.rb @@ -193,7 +193,7 @@ module Csvlint end @header_processed = true build_info_messages(:assumed_header, :structure) if assumed_header - + @link_headers = @headers["link"].split(",") rescue nil @link_headers.each do |link_header| match = LINK_HEADER_REGEXP.match(link_header) @@ -443,7 +443,7 @@ module Csvlint end rescue Errno::ENOENT rescue OpenURI::HTTPError, URI::BadURIError - rescue=> e + rescue => e STDERR.puts e.class STDERR.puts e.message STDERR.puts e.backtrace
whitespace fix because linter cosmetic, no change in execution
theodi_csvlint.rb
train
rb
0c8bf49c81403d3d2a5a751ea3d3af5a2e8cca19
diff --git a/join/_core.py b/join/_core.py index <HASH>..<HASH> 100644 --- a/join/_core.py +++ b/join/_core.py @@ -42,7 +42,7 @@ def join(left, right, how='inner', key=None, left_key=None, right_key=None, "right": _right_join, "inner": _inner_join, "outer": _outer_join, - }.get(how) + }[how] except KeyError: raise ValueError("Invalid value for how: {}, must be left, right, " "inner, or outer.".format(str(how)))
fixed join method lookup to not use ".get()" This is so that KeyError is thrown if an unrecognized join method name is provided.
soaxelbrooke_join
train
py