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
bf9dca3f1727ca339fdbee7eda083beec628914a
diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -1333,7 +1333,7 @@ class Request public function getFormat(?string $mimeType) { $canonicalMimeType = null; - if (false !== $pos = strpos($mimeType, ';')) { + if ($mimeType && false !== $pos = strpos($mimeType, ';')) { $canonicalMimeType = trim(substr($mimeType, 0, $pos)); }
Don't pass null to strpos()
symfony_symfony
train
php
5ddda64099b8985924becaca68dfe728511dbf8d
diff --git a/lolapi.js b/lolapi.js index <HASH>..<HASH> 100644 --- a/lolapi.js +++ b/lolapi.js @@ -99,7 +99,6 @@ var http = require('http'); var regionAndFunc = _getCallbackAndRegion(regionOrFunction, callback); if(freeToPlay) freetoPlayQuery = 'freeToPlay=true&'; var url = _craftUrl(_version1Endpoint, regionAndFunc.region, _championUrl + '?' + freetoPlayQuery); - console.log(url); _makeRequest(url, 'Error getting champions: ', 'champions', regionAndFunc.callback); } @@ -139,7 +138,6 @@ var http = require('http'); var regionAndFunc = _getCallbackAndRegion(regionOrFunction, callback); var url = _craftUrl(_version1Endpoint, regionAndFunc.region, _summonerUrl + '/' + summonerId + '/masteries?'); - console.log(url); _makeRequest(url, 'Error getting mastery data: ', 'pages', regionAndFunc.callback); }
removed console logging that was used in debugging lol
Colorfulstan_LeagueJS
train
js
c23ff4d6544ba4e00aa9164de5adf3a506e842bf
diff --git a/lib/weblib.php b/lib/weblib.php index <HASH>..<HASH> 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -142,7 +142,11 @@ function p($var, $strip=false) { * @return mixed */ function nvl(&$var, $default='') { + global $CFG; + if (!empty($CFG->disableglobalshack)) { + error( "The nvl() function is deprecated ($var, $default)." ); + } return isset($var) ? $var : $default; }
deprecated nvl() function similar to optional_variable(); merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
434414e86334d937f8c74c6cea9b9c2cad363502
diff --git a/lib/root.js b/lib/root.js index <HASH>..<HASH> 100644 --- a/lib/root.js +++ b/lib/root.js @@ -1,7 +1,11 @@ var Test = require('./test.js') +var to = process.env.TAP_TIMEOUT +if (to) + to *= 1000 + var tap = new Test({ - timeout: process.env.TAP_TIMEOUT || Infinity + timeout: to || Infinity }) module.exports = tap diff --git a/lib/test.js b/lib/test.js index <HASH>..<HASH> 100644 --- a/lib/test.js +++ b/lib/test.js @@ -47,7 +47,7 @@ function Test (options) { this._domain.owner = this this._domain.on('error', domainError) - if (options.timeout !== Infinity) { + if (options.timeout !== Infinity && !isNaN(options.timeout) && options.timeout > 0) { var timeout = options.timeout || 30000 var self = this this._timer = setTimeout(function () {
TAP_TIMEOUT env is in seconds, not ms Before launch, probably need to just go ahead and change this. I doubt anyone is depending on it being in seconds, since that's hella confusing.
tapjs_node-tap
train
js,js
1dd2b2c1a2ce69243458cda789bde38e543083fa
diff --git a/tests/dummy/config/deprecation-workflow.js b/tests/dummy/config/deprecation-workflow.js index <HASH>..<HASH> 100644 --- a/tests/dummy/config/deprecation-workflow.js +++ b/tests/dummy/config/deprecation-workflow.js @@ -11,5 +11,6 @@ window.deprecationWorkflow.config = { { handler: 'silence', matchId: 'common.school-cohorts' }, { handler: 'silence', matchId: 'common.user-performs-non-learner-function' }, { handler: 'silence', matchId: 'common.curriculum-inventory-report-is-finalized' }, + { handler: 'silence', matchId: 'ember-modifier.use-destroyables' }, //https://github.com/zeppelin/ember-click-outside ], };
Ignore noisy ember-modifier deprecation We're not causing this in any of our code.
ilios_common
train
js
5f74eaa37b5304c097619d4decfef26fc5dc46b6
diff --git a/pyosm/parsing.py b/pyosm/parsing.py index <HASH>..<HASH> 100644 --- a/pyosm/parsing.py +++ b/pyosm/parsing.py @@ -493,4 +493,6 @@ def iter_osm_notes(feed_limit=25, interval=60, parse_timestamps=True): for note in reversed(new_notes): yield note + yield model.Finished() + time.sleep(interval)
Yield a finished after parsing a chunk of notes.
iandees_pyosm
train
py
7ad7501db2f836cb9200ee018ed8a867119f3113
diff --git a/cli.js b/cli.js index <HASH>..<HASH> 100755 --- a/cli.js +++ b/cli.js @@ -212,9 +212,8 @@ function init(files) { fileCount = files.length; - var tests = files.map(run); - - return Promise.all(tests); + return cli.flags.serial ? Promise.mapSeries(files, run) + : Promise.all(files.map(run)); }); }
Force serial execution of forked processes, closes #<I>
andywer_ava-ts
train
js
9a9b6846f3a521ad925608baac95ab881969c688
diff --git a/src/main/java/edu/uci/ics/crawler4j/parser/BinaryParseData.java b/src/main/java/edu/uci/ics/crawler4j/parser/BinaryParseData.java index <HASH>..<HASH> 100644 --- a/src/main/java/edu/uci/ics/crawler4j/parser/BinaryParseData.java +++ b/src/main/java/edu/uci/ics/crawler4j/parser/BinaryParseData.java @@ -44,7 +44,6 @@ public class BinaryParseData implements ParseData { private static final String DEFAULT_ENCODING = "UTF-8"; private static final String DEFAULT_OUTPUT_FORMAT = "html"; - private static final Metadata METADATA = new Metadata(); private static final Parser AUTO_DETECT_PARSER = new AutoDetectParser(); private static final SAXTransformerFactory SAX_TRANSFORMER_FACTORY = (SAXTransformerFactory) SAXTransformerFactory.newInstance(); @@ -61,7 +60,7 @@ public class BinaryParseData implements ParseData { try { TransformerHandler handler = getTransformerHandler(outputStream, DEFAULT_OUTPUT_FORMAT, DEFAULT_ENCODING); - AUTO_DETECT_PARSER.parse(inputStream, handler, METADATA, context); + AUTO_DETECT_PARSER.parse(inputStream, handler, new Metadata(), context); setHtml(new String(outputStream.toByteArray(), DEFAULT_ENCODING)); } catch (TransformerConfigurationException e) {
Issue <I>: TikaException is thrown while crawling several PDFs in a row The problem was the wrong re-use of the metadata
yasserg_crawler4j
train
java
02eb765a9c45fef7a925401381500d680d35d9af
diff --git a/src/Symfony/Component/Process/ExecutableFinder.php b/src/Symfony/Component/Process/ExecutableFinder.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Process/ExecutableFinder.php +++ b/src/Symfony/Component/Process/ExecutableFinder.php @@ -59,8 +59,7 @@ class ExecutableFinder if (is_dir($path)) { $dirs[] = $path; } else { - $file = str_replace(dirname($path), '', $path); - if ($file == $name && is_executable($path)) { + if (basename($path) == $name && is_executable($path)) { return $path; } }
[Process] Fixes issue #<I>
symfony_symfony
train
php
cc81422802700d0bea4a07ff9df8eccb633329e9
diff --git a/dist/ng-tiny-scrollbar.js b/dist/ng-tiny-scrollbar.js index <HASH>..<HASH> 100644 --- a/dist/ng-tiny-scrollbar.js +++ b/dist/ng-tiny-scrollbar.js @@ -159,7 +159,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. $element.on(wheelEvent, wheel); } - if (self.options.autoUpdate && MutationObserver) { + if (self.options.autoUpdate && typeof MutationObserver === 'function') { (function () { var recentWidth = $overview[0].offsetWidth, recentHeight = $overview[0].offsetHeight,
Update ng-tiny-scrollbar.js
yads_ngTinyScrollbar
train
js
b1fb410b98d6cee46bd7b97f4d90300158111dd0
diff --git a/hasc2gml/__init__.py b/hasc2gml/__init__.py index <HASH>..<HASH> 100644 --- a/hasc2gml/__init__.py +++ b/hasc2gml/__init__.py @@ -88,13 +88,20 @@ def createOutputGML(): newField = ogr.FieldDefn("value", ogr.OFTReal) outLayer.GetLayerDefn().AddFieldDefn(newField) - line = ogr.CreateGeometryFromWkt("POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))") - + polygon = ogr.CreateGeometryFromWkt("POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))") outFeature = ogr.Feature(feature_def=outLayer.GetLayerDefn()) - outFeature.SetGeometryDirectly(line) + outFeature.SetGeometryDirectly(polygon) outFeature.SetField("value", 100) outLayer.CreateFeature(outFeature) + +# Edge coordinates of an hexagon centered in (x,y) and a side of d: +# +# [x-d/2, y+sqrt(3)*d/2] [x+d/2, y+sqrt(3)*d/2] +# +# [x, y-d] [x, y+d] +# +# [x-d/2, y-sqrt(3)*d/2] [x+d/2, y-sqrt(3)*d/2] def readValues(file, line):
Included annotation with hexagon edge calculations.
ldesousa_hex-utils
train
py
594d554ffbed7456dc31badcb3411ce168842046
diff --git a/src/server/Uploader.js b/src/server/Uploader.js index <HASH>..<HASH> 100644 --- a/src/server/Uploader.js +++ b/src/server/Uploader.js @@ -229,11 +229,16 @@ class Uploader { this.emitError(error) return } + const headers = response.headers + // remove browser forbidden headers + delete headers['set-cookie'] + delete headers['set-cookie2'] + const respObj = { reponseText: body.toString(), status: response.statusCode, statusText: response.statusMessage, - headers: response.headers + headers } if (response.statusCode >= 400) {
remove forbidden headers from multipart response
transloadit_uppy-server
train
js
a8832574fa113e0673dcf9a51ece058b0a4cdcb5
diff --git a/searx/engines/reddit.py b/searx/engines/reddit.py index <HASH>..<HASH> 100644 --- a/searx/engines/reddit.py +++ b/searx/engines/reddit.py @@ -66,7 +66,10 @@ def response(resp): img_results.append(params) else: created = datetime.fromtimestamp(data['created_utc']) - params['content'] = escape(data['selftext']) + content = escape(data['selftext']) + if len(content) > 500: + content = content[:500] + '...' + params['content'] = content params['publishedDate'] = created text_results.append(params)
Shorten content field for very long Reddit search results
asciimoo_searx
train
py
7102f91aa2a2bfa8bad6f99ef7cc1bfd8393f7ff
diff --git a/support/build/php b/support/build/php index <HASH>..<HASH> 100755 --- a/support/build/php +++ b/support/build/php @@ -126,7 +126,6 @@ export PATH=${OUT_PREFIX}/bin:$PATH --enable-exif=shared \ --enable-ftp=shared \ --with-gd=shared \ - --enable-gd-native-ttf \ --with-freetype-dir=/usr \ --with-jpeg-dir=/usr \ --with-png-dir=/usr \
drop --enable-gd-native-ttf from php configure unused since PHP <I>, and causes warning in <I>
heroku_heroku-buildpack-php
train
php
32a3b92e3911aaede2cb6c4474d556fdfa8846f5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -34,9 +34,9 @@ kwargs = { 'PyYAML'], 'tests_require': [ 'flake8 >= 3.7', - 'flake8_class_newline', + 'flake8-class-newline', 'flake8_docstrings', - 'flake8_import_order', + 'flake8-import-order', 'pep8', 'pyflakes'], 'author': 'Dirk Thomas',
Un-normalize some test dependency package names (#<I>) It seems that these package names actually use hyphens and not underscores in the package name, but it typically "just works" because pip normalizes them.
ros-infrastructure_ros_buildfarm
train
py
2b68ef47a4ec9c358a3123761d8d3667c59e2cab
diff --git a/pandavro/__init__.py b/pandavro/__init__.py index <HASH>..<HASH> 100644 --- a/pandavro/__init__.py +++ b/pandavro/__init__.py @@ -3,6 +3,14 @@ import numpy as np import pandas as pd import six +try: + # Pandas <= 0.23 + from pandas.core.dtypes.dtypes import DatetimeTZDtypeType as DatetimeTZDtype +except ImportError: + # Pandas >= 0.24 + from pandas import DatetimeTZDtype + + # Pandas 0.24 added support for nullable integers. Include those in the supported # integer dtypes if present, otherwise ignore them. try:
Fix compatibility issue between Pandas versions
ynqa_pandavro
train
py
2c4afde6903d53dcabede93d87578171d03feef6
diff --git a/spyder/plugins/editor/widgets/editor.py b/spyder/plugins/editor/widgets/editor.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/editor/widgets/editor.py +++ b/spyder/plugins/editor/widgets/editor.py @@ -813,6 +813,9 @@ class EditorStack(QWidget): lambda: self, section=self.get_plugin_title()) + if isinstance(initial_text, bool): + initial_text = '' + self.switcher_dlg.set_search_text(initial_text) self.switcher_dlg.setup() self.switcher_dlg.show()
pyside: Fix “File switcher” in menu of editor’s tabbar See commit “pyside: Fix preferences modified by checkboxes” for details.
spyder-ide_spyder
train
py
abf5462bd83ec0045e59b1b97b20047afae55c95
diff --git a/lib/schedulers/ASAPScheduler.js b/lib/schedulers/ASAPScheduler.js index <HASH>..<HASH> 100644 --- a/lib/schedulers/ASAPScheduler.js +++ b/lib/schedulers/ASAPScheduler.js @@ -2,7 +2,7 @@ var TimeoutScheduler = require("./TimeoutScheduler"); // Retained for backwards compatibility function ASAPScheduler() { - return TimeoutScheduler.bind(this, 1)(); + return TimeoutScheduler.call(this, 1); } module.exports = ASAPScheduler;
PR feedback: ASAPScheduler ctor
Netflix_falcor
train
js
c284100fcb3dd5f7d27f937b49f9a75893f9de3c
diff --git a/lib/sg_postcode/converters/long_lat_converter.rb b/lib/sg_postcode/converters/long_lat_converter.rb index <HASH>..<HASH> 100644 --- a/lib/sg_postcode/converters/long_lat_converter.rb +++ b/lib/sg_postcode/converters/long_lat_converter.rb @@ -18,6 +18,12 @@ module SgPostcode postcodes.map { |postcode| place_info(postcode) } end + # Request info from host for a postcode + # + # @return hash of info, check + # response/config.rb to see the info fields + # + # @params: postcode number [String] def self.place_info(postcode) send_geo_request(postcode, host: :Google).data end
docs: add document for place_info method
ManagedApplicationServices_sg_postcode
train
rb
352904047ab1e25b048bf20c9d8af176924d4215
diff --git a/pysat/_instrument.py b/pysat/_instrument.py index <HASH>..<HASH> 100644 --- a/pysat/_instrument.py +++ b/pysat/_instrument.py @@ -637,7 +637,7 @@ class Instrument(object): # drop any possible duplicate index times #self.data.drop_duplicates(inplace=True) - self.data = self.data[~self.data.index.duplicated(keep='first')] + self.data = self.data[~self.data.index.duplicated()] # if self.pad is False, load single day else:
Removed keyword to DataFrame.index.duplicated that is failing on python <I> only. Value assigned to keyword is function default thus not required.
rstoneback_pysat
train
py
e1afcd106d136c6b3c9b0286afc8c1a151ec8003
diff --git a/src/Alarm.php b/src/Alarm.php index <HASH>..<HASH> 100644 --- a/src/Alarm.php +++ b/src/Alarm.php @@ -650,7 +650,7 @@ class Alarm "StartLocalTime" => $this->attributes["StartTime"], "Duration" => $this->attributes["Duration"], "Recurrence" => $this->attributes["Recurrence"], - "Enabled" => $this->attributes["Enabled"], + "Enabled" => $this->attributes["Enabled"] ? "1" : "0", "RoomUUID" => $this->attributes["RoomUUID"], "ProgramURI" => $this->attributes["ProgramURI"], "ProgramMetaData" => $this->attributes["ProgramMetaData"],
Ensure the alarm 'Enabled' attribute has the right format
duncan3dc_sonos
train
php
a230d1ef641b0caa411300a90f6b2d2abeca358c
diff --git a/aws/resource_aws_lb_ssl_negotiation_policy_test.go b/aws/resource_aws_lb_ssl_negotiation_policy_test.go index <HASH>..<HASH> 100644 --- a/aws/resource_aws_lb_ssl_negotiation_policy_test.go +++ b/aws/resource_aws_lb_ssl_negotiation_policy_test.go @@ -22,6 +22,7 @@ func TestAccAWSLBSSLNegotiationPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLBSSLNegotiationPolicyDestroy, Steps: []resource.TestStep{ @@ -47,6 +48,7 @@ func TestAccAWSLBSSLNegotiationPolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLBSSLNegotiationPolicyDestroy, Steps: []resource.TestStep{
tests/r/lb_ssl_negotiation_policy: Add ErrorCheck
terraform-providers_terraform-provider-aws
train
go
f58730c1bb95510475919784a1cafc2446099892
diff --git a/VDB/vdb_tests.php b/VDB/vdb_tests.php index <HASH>..<HASH> 100644 --- a/VDB/vdb_tests.php +++ b/VDB/vdb_tests.php @@ -19,6 +19,7 @@ class VDB_Tests extends F3instance { $this->set('DB',$db); $type .= ': '; + $db->dropTable('test'); // create table $cr_result = $db->createTable('test'); @@ -37,6 +38,17 @@ class VDB_Tests extends F3instance { $type.'cannot add a column' ); + // rename column + $result1 = $db->renameCol('test','title','title123'); + $this->expect( + $result1 == true && + in_array('title123',$db->getCols('test')) == true && + in_array('title',$db->getCols('test')) == false, + $type.'renaming column', + $type.'cannot rename a column' + ); + $result1 = $db->renameCol('test','title123','title'); + // remove column $result1 = $db->removeCol('test','title'); $this->expect(
VDB: added removeCol to test-suite
ikkez_f3-cortex
train
php
853340988178fa6ef56fcae1d7d116b248c5e0e7
diff --git a/tests/TestCase/ORM/QueryRegressionTest.php b/tests/TestCase/ORM/QueryRegressionTest.php index <HASH>..<HASH> 100644 --- a/tests/TestCase/ORM/QueryRegressionTest.php +++ b/tests/TestCase/ORM/QueryRegressionTest.php @@ -502,4 +502,23 @@ class QueryRegressionTest extends TestCase { $this->assertNull($result->user, 'No record should be null.'); } +/** + * Tests that using a comparison expression inside an OR condition works + * + * @see https://github.com/cakephp/cakephp/issues/5081 + * @return void + */ + public function testOrConditionsWithExpression() { + $table = TableRegistry::get('Articles'); + $query = $table->find(); + $query->where([ + 'OR' => [ + new \Cake\Database\Expression\Comparison('id', 1, 'integer', '>') + ] + ]); + + $results = $query->toArray(); + $this->assertCount(3, $results); + } + }
Adding failing test to prove #<I>
cakephp_cakephp
train
php
b8e787505aa9210e23f2336b9686b92d97322fac
diff --git a/safe/definitions.py b/safe/definitions.py index <HASH>..<HASH> 100644 --- a/safe/definitions.py +++ b/safe/definitions.py @@ -580,7 +580,7 @@ exposure_people_in_building = { 'key': 'people_in_building', 'name': tr('People in buildings'), 'description': tr( - 'The <b>people in buildings</b> exposure data assigns the population ' + '<b>People in buildings</b> exposure data assigns the population ' 'of a specific administrative area to the buildings with a ' 'residential function in that area. <p>The process of assigning ' 'people to buildings assumes that all people and buildings in the '
removed "the" before "people in buildings"
inasafe_inasafe
train
py
aea9d4d864a4050ac03f0bc21da0ff57f9a3009a
diff --git a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/TransformationOperationLoaderImpl.java b/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/TransformationOperationLoaderImpl.java index <HASH>..<HASH> 100644 --- a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/TransformationOperationLoaderImpl.java +++ b/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/TransformationOperationLoaderImpl.java @@ -46,7 +46,7 @@ public class TransformationOperationLoaderImpl implements TransformationOperatio public TransformationOperation loadTransformationOperationByName(String operationName) throws TransformationOperationException { return (TransformationOperation) service.getService(FilterUtils.makeFilter(TransformationOperation.class, - String.format("transformation.operation=%s", operationName))); + String.format("(transformation.operation=%s)", operationName))); } }
[OPENENGSB-<I>] fixed bug in the TransformationOperationLoader
openengsb_openengsb
train
java
9adf907116d0e081ca50b512f53b2379fcb7965c
diff --git a/sphinx_swagger/swaggerv2_doc.py b/sphinx_swagger/swaggerv2_doc.py index <HASH>..<HASH> 100644 --- a/sphinx_swagger/swaggerv2_doc.py +++ b/sphinx_swagger/swaggerv2_doc.py @@ -52,7 +52,7 @@ class SwaggerV2DocDirective(Directive): bullet_list = nodes.bullet_list() bullet_list += self.create_item('Description: ', method.get('description', '')) - bullet_list += self.create_item('Consumes: ', self.expand_values(method.get('consumer', ''))) + bullet_list += self.create_item('Consumes: ', self.expand_values(method.get('consumes', ''))) bullet_list += self.create_item('Produces: ', self.expand_values(method.get('produces', ''))) content += bullet_list
Solved problem with invalid tag name
unaguil_sphinx-swaggerdoc
train
py
88be52a753b4bbc00770f00f899dfa22fc571a43
diff --git a/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCUtils.java b/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCUtils.java index <HASH>..<HASH> 100644 --- a/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCUtils.java +++ b/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCUtils.java @@ -61,7 +61,7 @@ public class JDBCUtils // set autoCommit to true con.setAutoCommit(false); // make a savepoint (snapshot) - savePoint = con.setSavepoint(); + savePoint = con.setSavepoint(""); stmt = con.createStatement(); trs = stmt.executeQuery("SELECT count(*) FROM " + tableName); return trs.next();
EXOJCR-<I>: giving a name for savePoint.
exoplatform_jcr
train
java
8a6aa4b8f2a7d09a43bec9b2ab952e1d3362eb1a
diff --git a/commerce-product-service/src/main/java/com/liferay/commerce/product/service/impl/CProductLocalServiceImpl.java b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/impl/CProductLocalServiceImpl.java index <HASH>..<HASH> 100644 --- a/commerce-product-service/src/main/java/com/liferay/commerce/product/service/impl/CProductLocalServiceImpl.java +++ b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/impl/CProductLocalServiceImpl.java @@ -38,7 +38,7 @@ public class CProductLocalServiceImpl extends CProductLocalServiceBaseImpl { User user = userLocalService.getUser(userId); - validate(serviceContext.getCompanyId(), externalReferenceCode); + validate(user.getCompanyId(), externalReferenceCode); CProduct cProduct = cProductLocalService.createCProduct( counterLocalService.increment());
COMMERCE-<I> C<I> Pass correct companyId so validation will properly work
liferay_com-liferay-commerce
train
java
83d7f0023c56d9cfe52b5840608cdd6af077e858
diff --git a/parsl/executors/high_throughput/process_worker_pool.py b/parsl/executors/high_throughput/process_worker_pool.py index <HASH>..<HASH> 100755 --- a/parsl/executors/high_throughput/process_worker_pool.py +++ b/parsl/executors/high_throughput/process_worker_pool.py @@ -24,7 +24,7 @@ LOOP_SLOWDOWN = 0.0 # in seconds class Manager(object): - """ Manager (feudal lord) rules over the workers + """ Manager manages task execution by the workers 1. Asynchronously queue large volume of tasks 2. Allow for workers to join and leave the union
Fixing reference to feudal lord/daimyo
Parsl_parsl
train
py
a216c08989d96bee97b027089fe82c25b7907e39
diff --git a/stacker_blueprints/elasticsearch.py b/stacker_blueprints/elasticsearch.py index <HASH>..<HASH> 100644 --- a/stacker_blueprints/elasticsearch.py +++ b/stacker_blueprints/elasticsearch.py @@ -144,7 +144,7 @@ class Domain(Blueprint): "ElasticsearchVersion": variables["ElasticsearchVersion"], } - policy = self.create_access_policy() + policy = self.get_access_policy() if policy: params["AccessPolicies"] = policy @@ -180,7 +180,7 @@ class Domain(Blueprint): PolicyDocument=Policy(Statement=statements), Roles=variables["Roles"])) - def create_access_policy(self): + def get_access_policy(self): policy = None variables = self.get_variables() trusted_network = variables["TrustedNetwork"]
Rename create_access_policy -> get_access_policy By convention, "create_*" functions are used within blueprints to denote resources being added to the template.
remind101_stacker_blueprints
train
py
0a5a35d8dd0a038fdfa436537817aab6e833ffe2
diff --git a/js/assessor.js b/js/assessor.js index <HASH>..<HASH> 100644 --- a/js/assessor.js +++ b/js/assessor.js @@ -157,8 +157,8 @@ Assessor.prototype.executeAssessment = function( paper, researcher, assessment ) result.setScore( 0 ); result.setText( this.i18n.sprintf( - this.i18n.dgettext( "js-text-analysis", "An error occured in the '%1$s' assessment, " + - "the exact error can be found in the console." ), + /* translators: %1$s expands to the name of the assessment. */ + this.i18n.dgettext( "js-text-analysis", "An error occured in the '%1$s' assessment" ), assessment.identifier, assessmentError ) );
Make assessor error comment more user friendly
Yoast_YoastSEO.js
train
js
a9466d98abee9c8774a94043e80c8fdfb207b261
diff --git a/aws/resource_aws_cloud9_environment_ec2_test.go b/aws/resource_aws_cloud9_environment_ec2_test.go index <HASH>..<HASH> 100644 --- a/aws/resource_aws_cloud9_environment_ec2_test.go +++ b/aws/resource_aws_cloud9_environment_ec2_test.go @@ -430,6 +430,8 @@ resource "aws_cloud9_environment_ec2" "test" { func testAccAWSCloud9EnvironmentEc2SSMConfig(name, description, userName string) string { return testAccAWSCloud9EnvironmentEc2ConfigBase() + fmt.Sprintf(` +data "aws_partition" "current" {} + data "aws_iam_policy_document" "cloud9_ssm_access" { statement { effect = "Allow" @@ -451,7 +453,7 @@ resource "aws_iam_role" "cloud9_ssm_access" { } resource "aws_iam_role_policy_attachment" "cloud9_ssm_access" { - policy_arn = "arn:aws:iam::aws:policy/AWSCloud9SSMInstanceProfile" + policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/AWSCloud9SSMInstanceProfile" role = aws_iam_role.cloud9_ssm_access.name }
Fix hardcoded partition in test config
terraform-providers_terraform-provider-aws
train
go
0fa03fe8b82a865ff811889c6354df98cd4dd0b9
diff --git a/safe_qgis/plugin.py b/safe_qgis/plugin.py index <HASH>..<HASH> 100644 --- a/safe_qgis/plugin.py +++ b/safe_qgis/plugin.py @@ -275,13 +275,14 @@ class Plugin: # Create action for import OSM Dialog #-------------------------------------- self.actionImportDlg = QAction( - QIcon(':/plugins/inasafe/functions-table.png'), ## FIXME: need different icon - self.tr('InaSAFE Import Dialog'), + ## FIXME(gigih): need different icon + QIcon(':/plugins/inasafe/functions-table.png'), + self.tr('InaSAFE OpenStreetMap Downloader'), self.iface.mainWindow()) self.actionImportDlg.setStatusTip(self.tr( - 'Open InaSAFE Import Dialog')) + 'InaSAFE OpenStreetMap Downloader')) self.actionImportDlg.setWhatsThis(self.tr( - 'Open InaSAFE Import Dialog')) + 'InaSAFE OpenStreetMap Downloader')) QObject.connect(self.actionImportDlg, SIGNAL('triggered()'), self.showImportDlg)
change the text in QAction to InaSAFE OpenStreetMap Downloader'
inasafe_inasafe
train
py
d93b462e9cf66cd52a708d439e421c5388bad29e
diff --git a/helper/plugin/grpc_provider.go b/helper/plugin/grpc_provider.go index <HASH>..<HASH> 100644 --- a/helper/plugin/grpc_provider.go +++ b/helper/plugin/grpc_provider.go @@ -619,7 +619,9 @@ func (s *GRPCProviderServer) ReadDataSource(_ context.Context, req *proto.ReadDa resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) return resp, nil } - resp.State.Msgpack = newStateMP + resp.State = &proto.DynamicValue{ + Msgpack: newStateMP, + } return resp, nil }
helper/plugin: don't panic in ReadDataSource State
hashicorp_terraform
train
go
1df01084c8bea6c8c84970cdfadfc29660dc84f9
diff --git a/src/scripts/dataset/dataset.store.js b/src/scripts/dataset/dataset.store.js index <HASH>..<HASH> 100644 --- a/src/scripts/dataset/dataset.store.js +++ b/src/scripts/dataset/dataset.store.js @@ -998,7 +998,7 @@ let datasetStore = Reflux.createStore({ this.pollJob(jobId); // open job accordion - this.update({activeJob: app.id}); + this.update({activeJob: {app: app.label, version: app.version}}); }); } }
Ensure apps still open correctly after starting a new run
OpenNeuroOrg_openneuro
train
js
5795fc0ecba0802be15aa6bbe6924f5df13e4e26
diff --git a/lib/solargraph/source_map/mapper.rb b/lib/solargraph/source_map/mapper.rb index <HASH>..<HASH> 100644 --- a/lib/solargraph/source_map/mapper.rb +++ b/lib/solargraph/source_map/mapper.rb @@ -485,7 +485,6 @@ module Solargraph # @param position [Position] # @param directive [YARD::Tags::Directive] def process_directive position, directive - return # @todo Where should this stuff happen, dagnabbit? docstring = YARD::Docstring.parser.parse(directive.tag.text).to_docstring location = Location.new(@filename, Range.new(position, position)) case directive.tag.tag_name @@ -507,13 +506,6 @@ module Solargraph when 'domain' namespace = namespace_at(position) namespace.domains.push directive.tag.text - when 'macro' - # @todo There might not be anything to do for macros here. They - # should have already been associated to methods. (I don't know of - # a use case for macros that doesn't involve methods.) - nxt_pos = Position.new(position.line + 1, @code.lines[position.line + 1].length) - path_pin = get_named_path_pin(nxt_pos) - path_pin.macros.push directive end end
SourceMap::Mapper does not process macro directives.
castwide_solargraph
train
rb
fc4cc497485c42950f1c18fdb5c7eab4392d933e
diff --git a/troposphere/s3.py b/troposphere/s3.py index <HASH>..<HASH> 100644 --- a/troposphere/s3.py +++ b/troposphere/s3.py @@ -109,8 +109,23 @@ class LifecycleRule(AWSProperty): 'Prefix': (basestring, False), 'Status': (basestring, True), 'Transition': (LifecycleRuleTransition, False), + 'Transitions': ([LifecycleRuleTransition], False) } + def validate(self): + if 'Transition' in self.properties: + if 'Transitions' not in self.properties: + # aws moved from a single transition to a list of them + # and deprecated 'Transition', so let's just move it to + # the new property and not annoy the user. + self.properties['Transitions'] = [ + self.properties.pop('Transition')] + else: + raise ValueError( + 'Cannot specify both "Transition" and "Transitions" ' + 'properties on S3 Bucket Lifecycle Rule. Please use ' + '"Transitions" since the former has been deprecated.') + class LifecycleConfiguration(AWSProperty): props = {
Implement LifecycleRule Transitions property (#<I>)
cloudtools_troposphere
train
py
a2a203635f5b3b708aaecb22828ecdc900ac404c
diff --git a/lib/seo_params/alexa.rb b/lib/seo_params/alexa.rb index <HASH>..<HASH> 100644 --- a/lib/seo_params/alexa.rb +++ b/lib/seo_params/alexa.rb @@ -12,7 +12,12 @@ module SeoParams end def rank - rank = @response.css("popularity").attr("text").content().to_i + begin + rank = @response.css("popularity").attr("text").content().to_i + rescue + rank = nil + end + rank end def dmoz
Corrected error when no rank could be located
n0ne_seo_params
train
rb
2d42e1bace295cb286751790eac39c65a21c91ad
diff --git a/js/coinmate.js b/js/coinmate.js index <HASH>..<HASH> 100644 --- a/js/coinmate.js +++ b/js/coinmate.js @@ -310,7 +310,7 @@ module.exports = class coinmate extends Exchange { type = type.toLowerCase (); } const status = this.parseTransactionStatus (this.safeString (item, 'transferStatus')); - const id = this.safeString (item, 'transactionId'); + const id = this.safeString (item, 'transactionId'); return { 'id': id, 'timestamp': timestamp,
coinmate eslint trailing spaces
ccxt_ccxt
train
js
7175a63ef4d841b92268ca1d9a237e07e831dbfb
diff --git a/spyder/plugins/help/utils/sphinxify.py b/spyder/plugins/help/utils/sphinxify.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/help/utils/sphinxify.py +++ b/spyder/plugins/help/utils/sphinxify.py @@ -183,6 +183,10 @@ def sphinxify(docstring, context, buildername='html'): # docstrings if context['right_sphinx_version'] and context['math_on']: docstring = docstring.replace('\\\\', '\\\\\\\\') + # Needed to prevent MathJax render the '\*' red. + # Also the '\*' seems to actually by a simple '*' + # See spyder-ide/spyder#9785 + docstring = docstring.replace("\\*", "*") # Add a class to several characters on the argspec. This way we can # highlight them using css, in a similar way to what IPython does.
Help: Fix '\*' symbol in equations
spyder-ide_spyder
train
py
3b3021862317f01261d15fd46e36028b34d27f71
diff --git a/components/interp/interp-core/src/main/java/org/torquebox/interp/core/runtime_initialization.rb b/components/interp/interp-core/src/main/java/org/torquebox/interp/core/runtime_initialization.rb index <HASH>..<HASH> 100644 --- a/components/interp/interp-core/src/main/java/org/torquebox/interp/core/runtime_initialization.rb +++ b/components/interp/interp-core/src/main/java/org/torquebox/interp/core/runtime_initialization.rb @@ -30,8 +30,8 @@ module TorqueBox self.versions[:jruby] = VersionSpec.new( "${version.jruby}" ) unless ( logger.nil? ) - logger.info( "TorqueBox...#{self.versions[:jbossas]}" ) - logger.info( "JBossAS.....#{self.versions[:torquebox]}" ) + logger.info( "TorqueBox...#{self.versions[:torquebox]}" ) + logger.info( "JBossAS.....#{self.versions[:jbossas]}" ) logger.info( "JRuby.......#{self.versions[:jruby]}" ) end end
Swap version numbers to be more correcter.
torquebox_torquebox
train
rb
a2399064a77170a610dbb597483aae7a75ab749c
diff --git a/staging/src/k8s.io/legacy-cloud-providers/gce/gce_fake.go b/staging/src/k8s.io/legacy-cloud-providers/gce/gce_fake.go index <HASH>..<HASH> 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/gce/gce_fake.go +++ b/staging/src/k8s.io/legacy-cloud-providers/gce/gce_fake.go @@ -35,6 +35,7 @@ type TestClusterValues struct { SecondaryZoneName string ClusterID string ClusterName string + OnXPN bool } // DefaultTestClusterValues Creates a reasonable set of default cluster values @@ -74,8 +75,14 @@ func NewFakeGCECloud(vals TestClusterValues) *Cloud { projectID: vals.ProjectID, networkProjectID: vals.ProjectID, ClusterID: fakeClusterID(vals.ClusterID), + onXPN: vals.OnXPN, } c := cloud.NewMockGCE(&gceProjectRouter{gce}) gce.c = c return gce } + +// UpdateFakeGCECloud updates the fake GCE cloud with the specified values. Currently only the onXPN value is updated. +func UpdateFakeGCECloud(g *Cloud, vals TestClusterValues) { + g.onXPN = vals.OnXPN +}
Allow update of onXPN field in fake GCE clients.
kubernetes_kubernetes
train
go
abaa6f245965af6d01c7f6d166424c1dab23f84a
diff --git a/src/nodule/__tests__/index.test.js b/src/nodule/__tests__/index.test.js index <HASH>..<HASH> 100644 --- a/src/nodule/__tests__/index.test.js +++ b/src/nodule/__tests__/index.test.js @@ -18,7 +18,7 @@ describe("Nodule", () => { }); - test("A Nodule combines config from all loaders", () => { + test.skip("A Nodule combines config from all loaders", () => { const nodule = new Nodule({ name: 'test', debug: true,
Skip credstash tests for now
globality-corp_nodule-config
train
js
baabdb2bdfc7588728f933fe8c8f86225b573615
diff --git a/gwpy/timeseries/timeseries.py b/gwpy/timeseries/timeseries.py index <HASH>..<HASH> 100644 --- a/gwpy/timeseries/timeseries.py +++ b/gwpy/timeseries/timeseries.py @@ -35,7 +35,7 @@ from ..segments import Segment from ..signal import filter_design from ..signal.filter import sosfiltfilt from ..signal.fft import (registry as fft_registry, ui as fft_ui) -from ..signal.window import recommended_overlap, planck +from ..signal.window import (recommended_overlap, planck) from .core import (TimeSeriesBase, TimeSeriesBaseDict, TimeSeriesBaseList, as_series_dict_class) @@ -1439,7 +1439,6 @@ class TimeSeries(TimeSeriesBase): ---------- other : `TimeSeries` a `TimeSeries` whose set of time samples overlap with `self.times` - and whose unit and sample rate are compatible with those of `self` Returns ------- @@ -1453,8 +1452,7 @@ class TimeSeries(TimeSeriesBase): Examples -------- - It can often be useful to inject a known signal into a data stream. For - example, we can prepare one second of Gaussian noise: + We can prepare one second of Gaussian noise: >>> from numpy import random >>> from gwpy.timeseries import TimeSeries
Minor edits to docstring and import
gwpy_gwpy
train
py
0f8fcc04951f8f063887608fc3ebc08c14d61cf8
diff --git a/guake/guake_app.py b/guake/guake_app.py index <HASH>..<HASH> 100644 --- a/guake/guake_app.py +++ b/guake/guake_app.py @@ -733,7 +733,6 @@ class Guake(SimpleGladeApp): # The box was showed, but out of focus # Don't hide it, re-grab the focus to search entry box.search_entry.grab_focus() - box.block_notebook_on_button_press_id() else: box.show_search_box()
Fix multiple block on notebook on_button_press
Guake_guake
train
py
80d554f2e2813aea41b0889b39d8f30f648af1ad
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -283,7 +283,6 @@ def setup_package(): "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7",
Remove unsupported version [ci skip]
explosion_spaCy
train
py
9c244db8032434133bec7c9fca6ecb11e32e7d68
diff --git a/classes/fields/currency.php b/classes/fields/currency.php index <HASH>..<HASH> 100644 --- a/classes/fields/currency.php +++ b/classes/fields/currency.php @@ -335,13 +335,16 @@ class PodsField_Currency extends PodsField_Number { $decimal_handling = pods_v( static::$type . '_decimal_handling', $options, 'none' ); if ( 'none' !== $decimal_handling ) { $value_parts = explode( $dot, $value ); - if ( 'remove' === $decimal_handling ) { - array_pop( $value_parts ); - } elseif ( 'dash' === $decimal_handling ) { - array_pop( $value_parts ); - $value_parts[] = '-'; + // Make sure decimals are empty. + if ( isset( $value_parts[1] ) && ! (int) $value_parts[1] ) { + if ( 'remove' === $decimal_handling ) { + array_pop( $value_parts ); + } elseif ( 'dash' === $decimal_handling ) { + array_pop( $value_parts ); + $value_parts[] = '-'; + } + $value = implode( $dot, $value_parts ); } - $value = implode( $dot, $value_parts ); } return $value;
Make sure decimals are empty. Fixes #<I>
pods-framework_pods
train
php
5b95fdb10458be9aae9a58d8205516668fec4cf5
diff --git a/web/src/main/java/com/graphhopper/http/GraphHopperServlet.java b/web/src/main/java/com/graphhopper/http/GraphHopperServlet.java index <HASH>..<HASH> 100644 --- a/web/src/main/java/com/graphhopper/http/GraphHopperServlet.java +++ b/web/src/main/java/com/graphhopper/http/GraphHopperServlet.java @@ -195,7 +195,7 @@ public class GraphHopperServlet extends GHBaseServlet return rsp.getInstructions().createGPX(trackName, time, includeElevation, withRoute, withTrack, withWayPoints); } - String errorsToXML( List<Throwable> list ) + protected String errorsToXML( List<Throwable> list ) { try {
make error xml available for subclasses like in map matching
graphhopper_graphhopper
train
java
9b68d0186d5fd712ec6a353fe4edfb7732c3cbca
diff --git a/src/Console/Commands/QuerySchema.php b/src/Console/Commands/QuerySchema.php index <HASH>..<HASH> 100644 --- a/src/Console/Commands/QuerySchema.php +++ b/src/Console/Commands/QuerySchema.php @@ -5,6 +5,7 @@ namespace Thedevsaddam\LaravelSchema\Console\Commands; use Illuminate\Console\Command; use Illuminate\Support\Debug\Dumper; use Thedevsaddam\LaravelSchema\Schema\Schema; +use Symfony\Component\Console\Input\InputOption; class QuerySchema extends Command @@ -47,6 +48,12 @@ class QuerySchema extends Command */ public function performQuery() { + //change connection if provide + if ($this->option('c')) { + $this->schema->setConnection($this->option('c')); + $this->schema->switchWrapper(); + } + $rawQuery = $this->argument('rawQuery'); if (empty($rawQuery)) { $this->warn('Please provide raw sql query as string (in single/double quote)!'); @@ -60,4 +67,11 @@ class QuerySchema extends Command $this->info('Query executed successfully!'); } + protected function getOptions() + { + return [ + ['c', null, InputOption::VALUE_OPTIONAL, 'Connection name'], + ]; + } + } \ No newline at end of file
QuerySchema connection name taken as option
thedevsaddam_laravel-schema
train
php
e075d4d1c1e1aeb544d1d0a364415f23cc28f83c
diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index <HASH>..<HASH> 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -50,12 +50,13 @@ def pex_bdist( wheels_dir = os.path.join(pex_bdist_chroot, "wheels_dir") with atomic_directory(pex_bdist_chroot, exclusive=True) as chroot: if not chroot.is_finalized: - pex_pex = os.path.join(pex_bdist_chroot, "pex.pex") + pex_pex = os.path.join(chroot.work_dir, "pex.pex") run_pex_command( args=[pex_project_dir, "-o", pex_pex, "--include-tools"] ).assert_success() + extract_dir = os.path.join(chroot.work_dir, "wheels_dir") subprocess.check_call( - args=[pex_pex, "repository", "extract", "-f", wheels_dir], + args=[pex_pex, "repository", "extract", "-f", extract_dir], env=make_env(PEX_TOOLS=True), ) wheels = os.listdir(wheels_dir)
Fix the `pex_bdist` fixture. (#<I>) Previously this was flaky because the atomic directory was not actually being used.
pantsbuild_pex
train
py
c2c8d64202a69df85b4b244e81f493db09fd3ece
diff --git a/src/State.js b/src/State.js index <HASH>..<HASH> 100644 --- a/src/State.js +++ b/src/State.js @@ -230,6 +230,12 @@ State.prototype = { // Returns a new trace entry, with the currently active trace array as its children. getTraceEntry: function(pos, expr, succeeded, bindings) { + if (expr instanceof pexprs.Apply) { + var app = this.currentApplication(); + var actuals = app ? app.args : []; + expr = expr.substituteParams(actuals); + } + return this.getMemoizedTraceEntry(pos, expr) || new Trace(this.inputStream, pos, expr, succeeded, bindings, this.trace); },
subtitute args for apply when making trace entry
harc_ohm
train
js
3b74d3dd1b5501208388e4fbc9829fd45a412a85
diff --git a/src/system/modules/metamodels/MetaModelAttributeSimple.php b/src/system/modules/metamodels/MetaModelAttributeSimple.php index <HASH>..<HASH> 100644 --- a/src/system/modules/metamodels/MetaModelAttributeSimple.php +++ b/src/system/modules/metamodels/MetaModelAttributeSimple.php @@ -189,6 +189,17 @@ class MetaModelAttributeSimple extends MetaModelAttribute implements IMetaModelA $this->set('colname', $strBackupColName); } } + + /** + * {@inheritdoc} + */ + public function sortIds($arrIds, $strDirection) + { + // base implementation, do a simple sorting on given column. + $arrIds = Database::getInstance()->prepare('SELECT id FROM '.$this->objMetaModelTableName.' WHERE id IN ('.implode(',', $arrIds).') ORDER BY '.$this->arrData['colname'].' '.$strDirection)->execute()->fetchEach('id'); + return $arrIds; + } + } ?> \ No newline at end of file
Added simple sorting function for SimpleAttributes. The attribute column is used for the sorting.
MetaModels_core
train
php
cdc7c69d5c8f3c1ce7b10aac101034bc6638b25b
diff --git a/doc/source/conf.py b/doc/source/conf.py index <HASH>..<HASH> 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -51,8 +51,6 @@ extensions = [ 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', 'easydev.copybutton', - 'matplotlib.sphinxext.plot_directive', - 'matplotlib.sphinxext.only_directives', 'sphinx.ext.pngmath', ] # note that the numpy directives is buggy. Example: class and init are not recognised as two entities for the autoclass_content=both here below
simplify conf file for sphinx
cokelaer_reports
train
py
9c44c18cf2d474eec50b5255b5a5d43ba5e43502
diff --git a/dom/src/main/java/org/isisaddons/module/docx/dom/DocxService.java b/dom/src/main/java/org/isisaddons/module/docx/dom/DocxService.java index <HASH>..<HASH> 100644 --- a/dom/src/main/java/org/isisaddons/module/docx/dom/DocxService.java +++ b/dom/src/main/java/org/isisaddons/module/docx/dom/DocxService.java @@ -205,7 +205,7 @@ public class DocxService { throw new MergeException("unable to write to target file", e); } catch (final FileNotFoundException e) { throw new MergeException("unable to read back from target file", e); - } catch (final Exception e) { + } catch (final IOException e) { throw new MergeException("unable to generate output stream from temporary file", e); } }
fixing unit test (broken from most recent PR#2)... reinstating original behaviour
isisaddons-legacy_isis-module-docx
train
java
f3da0b529f1c35165c77061a72e70d8503b3d4eb
diff --git a/lib/ransack/helpers/form_helper.rb b/lib/ransack/helpers/form_helper.rb index <HASH>..<HASH> 100644 --- a/lib/ransack/helpers/form_helper.rb +++ b/lib/ransack/helpers/form_helper.rb @@ -59,10 +59,14 @@ module Ransack options.merge!( :q => search_params.merge(:s => "#{attr_name} #{new_dir}") ) - options.merge!(:use_route => routing_proxy) if routing_proxy + url = if routing_proxy + send(routing_proxy).url_for(options) + else + url_for(options) + end link_to [ERB::Util.h(name), order_indicator_for(current_dir)].compact.join(' ').html_safe, - url_for(options), + url, html_options end
Must explicitly call routing proxy method to get access to routes for engines. Cannot simply pass :use_route => :engine_name to params.
activerecord-hackery_ransack
train
rb
226c2d880acd23c2b74f3fd39e7018a67e6be9ed
diff --git a/parser.js b/parser.js index <HASH>..<HASH> 100644 --- a/parser.js +++ b/parser.js @@ -427,16 +427,18 @@ OptionsParser.prototype.help = function(opts, options) for(var optName in opts) { - // fit help text to column width - var helpText = this.fitString_(opts[optName].help || '', maxTextLength); - if(helpText == '' && options.skipEmpty) // skip empty help text? + var opt = opts[optName]; + if(!opt.help && options.skipEmpty) // skip empty help text? continue; + // fit help text to column width + var helpText = this.fitString_(opt.help || '', maxTextLength); + // create options help string - var varName = (opts[optName].flag !== true) ? " " + (opts[optName].varName || "VAL") : ""; + var varName = (opt.flag !== true) ? " " + (opt.varName || "VAL") : ""; var name = paddingLeft + (optName.length == 1 ? '-' : '--') + optName + varName; - if(opts[optName].short) - name += ', -' + opts[optName].short + varName; + if(opt.short) + name += ', -' + opt.short + varName; // output options and (first line of) help text var line = this.padString_(name, maxArgLength) + options.separator + helpText.shift();
Make .help function more readable Introduce opt variable to replace opts[optName] Change skipEmpty check to make it read better (no more weird but working '' == [] check)
janus-toendering_options-parser
train
js
77e2189fc827717808e079fd88f10ec88a36e880
diff --git a/classes/PodsField.php b/classes/PodsField.php index <HASH>..<HASH> 100644 --- a/classes/PodsField.php +++ b/classes/PodsField.php @@ -743,7 +743,6 @@ class PodsField { */ public function is_required( $options ) { return filter_var( pods_v( 'required', $options, false ), FILTER_VALIDATE_BOOLEAN ); - } /**
Update classes/PodsField.php
pods-framework_pods
train
php
5d99ec3753d3394f22fb4adbf6e7370e91adf9ee
diff --git a/lib/merge.js b/lib/merge.js index <HASH>..<HASH> 100644 --- a/lib/merge.js +++ b/lib/merge.js @@ -32,7 +32,7 @@ function _merge(options, target, ...sources) { // If array if (Array.isArray(source)) { if (clone) - target = cloneArray(source, clone); + target = cloneArray(source, clone, deep); else target = source; } // If object @@ -67,13 +67,13 @@ function _merge(options, target, ...sources) { return target; }; - const cloneArray = (source, cloneObjects) => { + const cloneArray = (source, cloneObjects, deep) => { if (cloneObjects) { // Clone object items - target = new Array(source.length); - source.forEach(function(v, i) { - target[i] = mergeValue(null, v, true); - }); + const target = new Array(source.length); + for (const [i, v] of source.entries()) { + target[i] = mergeValue(null, v, true, deep); + } return target; } return source.slice();
[-] Fixed a major bug in cloning arrays
panates_putil-merge
train
js
af34073a78a933aa556593fd3e2ceeb52acc3223
diff --git a/clustergrammer/__init__.py b/clustergrammer/__init__.py index <HASH>..<HASH> 100644 --- a/clustergrammer/__init__.py +++ b/clustergrammer/__init__.py @@ -18,7 +18,7 @@ from . import categories class Network(object): ''' - version 1.6.1 + version 1.7.0 Clustergrammer.py takes a matrix as input (either from a file of a Pandas DataFrame), normalizes/filters, hierarchically clusters, and produces the :ref:`visualization_json` for :ref:`clustergrammer_js`. diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from distutils.core import setup setup( name = 'clustergrammer', packages = ['clustergrammer'], # this must be the same as the name above - version = '1.6.1', + version = '1.7.0', description = 'A python module for the Clustergrammer visualization project', author = 'Nicolas Fernandez', author_email = '[email protected]',
version <I> added dendro_cat method to generate categories based on dendrogram groups
MaayanLab_clustergrammer-py
train
py,py
5c2c865fda432a96c887f1d4ae063535ba901f6d
diff --git a/allegedb/allegedb/window.py b/allegedb/allegedb/window.py index <HASH>..<HASH> 100644 --- a/allegedb/allegedb/window.py +++ b/allegedb/allegedb/window.py @@ -85,8 +85,8 @@ def within_history(rev, windowdict): if not windowdict: return False begin = windowdict._past[0][0] if windowdict._past else \ - windowdict._future[0][0] - end = windowdict._future[-1][0] if windowdict._future else \ + windowdict._future[-1][0] + end = windowdict._future[0][0] if windowdict._future else \ windowdict._past[-1][0] return begin <= rev <= end
Correct window.within_history(..) for the new stacks layout
LogicalDash_LiSE
train
py
2db518ad596fe5c30d00ae7a059b96c3103d6dbb
diff --git a/src/com/opencms/defaults/A_CmsBackoffice.java b/src/com/opencms/defaults/A_CmsBackoffice.java index <HASH>..<HASH> 100644 --- a/src/com/opencms/defaults/A_CmsBackoffice.java +++ b/src/com/opencms/defaults/A_CmsBackoffice.java @@ -931,6 +931,17 @@ public byte[] getContent(CmsObject cms, String templateFile, String elementName, //return var byte[] processResult = null; + // now check if the "do you really want to lock" dialog should be shown. + Hashtable startSettings = (Hashtable)cms.getRequestContext().currentUser().getAdditionalInfo(C_ADDITIONAL_INFO_STARTSETTINGS); + String showLockDialog = "on"; + if(startSettings!=null){ + showLockDialog = (String)startSettings.get(C_START_LOCKDIALOG); + } + if (!showLockDialog.equalsIgnoreCase("on")) { + parameters.put("action","go"); + } + + // session will be created or fetched I_CmsSession session = (CmsSession) cms.getRequestContext().getSession(true); //get the class of the content definition
Backoffice module now use the dialog enabling/disabling of the workplace
alkacon_opencms-core
train
java
9551862a95a563b6f4a59fcafe857cde70d868a7
diff --git a/tests/methods/ParseTest.php b/tests/methods/ParseTest.php index <HASH>..<HASH> 100644 --- a/tests/methods/ParseTest.php +++ b/tests/methods/ParseTest.php @@ -132,7 +132,7 @@ class ParseTest extends PHPUnit\Framework\TestCase { * @depends testSepRowAutoDetection */ public function testGetColumnDatatypes() { - $this->csv->auto('tests/methods/fixtures/datatype.csv'); + $this->csv->auto(__DIR__ . '/fixtures/datatype.csv'); $this->csv->getDatatypes(); $expected = [ 'title' => 'string',
Allow current working dir to be different when running tests ...By using an absolute path
parsecsv_parsecsv-for-php
train
php
14c53160d7477813839f6996cf340004ebe335c5
diff --git a/daemon/execdriver/windows/run.go b/daemon/execdriver/windows/run.go index <HASH>..<HASH> 100644 --- a/daemon/execdriver/windows/run.go +++ b/daemon/execdriver/windows/run.go @@ -240,7 +240,8 @@ func (d *Driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, hooks execd if !strings.Contains(err.Error(), `Win32 API call returned error r1=0x800401f3`) && // Invalid class string !strings.Contains(err.Error(), `Win32 API call returned error r1=0x80070490`) && // Element not found !strings.Contains(err.Error(), `Win32 API call returned error r1=0x80070002`) && // The system cannot find the file specified - !strings.Contains(err.Error(), `Win32 API call returned error r1=0x800704c6`) { // The network is not present or not started + !strings.Contains(err.Error(), `Win32 API call returned error r1=0x800704c6`) && // The network is not present or not started + !strings.Contains(err.Error(), `Win32 API call returned error r1=0x800700a1`) { // The specified path is invalid logrus.Debugln("Failed to create temporary container ", err) return execdriver.ExitStatus{ExitCode: -1}, err }
Windows CI: One more reliability hack
moby_moby
train
go
86a8204aee93997477d75fe5b372636232069e48
diff --git a/nfc/llcp/pdu.py b/nfc/llcp/pdu.py index <HASH>..<HASH> 100644 --- a/nfc/llcp/pdu.py +++ b/nfc/llcp/pdu.py @@ -37,6 +37,20 @@ class Parameter: VERSION, MIUX, WKS, LTO, RW, SN, OPT, SDREQ, SDRES = range(1, 10) class ProtocolDataUnit(object): + Symmetry = 0b0000 + ParameterExchange = 0b0001 + AggregatedFrame = 0b0010 + UnnumberedInformation = 0b0011 + Connect = 0b0100 + Disconnect = 0b0101 + ConnectionComplete = 0b0110 + DisconnectedMode = 0b0111 + FrameReject = 0b1000 + ServiceNameLookup = 0b1001 + Information = 0b1100 + ReceiveReady = 0b1101 + ReceiveNotReady = 0b1110 + def __init__(self, ptype, dsap, ssap): self.type = ptype self.dsap = dsap
fixed: poll('recv') returned true when data link connection was closed
nfcpy_nfcpy
train
py
a2b4e03db192ef77cc4603e7b3a4bc7ceb3959ec
diff --git a/lib/opal/parser.rb b/lib/opal/parser.rb index <HASH>..<HASH> 100644 --- a/lib/opal/parser.rb +++ b/lib/opal/parser.rb @@ -897,7 +897,7 @@ module Opal result = dispatch else call_recv = s(:js_tmp, tmprecv || recv_code) - arglist.insert 1, call_recv if tmpfunc + arglist.insert 1, call_recv if tmpfunc and !splat args = process arglist, :expr dispatch = if tmprecv
Fix bugs in parsing splats and blocks together
opal_opal
train
rb
297d4f7587dd4522430ded6d367ab6cc5dd46857
diff --git a/holoviews/interface/collector.py b/holoviews/interface/collector.py index <HASH>..<HASH> 100644 --- a/holoviews/interface/collector.py +++ b/holoviews/interface/collector.py @@ -9,7 +9,7 @@ import numpy as np import param from ..core import Dimension, ViewableElement, NdMapping, UniformNdMapping,\ - AxisLayout, LayoutTree, HoloMap + AxisLayout, AttrTree, LayoutTree, HoloMap from ..element.raster import Matrix from ..ipython.widgets import RunProgress, ProgressBar @@ -527,7 +527,7 @@ class Collator(NdMapping): -class Collector(LayoutTree): +class Collector(AttrTree): """ A Collector specifies a template for how to populate a LayoutTree with data over time. Two methods are used to schedule data
Reverted Collector superclass to AttrTree
pyviz_holoviews
train
py
f91b4702f5d43c0703520b81452133f8ba4bd3e2
diff --git a/lib/ladder/file.rb b/lib/ladder/file.rb index <HASH>..<HASH> 100644 --- a/lib/ladder/file.rb +++ b/lib/ladder/file.rb @@ -27,7 +27,6 @@ module Ladder::File self.id = attrs[:id] || attrs[:_id] || BSON::ObjectId.new @readable ||= attrs[:readable] || StringIO.new(attrs[:data].to_s) - @file = attrs[:file] end ## @@ -38,11 +37,17 @@ module Ladder::File ## # Output content of object from stored file or readable input - def dump(*opts) + def data(*opts) @readable.rewind @file ? @file.data(*opts) : @readable.read end + ## + # Id-based object comparison + def ==(object) + self.id == object.id + end + module ClassMethods ## diff --git a/test.rb b/test.rb index <HASH>..<HASH> 100644 --- a/test.rb +++ b/test.rb @@ -12,5 +12,9 @@ class Test end t = Test.new data: 'this is a test' +t.save +t.save # shouldn't do anything + +t2 = Test.find t.id binding.pry \ No newline at end of file
Consistency in #data accessor; comparison method
ladder_ladder
train
rb,rb
b9a8c7206d3a8af01b379f7b3390825b923bc3d7
diff --git a/mod/scorm/report.php b/mod/scorm/report.php index <HASH>..<HASH> 100755 --- a/mod/scorm/report.php +++ b/mod/scorm/report.php @@ -165,7 +165,7 @@ if (empty($currentgroup)) { // all users who can attempt scoes if (!$students = get_users_by_capability($contextmodule, 'mod/scorm:savetrack','','','','','','',false)){ - notify(get_string('nostudentsyet')); + echo $OUTPUT->notification(get_string('nostudentsyet')); $nostudents = true; $allowedlist = ''; } else { @@ -174,7 +174,7 @@ } else { // all users who can attempt scoes and who are in the currently selected group if (!$groupstudents = get_users_by_capability($context, 'mod/scorm:savetrack','','','','',$currentgroup,'',false)){ - notify(get_string('nostudentsingroup')); + echo $OUTPUT->notification(get_string('nostudentsingroup')); $nostudents = true; $groupstudents = array(); }
mod-scorm MDL-<I> Fixed up calls to deprecated function notice
moodle_moodle
train
php
43809cfe619633b18167d1c511858f46136b2fec
diff --git a/bcbio/variation/coverage_experimental.py b/bcbio/variation/coverage_experimental.py index <HASH>..<HASH> 100644 --- a/bcbio/variation/coverage_experimental.py +++ b/bcbio/variation/coverage_experimental.py @@ -1,5 +1,6 @@ import os import pandas as pd +import pybedtools import numpy as np @@ -13,6 +14,8 @@ from bcbio import broad from bcbio.pipeline import config_utils from bcbio.variation import vcfutils +def _silence_run(cmd): + do._do_run(cmd, False) def checkpoint(stem): def check_file(f):
Fix pybedtool deps in coverage report
bcbio_bcbio-nextgen
train
py
4fcfb45373475555f85180ecf258247dbff27a86
diff --git a/core/workers/loadCandles/parent.js b/core/workers/loadCandles/parent.js index <HASH>..<HASH> 100644 --- a/core/workers/loadCandles/parent.js +++ b/core/workers/loadCandles/parent.js @@ -56,7 +56,9 @@ module.exports = (config, callback) => { // else we are done and have candles! done(null, m); - this.disconnect(); + if (this.connected) { + this.disconnect(); + } }); child.on('exit', code => {
[BUGFIX] Fixes IPC disconnected error (#<I>) Fixes the Error: IPC channel is already disconnected which is happening when we are trying to disconnect an already disconnected process
askmike_gekko
train
js
81f8184c1764b58ce8f4e8f985b40f1299fe893a
diff --git a/src/main/java/org/dita/dost/writer/ImageMetadataFilter.java b/src/main/java/org/dita/dost/writer/ImageMetadataFilter.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/dita/dost/writer/ImageMetadataFilter.java +++ b/src/main/java/org/dita/dost/writer/ImageMetadataFilter.java @@ -238,6 +238,9 @@ public final class ImageMetadataFilter extends AbstractXMLFilter { in.close(); } } + } catch (ArrayIndexOutOfBoundsException e) { + // Know issue when reading JPEG metadata + logger.error("Failed to read image " + imgInput + " metadata: " + e.getMessage(), e); } catch (final RuntimeException e) { throw e; } catch (final Exception e) {
Catch exception from reading JPEG image #<I>
dita-ot_dita-ot
train
java
35161e83ef4044e96f815d9a427d011b0d7a467f
diff --git a/lib/tumblife/version.rb b/lib/tumblife/version.rb index <HASH>..<HASH> 100644 --- a/lib/tumblife/version.rb +++ b/lib/tumblife/version.rb @@ -1,3 +1,3 @@ class Tumblife - VERSION = "0.3.0" + VERSION = "0.3.1" end
Version bump to <I>.
mitukiii_tumblife-for-ruby
train
rb
cfb4cd6b9ffc1e13f15f6730481cc27b3f2d04c0
diff --git a/src/system/modules/metamodels/MetaModels/Dca/Dca.php b/src/system/modules/metamodels/MetaModels/Dca/Dca.php index <HASH>..<HASH> 100644 --- a/src/system/modules/metamodels/MetaModels/Dca/Dca.php +++ b/src/system/modules/metamodels/MetaModels/Dca/Dca.php @@ -302,7 +302,7 @@ class Dca extends \Backend $objDC->field, $objDC->inputName, $objDC->id, - $GLOBALS['TL_LANG']['tl_metamodel_rendersettings']['panelpicker'], + $GLOBALS['TL_LANG']['tl_metamodel_dca']['panelpicker'], $objDC->id, $this->generateImage( 'system/modules/metamodels/html/panel_layout.png',
Panelpicker translation #<I>
MetaModels_core
train
php
61d33e4e05f3fc8209ad9aab81fb7bb5baf4edef
diff --git a/webpack.config.js b/webpack.config.js index <HASH>..<HASH> 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -181,7 +181,7 @@ function getWebpackConfig( { }, runtimeChunk: codeSplit ? { name: 'manifest' } : false, moduleIds: 'named', - chunkIds: isDevelopment ? 'named' : 'natural', + chunkIds: isDevelopment || shouldEmitStats ? 'named' : 'natural', minimize: shouldMinify, minimizer: Minify( { cache: process.env.CIRCLECI
Use named chunks when computing stats, to get stable chunk names (#<I>)
Automattic_wp-calypso
train
js
12ddad53b15d38bf24f47364a8020173c7bfe96b
diff --git a/netmiko/cisco/cisco_tp_tcce.py b/netmiko/cisco/cisco_tp_tcce.py index <HASH>..<HASH> 100644 --- a/netmiko/cisco/cisco_tp_tcce.py +++ b/netmiko/cisco/cisco_tp_tcce.py @@ -1,10 +1,10 @@ -""" -CiscoTpTcCeSSH Class -Class to manage Cisco Telepresence Endpoint on TC/CE software release. Also working for Cisco Expressway/VCS -2017-03-05 v0.2 -written by Ahmad BARRIN """ +CiscoTpTcCeSSH Class +Class to manage Cisco Telepresence Endpoint on TC/CE software release. Also working for Cisco +Expressway/VCS +Written by Ahmad Barrin +""" from __future__ import unicode_literals import re
Cleaning up pylama
ktbyers_netmiko
train
py
8909da85aecfc035d53e9c64711be87b9ea0e847
diff --git a/backup/util/ui/backup_moodleform.class.php b/backup/util/ui/backup_moodleform.class.php index <HASH>..<HASH> 100644 --- a/backup/util/ui/backup_moodleform.class.php +++ b/backup/util/ui/backup_moodleform.class.php @@ -19,12 +19,16 @@ * This file contains the generic moodleform bridge for the backup user interface * as well as the individual forms that relate to the different stages the user * interface can exist within. - * + * * @package moodlecore * @copyright 2010 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +defined('MOODLE_INTERNAL') || die(); + +require_once($CFG->libdir . '/formslib.php'); + /** * Backup moodleform bridge * @@ -294,4 +298,4 @@ class backup_confirmation_form extends backup_moodleform { return $errors; } -} \ No newline at end of file +}
NOBUG forms - formslib isn't available everywhere anymore. Add it when necessary!
moodle_moodle
train
php
90c79fe928b2002d2ff807e8a44a55ad0aff9ed9
diff --git a/treeherder/log_parser/crossreference.py b/treeherder/log_parser/crossreference.py index <HASH>..<HASH> 100644 --- a/treeherder/log_parser/crossreference.py +++ b/treeherder/log_parser/crossreference.py @@ -94,7 +94,7 @@ def failure_line_summary(formatter, failure_line): """ if failure_line.action == "test_result": action = "test_status" if failure_line.subtest is not None else "test_end" - elif failure_line.action == "truncated": + elif failure_line.action in ["test_groups", "truncated"]: return else: action = failure_line.action
Bug <I> - Ignore 'test_groups' data from errorsummary.log. (#<I>) The 'test_groups' data got added in [bug <I>](<URL>) to track which test manifests contributed tests to the current task. It is not needed as part of the test output and should be ignored.
mozilla_treeherder
train
py
05d2230015e085cba408474539f997f7fecd2f91
diff --git a/tests/utils.py b/tests/utils.py index <HASH>..<HASH> 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -12,12 +12,12 @@ TEST_DIR = abspath(dirname(__file__)) def load_snippet(file_name): """Helper to fetch in the content of a test snippet.""" file_path = join(TEST_DIR, "data/snippets", file_name) - with open(file_path) as file: + with open(file_path, "rb") as file: return file.read() def load_article(file_name): """Helper to fetch in the content of a test article.""" file_path = join(TEST_DIR, "data/articles", file_name) - with open(file_path) as file: + with open(file_path, "rb") as file: return file.read()
Load articles/snippets as binary strings
bookieio_breadability
train
py
9becf40098978cd95714293814651dfda43fc38f
diff --git a/lib/cli/generators/ANGULAR/index.js b/lib/cli/generators/ANGULAR/index.js index <HASH>..<HASH> 100644 --- a/lib/cli/generators/ANGULAR/index.js +++ b/lib/cli/generators/ANGULAR/index.js @@ -1,9 +1,10 @@ import mergeDirs from 'merge-dirs'; import path from 'path'; -import { getVersion, getPackageJson, writePackageJson } from '../../lib/helpers'; +import { /* getVersion, */ getPackageJson, writePackageJson } from '../../lib/helpers'; export default async () => { - const version = await getVersion('@storybook/angular'); + // Mocking @storybook/angular version for the time being + const version = await Promise.resolve('3.3.0-alpha.2'); // getVersion('@storybook/angular'); mergeDirs(path.resolve(__dirname, 'template'), '.', 'overwrite'); const packageJson = getPackageJson();
Mocking @storybook/angular version for the time being
storybooks_storybook
train
js
977f6607ead1f731f17b80d8d69333837783ba99
diff --git a/src/sap.m/src/sap/m/NavContainer.js b/src/sap.m/src/sap/m/NavContainer.js index <HASH>..<HASH> 100644 --- a/src/sap.m/src/sap/m/NavContainer.js +++ b/src/sap.m/src/sap/m/NavContainer.js @@ -500,7 +500,7 @@ sap.ui.define(['jquery.sap.global', './library', 'sap/ui/core/Control', 'sap/ui/ // set focus to first focusable object // when NavContainer is inside a popup, the focus is managed by the popup and shouldn't be set here - if (!this.$().closest('[data-sap-ui-popup]').length) { + if (!this.$().closest('[data-sap-ui-area="sap-ui-static"]').length) { var focusObject = jQuery.sap.byId(pageId).firstFocusableDomRef(); if (focusObject) { jQuery.sap.focus(focusObject);
[INTERNAL] sap.m.NavContainer: continued fix of I<I>c<I> Change-Id: I6be2cb<I>d<I>c8cb4b1b<I>c3eb3ee6
SAP_openui5
train
js
72da553ed95bc820a827b680cd341fae20f4f79f
diff --git a/types/block_test.go b/types/block_test.go index <HASH>..<HASH> 100644 --- a/types/block_test.go +++ b/types/block_test.go @@ -2,6 +2,7 @@ package types import ( "testing" + "time" "github.com/stretchr/testify/require" crypto "github.com/tendermint/go-crypto" @@ -65,6 +66,7 @@ func makeCommit(blockID BlockID, height int64, round int, Round: round, Type: VoteTypePrecommit, BlockID: blockID, + Timestamp: time.Now().UTC(), } // all sign
add missing Timestamp to Vote Fixes #<I>
tendermint_tendermint
train
go
28397f88241322ab56a9434b76afe80c91cc8baf
diff --git a/model/labels_test.go b/model/labels_test.go index <HASH>..<HASH> 100644 --- a/model/labels_test.go +++ b/model/labels_test.go @@ -119,6 +119,14 @@ func TestLabelNameIsValid(t *testing.T) { ln: "a lid_23name", valid: false, }, + { + ln: ":leading_colon", + valid: false, + }, + { + ln: "colon:in:the:middle", + valid: false, + }, } for _, s := range scenarios {
Add tests for colons in label names
prometheus_common
train
go
8c9585540a3e71f73ebc281445e888aa841824bd
diff --git a/torchvision/models/detection/rpn.py b/torchvision/models/detection/rpn.py index <HASH>..<HASH> 100644 --- a/torchvision/models/detection/rpn.py +++ b/torchvision/models/detection/rpn.py @@ -37,7 +37,8 @@ class AnchorGenerator(nn.Module): image sizes. The module support computing anchors at multiple sizes and aspect ratios - per feature map. + per feature map. This module assumes aspect ratio = height / width for + each anchor. sizes and aspect_ratios should have the same number of elements, and it should correspond to the number of feature maps. @@ -74,6 +75,7 @@ class AnchorGenerator(nn.Module): # TODO: https://github.com/pytorch/pytorch/issues/26792 # For every (aspect_ratios, scales) combination, output a zero-centered anchor with those values. # (scales, aspect_ratios) are usually an element of zip(self.scales, self.aspect_ratios) + # This method assumes aspect ratio = height / width for an anchor. def generate_anchors(self, scales, aspect_ratios, dtype=torch.float32, device="cpu"): # type: (List[int], List[float], int, Device) # noqa: F821 scales = torch.as_tensor(scales, dtype=dtype, device=device)
Add docs to clarify aspect ratio definition. (#<I>)
pytorch_vision
train
py
fce700b259cb6e5ccaf77f021e1d5b0ed0e3baa2
diff --git a/lib/premailer-rails3/premailer.rb b/lib/premailer-rails3/premailer.rb index <HASH>..<HASH> 100644 --- a/lib/premailer-rails3/premailer.rb +++ b/lib/premailer-rails3/premailer.rb @@ -11,10 +11,10 @@ module PremailerRails ::Premailer.send(:include, Adapter.find(Adapter.use)) doc = load_html(html) - options = { + options = PremailerRails3.config.merge( :with_html_string => true, :css_string => CSSHelper.css_for_doc(doc) - } + ) super(html, options) end end diff --git a/spec/premailer-rails3/premailer_spec.rb b/spec/premailer-rails3/premailer_spec.rb index <HASH>..<HASH> 100644 --- a/spec/premailer-rails3/premailer_spec.rb +++ b/spec/premailer-rails3/premailer_spec.rb @@ -31,5 +31,11 @@ describe PremailerRails::Premailer do PremailerRails::CSSHelper.expects(:css_for_doc) PremailerRails::Premailer.new('some html') end + + it 'should pass on the configs' do + PremailerRails3.config = { :foo => :bar } + premailer = PremailerRails::Premailer.new('some html') + premailer.instance_variable_get(:'@options')[:foo].should == :bar + end end end
Pass the configs to premailer
fphilipe_premailer-rails
train
rb,rb
21224e98f3a13c29543b984f0be495ed4f31c6bc
diff --git a/commerce-account-service/src/main/java/com/liferay/commerce/account/service/impl/CommerceAccountGroupLocalServiceImpl.java b/commerce-account-service/src/main/java/com/liferay/commerce/account/service/impl/CommerceAccountGroupLocalServiceImpl.java index <HASH>..<HASH> 100644 --- a/commerce-account-service/src/main/java/com/liferay/commerce/account/service/impl/CommerceAccountGroupLocalServiceImpl.java +++ b/commerce-account-service/src/main/java/com/liferay/commerce/account/service/impl/CommerceAccountGroupLocalServiceImpl.java @@ -157,6 +157,11 @@ public class CommerceAccountGroupLocalServiceImpl deleteCommerceAccountGroupCommerceAccountRelByCAccountGroupId( commerceAccountGroup.getCommerceAccountGroupId()); + // Commerce account group generic rels + + commerceAccountGroupRelLocalService.deleteCommerceAccountGroupRels( + commerceAccountGroup.getCommerceAccountGroupId()); + // Commerce account group commerceAccountGroupPersistence.remove(commerceAccountGroup);
COMMERCE-<I> AccountGroupRels should be deleted with the AccountGroup
liferay_com-liferay-commerce
train
java
6eee3525523a0bb7fb0bacd3f2024c18ff24ca1f
diff --git a/modules/cms/controllers/DefaultController.php b/modules/cms/controllers/DefaultController.php index <HASH>..<HASH> 100644 --- a/modules/cms/controllers/DefaultController.php +++ b/modules/cms/controllers/DefaultController.php @@ -53,6 +53,10 @@ class DefaultController extends \cms\base\Controller $link = Yii::$app->links->findOneByArguments(['lang_id' => $this->getLangId(), 'url' => $activeUrl]); + if (!$link) { + throw new NotFoundHttpException("The page '$activeUrl' does not exist in this language."); + } + // set the $activeUrl based on the suffix, cause the modul params are not part of the links component. Yii::$app->links->activeUrl = $suffix;
throw <I> not found exception when page does not exist for the provided language closes #<I>.
luyadev_luya
train
php
25241a734759da1f5ecbdf606c9cc124bb41f98d
diff --git a/api/src/main/java/javax/resource/spi/Connector.java b/api/src/main/java/javax/resource/spi/Connector.java index <HASH>..<HASH> 100644 --- a/api/src/main/java/javax/resource/spi/Connector.java +++ b/api/src/main/java/javax/resource/spi/Connector.java @@ -46,6 +46,14 @@ public @interface Connector { /** + * Specifies the name of the resource adapter module. If the moduleName + * annotation element is not specified, the application server must + * follow the requirements in the Java Platform, Enterprise Edition + * (Java EE) Specification to determine the default moduleName. + */ + String moduleName() default ""; + + /** * Describes the resource adapter module. */ String[] description() default { };
[JBJCA-<I>] Merge API changes from JCA <I> (<I>)
ironjacamar_ironjacamar
train
java
2801fd91efede88f9e94719d18cc2ca54a34775b
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -58,9 +58,16 @@ function proxy(callback) { rulesUtil.addValues(config.values, config.replaceExistValue); rulesUtil.addRules(config.rules, config.replaceExistRule); config.debug && rules.disableDnsCache(); + var count = 2; + var execCallback = function() { + if (--count === 0 &&typeof callback === 'function') { + callback.call(server, proxyEvents); + } + }; + server.listen(config.port, execCallback); require('../biz/init')(proxyEvents, function(){ server.on('request', app); - server.listen(config.port, callback); + execCallback(); }); return proxyEvents; }
feat: Support for getting random port of ui server
avwo_whistle
train
js
eed96850de2cbcef27d0232a9df877fe581b6312
diff --git a/lib/json_builder/compiler.rb b/lib/json_builder/compiler.rb index <HASH>..<HASH> 100644 --- a/lib/json_builder/compiler.rb +++ b/lib/json_builder/compiler.rb @@ -45,8 +45,8 @@ module JSONBuilder def initialize(options={}) @_members = [] @_scope = options[:scope] - @_callback = options[:callback] || true - @_pretty_print = options[:pretty] || false + @_callback = options.has_key?(:callback) ? options[:callback] : true + @_pretty_print = options.has_key?(:pretty) ? options[:pretty] : false # Only copy instance variables if there is a scope and presence of Rails copy_instance_variables_from(@_scope) if @_scope
Fixed issue where it was impossible to turn off JSON callback wrapping
dewski_json_builder
train
rb
7c21458b793444508ec2497417aa09a6b1388747
diff --git a/generators/app/templates/gulpfile.js b/generators/app/templates/gulpfile.js index <HASH>..<HASH> 100644 --- a/generators/app/templates/gulpfile.js +++ b/generators/app/templates/gulpfile.js @@ -49,9 +49,9 @@ function watch(done) { ], gulp.series('styles')); <% } -%> <% if (modules === 'inject') { -%> - gulp.watch(conf.path.src('/app/**/*.<%- extensions.js %>'), gulp.series('inject')); + gulp.watch(conf.path.src('**/*.<%- extensions.js %>'), gulp.series('inject')); <% } else if (modules === 'systemjs') { -%> - gulp.watch(conf.path.src('/app/**/*.<%- extensions.js %>'), gulp.series('scripts')); + gulp.watch(conf.path.src('**/*.<%- extensions.js %>'), gulp.series('scripts')); <% } -%> done(); }
Watch js files in src/
FountainJS_generator-fountain-gulp
train
js
fed08244c173342066dd454a6127d4758b5fd53a
diff --git a/src/mixin.js b/src/mixin.js index <HASH>..<HASH> 100644 --- a/src/mixin.js +++ b/src/mixin.js @@ -178,6 +178,20 @@ function _clone(dest, src, ctor, filter) { } } +function cloneCtor(dest, src, ctor, filter) { + var filterFn = function (name, value) { + for (var n of [ 'length', 'name', 'arguments', 'caller', 'prototype' ]) { + if (n === name) { + value = void 0; + break; + } + if (value !== void 0) value = filter(name, value); + } + return value; + } + _clone(dest, src, ctor, filterFn); +} + //clone src(superCtor) to dest(MixinCtor) function clonePrototype(dest, src, ctor, filter) { // filter = _getFilterFunc(filter); @@ -292,6 +306,7 @@ function mixin(ctor, superCtor, options) { } mixinCtors.push(superCtor);//quickly check in isMixinedFrom. var filterFn = _getFilterFunc(options && options.filter); + cloneCtor(mixinCtor, superCtor, ctor, filterFn); clonePrototype(mixinCtor, superCtor, ctor, filterFn); inheritsDirectly(ctor, mixinCtor); result = true;
feat(mixin): clone the static properties and methods to the class
snowyu_inherits-ex.js
train
js
643c412eac22b30004a9959c01a6841a7691af73
diff --git a/commandreporter/command_reporter_test.go b/commandreporter/command_reporter_test.go index <HASH>..<HASH> 100644 --- a/commandreporter/command_reporter_test.go +++ b/commandreporter/command_reporter_test.go @@ -66,6 +66,7 @@ var _ = Describe("CommandReporter", func() { reporter = commandreporter.NewCommandReporter(writer) t = time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC) timestampRegex = "\\[2009-11-10 23:00:00.00 \\(UTC\\)\\]>" + config.DefaultReporterConfig.NoColor = false }) It("prints the timestamp and command in green", func() {
Fix test pollution in commandreporter tests
cloudfoundry-incubator_cf-test-helpers
train
go
f2bedce226c269e709558317cc3ffd53b623b444
diff --git a/packages/ember-states/tests/state_manager_test.js b/packages/ember-states/tests/state_manager_test.js index <HASH>..<HASH> 100644 --- a/packages/ember-states/tests/state_manager_test.js +++ b/packages/ember-states/tests/state_manager_test.js @@ -282,6 +282,26 @@ test("it sends exit events to nested states when changing to a top-level state", equals(stateManager.redeem.entered, 1, "redeemed state is entered once"); }); +test("it sends exit events in the correct order when changing to a top-level state", function() { + var exitOrder = [], + stateManager = Ember.StateManager.create({ + start: Ember.State.create({ + outer: Ember.State.create({ + inner: Ember.State.create({ + exit: function() {exitOrder.push('exitedInner')}, + }), + exit: function() {exitOrder.push('exitedOuter')} + }) + }) + }); + + stateManager.goToState('start.outer.inner'); + stateManager.goToState('start'); + equals(exitOrder.length, 2, "precond - it calls both exits"); + equals(exitOrder[0], 'exitedInner', "inner exit is called first"); + equals(exitOrder[1], 'exitedOuter', "outer exit is called second"); +}) + var passedContext, loadingEventCalled, loadedEventCalled, eventInChildCalled; loadingEventCalled = loadedEventCalled = eventInChildCalled = 0;
#<I> test StateManager should send exit events in the correct order when changing to a top-level state
emberjs_ember.js
train
js
82104e1eb14021594d8b926ca92963d0f802230a
diff --git a/src/deferred/Renderer.js b/src/deferred/Renderer.js index <HASH>..<HASH> 100644 --- a/src/deferred/Renderer.js +++ b/src/deferred/Renderer.js @@ -17,6 +17,8 @@ import GBuffer from './GBuffer'; import prezEssl from '../shader/source/prez.essl.js'; import utilEssl from '../shader/source/util.essl.js'; + +import chunkEssl from '../shader/source/deferred/chunk.essl.js'; import lightvolumeEssl from '../shader/source/deferred/lightvolume.essl.js'; // Light shaders import spotEssl from '../shader/source/deferred/spot.essl.js'; @@ -32,6 +34,7 @@ Shader.import(prezEssl); Shader.import(utilEssl); Shader.import(lightvolumeEssl); +Shader.import(chunkEssl); // Light shaders Shader.import(spotEssl); Shader.import(directionalEssl);
Add back deferred chunk shader
pissang_claygl
train
js
56e96950c17ec65ef18cedfb2ed6591796a96cfc
diff --git a/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/Heatmap.js b/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/Heatmap.js index <HASH>..<HASH> 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/Heatmap.js +++ b/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/Heatmap.js @@ -111,7 +111,7 @@ function Heatmap(element, props) { let showY = true; let showX = true; const pixelsPerCharX = 4.5; // approx, depends on font size - const pixelsPerCharY = 6; // approx, depends on font size + let pixelsPerCharY = 6; // approx, depends on font size const valueFormatter = getNumberFormatter(numberFormat); @@ -121,6 +121,7 @@ function Heatmap(element, props) { let longestY = 1; records.forEach(datum => { + if (typeof datum.y === 'number') pixelsPerCharY = 7; longestX = Math.max( longestX, (datum.x && datum.x.toString().length) || 1,
fix(chart & heatmap): make to fix that y label is rendering out of bounds (#<I>)
apache_incubator-superset
train
js
9a00daa69ce5fa85a19a41bf754553dd55fd8263
diff --git a/state/conn_test.go b/state/conn_test.go index <HASH>..<HASH> 100644 --- a/state/conn_test.go +++ b/state/conn_test.go @@ -4,22 +4,14 @@ package state_test import ( - stdtesting "testing" - "github.com/juju/names" gc "gopkg.in/check.v1" "gopkg.in/mgo.v2" "github.com/juju/juju/state" statetesting "github.com/juju/juju/state/testing" - "github.com/juju/juju/testing" ) -// TestPackage integrates the tests into gotest. -func TestPackage(t *stdtesting.T) { - testing.MgoTestPackage(t) -} - // ConnSuite provides the infrastructure for all other // test suites (StateSuite, CharmSuite, MachineSuite, etc). type ConnSuite struct {
state: disable the package tests in -race mode
juju_juju
train
go
c31da1810d86c98e33dc9d8714000f88ce8647ba
diff --git a/openquake/hazardlib/tests/gsim/mgmpe/generic_gmpe_avgsa_test.py b/openquake/hazardlib/tests/gsim/mgmpe/generic_gmpe_avgsa_test.py index <HASH>..<HASH> 100644 --- a/openquake/hazardlib/tests/gsim/mgmpe/generic_gmpe_avgsa_test.py +++ b/openquake/hazardlib/tests/gsim/mgmpe/generic_gmpe_avgsa_test.py @@ -63,6 +63,7 @@ class GenericGmpeAvgSATestCase(unittest.TestCase): except ValueError: pass + def test_calculation_Akkar_valueerror(self): """ """
Abstract and derived class for correlation model Former-commit-id: b7bb<I>a<I>a<I>a3df6b<I>dbe1fdf<I>b<I>b4e<I>
gem_oq-engine
train
py
30d3949e07ade1a588ea4b494f90aa3c9b80271f
diff --git a/src/components/Header/index.js b/src/components/Header/index.js index <HASH>..<HASH> 100755 --- a/src/components/Header/index.js +++ b/src/components/Header/index.js @@ -39,11 +39,11 @@ const Header = ({ ); Header.propTypes = { - brandImage: PropTypes.oneOf([ + brandImage: PropTypes.oneOfType([ PropTypes.number, PropTypes.string ]), - rightImage: PropTypes.oneOf([ + rightImage: PropTypes.oneOfType([ PropTypes.number, PropTypes.string ]),
fix(header): fix propTypes for images on header (#<I>) fix(header): fix propTypes for images on header
indec-it_react-native-commons
train
js
6dc55999fc8f5e3ef02478cfc6713e3310b0101b
diff --git a/jquery.datetimepicker.js b/jquery.datetimepicker.js index <HASH>..<HASH> 100644 --- a/jquery.datetimepicker.js +++ b/jquery.datetimepicker.js @@ -271,6 +271,7 @@ _xdsoft_datetime.currentTime[$(this).parent().parent().hasClass('xdsoft_monthselect')?'setMonth':'setFullYear']($(this).data('value')); $(this).parent().parent().hide(); datetimepicker.trigger('xchange.xdsoft'); + options.onChangeMonth&&options.onChangeMonth.call&&options.onChangeMonth.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input')); });
Trigger onChangeMonth when month picker is used to switch months
xdan_datetimepicker
train
js