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
500a05ac7ced8048507de2d01eb805d55b1376a6
diff --git a/soda/cmd/version.go b/soda/cmd/version.go index <HASH>..<HASH> 100644 --- a/soda/cmd/version.go +++ b/soda/cmd/version.go @@ -1,3 +1,3 @@ package cmd -const Version = "4.0.0.pre" +const Version = "v4.0.0.pre"
added a v in the tag
gobuffalo_pop
train
go
793942914b627a031094eefc80764d26d63d4ea3
diff --git a/cwltool/main.py b/cwltool/main.py index <HASH>..<HASH> 100755 --- a/cwltool/main.py +++ b/cwltool/main.py @@ -502,7 +502,7 @@ def main(args=None, print_dot=args.print_dot, rdf_serializer=args.rdf_serializer) except Exception as e: - _logger.error("I'm sorry, I couldn't load this CWL file.\n%s", e, exc_info=(e if args.debug else False)) + _logger.error("I'm sorry, I couldn't load this CWL file, try again with --debug for more information.\n%s\n", e, exc_info=(e if args.debug else False)) return 1 if type(t) == int: @@ -554,7 +554,10 @@ def main(args=None, _logger.error("Input object failed validation:\n%s", e, exc_info=(e if args.debug else False)) return 1 except workflow.WorkflowException as e: - _logger.error("Workflow error:\n %s", e, exc_info=(e if args.debug else False)) + _logger.error("Workflow error, try again with --debug for more information:\n %s", e, exc_info=(e if args.debug else False)) + return 1 + except Exception as e: + _logger.error("Unhandled error, try again with --debug for more information:\n %s", e, exc_info=(e if args.debug else False)) return 1 return 0
Suggest --debug when reporting exceptions.
common-workflow-language_cwltool
train
py
69fa3eb6512bc4e816c50d6f1bbb2680e3886de4
diff --git a/eZ/Publish/API/Repository/Repository.php b/eZ/Publish/API/Repository/Repository.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/API/Repository/Repository.php +++ b/eZ/Publish/API/Repository/Repository.php @@ -158,6 +158,13 @@ interface Repository public function getRoleService(); /** + * Get SearchService + * + * @return \eZ\Publish\API\Repository\SearchService + */ + public function getSearchService(); + + /** * Begin transaction * * Begins an transaction, make sure you'll call commit or rollback when done,
Added: getSearchService to repository interface
ezsystems_ezpublish-kernel
train
php
a7a9090f4369596a58ef2a9eef7f07b39e806d4d
diff --git a/cli/cmd/snapshot.go b/cli/cmd/snapshot.go index <HASH>..<HASH> 100644 --- a/cli/cmd/snapshot.go +++ b/cli/cmd/snapshot.go @@ -153,11 +153,7 @@ func (c *ServicedCli) cmdSnapshotAdd(ctx *cli.Context) { return } - description := "" - if nArgs <= 3 { - description = ctx.String("description") - } - + description := ctx.String("description") if snapshot, err := c.driver.AddSnapshot(ctx.Args().First(), description); err != nil { fmt.Fprintln(os.Stderr, err) } else if snapshot == "" {
Simplify arg check for snapshot-add
control-center_serviced
train
go
ae049000eb063ffa844e1bd62d63849a519d6429
diff --git a/controllers/Oauth_PublicController.php b/controllers/Oauth_PublicController.php index <HASH>..<HASH> 100644 --- a/controllers/Oauth_PublicController.php +++ b/controllers/Oauth_PublicController.php @@ -117,7 +117,22 @@ class Oauth_PublicController extends BaseController Craft::log(__METHOD__." : User Token", LogLevel::Info, true); //die('3'); - $account = $provider->getAccount(); + try { + $account = $provider->getAccount(); + } catch (\Exception $e) { + + $referer = craft()->httpSession->get('oauthReferer'); + craft()->httpSession->remove('oauthReferer'); + + // var_dump($referer); + // die(); + + Craft::log(__METHOD__." : Could not get account, so we redirect.", LogLevel::Info, true); + Craft::log(__METHOD__." : Redirect : ".$referer, LogLevel::Info, true); + + $this->redirect($referer); + + } var_dump($account); if(isset($account->mapping)) {
try/catching $provider->getAccount in order to prevent errors
dukt_oauth
train
php
08ccf3d3832e917c01616d90e2ef7d9203ed77b4
diff --git a/src/components/BaseComponent.js b/src/components/BaseComponent.js index <HASH>..<HASH> 100644 --- a/src/components/BaseComponent.js +++ b/src/components/BaseComponent.js @@ -36,7 +36,7 @@ export default function createComponent(AntdComponent, mapProps) { ); } } - InputComponent.dispayName = `Redux-form-ANTD${AntdComponent.dispayName}`; + InputComponent.displayName = `Redux-form-ANTD${AntdComponent.displayName}`; return InputComponent; }
Fix for misspelled property name 'displayName'. (#<I>) * Add support for Form.Item's 'required' attribute. * Update import statements to load only required antd components. Fix for #<I> issue. * Fix for misspelled property name 'displayName'.
zmitry_redux-form-antd
train
js
bcb67ecde8ed0512e524b7e1478a3bd4b6b8da5e
diff --git a/test/orm/mongoid.rb b/test/orm/mongoid.rb index <HASH>..<HASH> 100644 --- a/test/orm/mongoid.rb +++ b/test/orm/mongoid.rb @@ -8,6 +8,6 @@ end class ActiveSupport::TestCase setup do - Mongoid.purge! + Mongoid.default_session.drop end end
Fix mongoid test failed problem
plataformatec_devise
train
rb
1acc4c879ad4fb03f1c962540bfb81121f0c879b
diff --git a/cake/tests/cases/libs/controller/scaffold.test.php b/cake/tests/cases/libs/controller/scaffold.test.php index <HASH>..<HASH> 100644 --- a/cake/tests/cases/libs/controller/scaffold.test.php +++ b/cake/tests/cases/libs/controller/scaffold.test.php @@ -500,7 +500,6 @@ class ScaffoldViewTest extends CakeTestCase { $this->assertPattern('/input name="data\[ScaffoldMock\]\[published\]" type="text" maxlength="1" value="Y" id="ScaffoldMockPublished"/', $result); $this->assertPattern('/textarea name="data\[ScaffoldMock\]\[body\]" cols="30" rows="6" id="ScaffoldMockBody"/', $result); $this->assertPattern('/<li><a href="\/scaffold_mock\/delete\/1"[^>]*>Delete<\/a>\s*<\/li>/', $result); - debug($result); } /**
Removing debug() from scaffold test.
cakephp_cakephp
train
php
9e905e2406c204e2d1d0c2b969797452c45b5c0b
diff --git a/nabu/http/renders/CNabuHTTPResponseFileRender.php b/nabu/http/renders/CNabuHTTPResponseFileRender.php index <HASH>..<HASH> 100644 --- a/nabu/http/renders/CNabuHTTPResponseFileRender.php +++ b/nabu/http/renders/CNabuHTTPResponseFileRender.php @@ -44,7 +44,9 @@ class CNabuHTTPResponseFileRender extends CNabuHTTPResponseRenderAdapter is_file($this->source_filename) ) { $this->dumpFile($this->source_filename); - unlink($this->source_filename); + if ($this->unlink_source_file_after_render) { + unlink($this->source_filename); + } } elseif ($this->contentBuilder instanceof CNabuAbstractBuilder) { echo $this->contentBuilder->create(); }
Solve issue that unlinks the file always after send it
nabu-3_core
train
php
7c42a1d12bf840c8a02282e1a57b37d27112dbf4
diff --git a/grunt.js b/grunt.js index <HASH>..<HASH> 100644 --- a/grunt.js +++ b/grunt.js @@ -14,7 +14,7 @@ module.exports = function(grunt) { }, bowerOrganiser : { mapping : { - js : "js" + js : "lib" } }, diff --git a/tasks/bower-organiser.js b/tasks/bower-organiser.js index <HASH>..<HASH> 100644 --- a/tasks/bower-organiser.js +++ b/tasks/bower-organiser.js @@ -35,11 +35,13 @@ module.exports = function(grunt) { if(grunt.utils.kindOf(component.source.main) === 'array') { _.each(component.source.main, function(source) { var extension = source.split('.').pop(); - grunt.file.copy(source, extension + '/' + path.basename(source)); + var targetFolder = config.mapping[extension] || extension; + grunt.file.copy(source, targetFolder + '/' + path.basename(source)); }); } else { var extension = component.source.main.split('.').pop(); - grunt.file.copy(component.source.main, extension + '/' + path.basename(component.source.main)); + var targetFolder = config.mapping[extension] || extension; + grunt.file.copy(component.source.main, targetFolder + '/' + path.basename(component.source.main)); } });
bug fix. Mappings work properly now.
mavdi_grunt-bower-organiser
train
js,js
bb4cb4badd512e699a98c932e1604959e04cddc8
diff --git a/precise/util.py b/precise/util.py index <HASH>..<HASH> 100644 --- a/precise/util.py +++ b/precise/util.py @@ -14,6 +14,7 @@ from typing import * import numpy as np +from os.path import join from precise.params import pr @@ -68,4 +69,5 @@ def glob_all(folder: str, filt: str) -> List[str]: def find_wavs(folder: str) -> Tuple[List[str], List[str]]: """Finds wake-word and not-wake-word wavs in folder""" - return glob_all(folder + '/wake-word', '*.wav'), glob_all(folder + '/not-wake-word', '*.wav') + return (glob_all(join(folder, 'wake-word'), '*.wav'), + glob_all(join(folder, 'not-wake-word'), '*.wav'))
Fix double slash when loading from folder ending in slash
MycroftAI_mycroft-precise
train
py
1c713dd717a3248fa90f8ad344bf01b6e54212e1
diff --git a/src/Goodby/CSV/Import/Standard/Interpreter.php b/src/Goodby/CSV/Import/Standard/Interpreter.php index <HASH>..<HASH> 100644 --- a/src/Goodby/CSV/Import/Standard/Interpreter.php +++ b/src/Goodby/CSV/Import/Standard/Interpreter.php @@ -84,8 +84,6 @@ class Interpreter implements InterpreterInterface */ private function delegate($observer, $line) { - $this->checkCallable($observer); - call_user_func($observer, $line); }
Remove redundant check of valid callable. Currently the validity of the callable is checked when the callable is added, but also on every row iteration. This PR removes the redundancy.
goodby_csv
train
php
b45ceb69295ceb2ff096d0222be18eec8e810617
diff --git a/src/Database/Relationship/OneToMany.php b/src/Database/Relationship/OneToMany.php index <HASH>..<HASH> 100644 --- a/src/Database/Relationship/OneToMany.php +++ b/src/Database/Relationship/OneToMany.php @@ -118,6 +118,26 @@ class OneToMany extends Relationship } /** + * Saves all of the given models + * + * @param array $models An array of models being associated and saved + * @return array + * @since 2.0.0 + **/ + public function saveAll($models) + { + foreach ($models as $model) + { + if (!$this->associate($model)->save()) + { + return false; + } + } + + return true; + } + + /** * Deletes all rows attached to the current model * * @return bool
Add a method for saving all models in a one to many scenario
hubzero_framework
train
php
e423da6f484e2357512e53ad3f4c11cd04ff038f
diff --git a/src/View.php b/src/View.php index <HASH>..<HASH> 100644 --- a/src/View.php +++ b/src/View.php @@ -1,4 +1,35 @@ <?php +/** + * Slim - a micro PHP 5 framework + * + * @author Josh Lockhart <info@slimframework.com> + * @copyright 2011 Josh Lockhart + * @link http://www.slimframework.com + * @license http://www.slimframework.com/license + * @version 2.4.2 + * @package Slim + * + * MIT LICENSE + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ namespace Slender; use \Slim\Collection;
Retain Slim copyright notice as per #6 request from @codeguy
alanpich_slender
train
php
b8a9f7905ab06bf96c6dd22084c781b2b9b382e0
diff --git a/spikewidgets/widgets/multicompgraphwidget/multicompgraphwidget.py b/spikewidgets/widgets/multicompgraphwidget/multicompgraphwidget.py index <HASH>..<HASH> 100644 --- a/spikewidgets/widgets/multicompgraphwidget/multicompgraphwidget.py +++ b/spikewidgets/widgets/multicompgraphwidget/multicompgraphwidget.py @@ -215,6 +215,8 @@ class MultiCompAgreementBySorterWidget(BaseMultiWidget): raise RuntimeError("Number of axes is not number of sortings.") if axes is not None: BaseMultiWidget.__init__(self, figure, axes[0]) + else: + BaseMultiWidget.__init__(self, figure, axes) self.name = 'MultiCompAgreementBySorterWidget' def plot(self):
Never forget the base class :(
SpikeInterface_spikewidgets
train
py
60bbd9dfe5c161c45f01167a45ee68ddce0ea08d
diff --git a/deepdish/tools/caffe/combine_scores.py b/deepdish/tools/caffe/combine_scores.py index <HASH>..<HASH> 100644 --- a/deepdish/tools/caffe/combine_scores.py +++ b/deepdish/tools/caffe/combine_scores.py @@ -15,6 +15,7 @@ if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('scores', nargs='+', type=str) parser.add_argument('-o', '--output', default='scores.h5', type=str) + parser.add_argument('-n', '--name', type=str) args = parser.parse_args() @@ -28,7 +29,10 @@ if __name__ == '__main__': #scores = [] for s in args.scores: data = dd.io.load(s) - name = str(data['name']) + if args.name: + name = args.name + else: + name = str(data['name']) if name not in scores: scores[name] = dict(scores=None, seeds=None)
Added option to override name in combine_scores.
uchicago-cs_deepdish
train
py
87c1761c3bc95baf8981789ff38f4dec465fe630
diff --git a/pandas/tests/groupby/test_groupby.py b/pandas/tests/groupby/test_groupby.py index <HASH>..<HASH> 100644 --- a/pandas/tests/groupby/test_groupby.py +++ b/pandas/tests/groupby/test_groupby.py @@ -2055,3 +2055,17 @@ def test_groups_repr_truncates(max_seq_items, expected): result = df.groupby(np.array(df.a)).groups.__repr__() assert result == expected + + +def test_group_on_two_row_multiindex_returns_one_tuple_key(): + # GH 18451 + df = pd.DataFrame([{"a": 1, "b": 2, "c": 99}, {"a": 1, "b": 2, "c": 88}]) + df = df.set_index(["a", "b"]) + + grp = df.groupby(["a", "b"]) + result = grp.indices + expected = {(1, 2): np.array([0, 1], dtype=np.int64)} + + assert len(result) == 1 + key = (1, 2) + assert (result[key] == expected[key]).all()
adding test for #<I> (#<I>)
pandas-dev_pandas
train
py
eebaca03123e7f1ed90618088bcf8cbcd88ae17a
diff --git a/parsl/channels/local/local.py b/parsl/channels/local/local.py index <HASH>..<HASH> 100644 --- a/parsl/channels/local/local.py +++ b/parsl/channels/local/local.py @@ -144,6 +144,9 @@ class LocalChannel(Channel, RepresentationMixin): except OSError as e: raise FileCopyException(e, self.hostname) + else: + os.chmod(local_dest, 0o777) + return local_dest def close(self):
change permission of job submit file, this is needed on theta
Parsl_parsl
train
py
7a314597a9cd21b156856ea240c0b15581527fa6
diff --git a/source/out/azure/src/js/widgets/oxinputvalidator.js b/source/out/azure/src/js/widgets/oxinputvalidator.js index <HASH>..<HASH> 100644 --- a/source/out/azure/src/js/widgets/oxinputvalidator.js +++ b/source/out/azure/src/js/widgets/oxinputvalidator.js @@ -61,10 +61,10 @@ setTimeout(function(){ if ( $( oTrigger ).is(options.visible) ) { var oFieldSet = self.getFieldSet( oTrigger ); - if ( oFieldSet.children( '.'+options.metodValidateDate ).length <= 0 ) { + if ( oFieldSet.children( '.'+options.metodValidateDate ).length >= 0 ) { var blIsValid = self.isFieldSetValid( oFieldSet, true ); self.hideErrorMessage( oFieldSet ); - if ( blIsValid != true ){ + if ( blIsValid != true ) { self.showErrorMessage( oFieldSet, blIsValid ); } }
ESDEV-<I> #<I> bugfix The check if date options exists was incorrect.
OXID-eSales_oxideshop_ce
train
js
262ae488421fdb79400b5fd944c0655c1d5e09d1
diff --git a/tests/conftest.py b/tests/conftest.py index <HASH>..<HASH> 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -245,9 +245,9 @@ def mcache_server_actual(host, port='11211'): def mcache_server_docker(unused_port, docker, session_id): - docker.pull('memcached:latest') + docker.pull('memcached:alpine') container = docker.create_container( - image='memcached', + image='memcached:alpine', name='memcached-test-server-{}'.format(session_id), ports=[11211], detach=True,
Use memcached:alpine instead of debian image
aio-libs_aiomcache
train
py
594cae528e9eab2a9d5e3b69287ead01ddacff54
diff --git a/python/dllib/src/bigdl/dllib/autograd.py b/python/dllib/src/bigdl/dllib/autograd.py index <HASH>..<HASH> 100644 --- a/python/dllib/src/bigdl/dllib/autograd.py +++ b/python/dllib/src/bigdl/dllib/autograd.py @@ -68,6 +68,14 @@ def epsilon(): return Variable.from_jvalue(callBigDlFunc("float", "epsilon")) +def softsign(a): + return Variable.from_jvalue(callBigDlFunc("float", "softsign", a)) + + +def softplus(a): + return Variable.from_jvalue(callBigDlFunc("float", "softplus", a)) + + class Variable(ZooKerasCreator): def __init__(self, input_shape, node=None, jvalue=None): if jvalue:
add softsign, softplus and unittests (#<I>) * update * md * md * style
intel-analytics_BigDL
train
py
de10706191842badb83277a2835030754b952bd4
diff --git a/lib/model/model.js b/lib/model/model.js index <HASH>..<HASH> 100644 --- a/lib/model/model.js +++ b/lib/model/model.js @@ -297,7 +297,12 @@ var Model = Class.extend(/** @lends Model# */ { this._deleteExecuted = false; this._inFlight = false; - _.extend(this, properties); + // cannot _.extend because it knows not to attempt to write properties that + // aren't writable. we want to write the non-writable properties, though, + // so that the proper exception is thrown. + _.forEach(properties, function(value, key) { + this[key] = value; + }, this); }, /** diff --git a/test/relations/belongs_to_tests.js b/test/relations/belongs_to_tests.js index <HASH>..<HASH> 100644 --- a/test/relations/belongs_to_tests.js +++ b/test/relations/belongs_to_tests.js @@ -170,6 +170,12 @@ describe('Model.belongsTo', function() { }).to.throw(/cannot set.*authorId/i); }); + it('does not allow use of foreign key setter via constructor', function() { + expect(function() { + Article.create({ authorId: 25 }); + }).to.throw(/cannot set.*authorId/i); + }); + it('allows create', function() { var user = article.createAuthor({ username: 'jill' }); expect(article.author).to.equal(user);
Ensuring error is thrown for using read-only property with constructor.
wbyoung_azul
train
js,js
a8f810ecefb498e47550eed51dcfcf17d25183c0
diff --git a/lib/setuplib.php b/lib/setuplib.php index <HASH>..<HASH> 100644 --- a/lib/setuplib.php +++ b/lib/setuplib.php @@ -782,7 +782,7 @@ function get_real_size($size=0) { */ function redirect_if_major_upgrade_required() { global $CFG; - $lastmajordbchanges = 2010050404; + $lastmajordbchanges = 2010052700; if (empty($CFG->version) or (int)$CFG->version < $lastmajordbchanges or during_initial_install() or !empty($CFG->adminsetuppending)) { try {
course-section MDL-<I> Bumped major DB change version
moodle_moodle
train
php
56de2776f07c20ba9e4bbc3241c071b33453296e
diff --git a/tests/containerTests.js b/tests/containerTests.js index <HASH>..<HASH> 100644 --- a/tests/containerTests.js +++ b/tests/containerTests.js @@ -124,6 +124,21 @@ describe('Container', () => { }).toThrow(); }); + it('should resolve group instances in the same order they were registered', () => { + var N_OBJS = 5; + for(var i=0; i<N_OBJS; i++){ + var Obj = createObject({index: {value : i}}); + container.register('object-' + i, Obj) + .inGroup('foo'); + } + + var objs = container.resolveGroup('foo'); + expect(objs.length).toBe(N_OBJS); + for(var i=0; i<N_OBJS; i++){ + expect(objs[i].index).toBe(i); + } + }); + it('should respect the instance lifetime settings when resolving', () => { var A = createObject(); var B = createObject();
Added a test to check group instances are resolved in the same order they were registered
esp_esp-js
train
js
db59327ae7b41817cca5aa3d1b1ed343193144d5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ install_requires = [ setup( name='nodeconductor', - version='0.12.0.dev0', + version='0.13.0', author='OpenNode Team', author_email='info@opennodecloud.com', url='https://github.com/opennode/nodeconductor',
Preparing new release: <I>
opennode_waldur-core
train
py
f827192424f2a4b9b390816c10b08dff658e0d74
diff --git a/sos/report/plugins/convert2rhel.py b/sos/report/plugins/convert2rhel.py index <HASH>..<HASH> 100644 --- a/sos/report/plugins/convert2rhel.py +++ b/sos/report/plugins/convert2rhel.py @@ -21,7 +21,8 @@ class convert2rhel(Plugin, RedHatPlugin): self.add_copy_spec([ "/var/log/convert2rhel/convert2rhel.log", - "/var/log/convert2rhel/rpm_va.log" + "/var/log/convert2rhel/archive/convert2rhel-*.log", + "/var/log/convert2rhel/rpm_va.log", ])
[convert2rhel] Add archived log collection Convert2RHEL will now archive old logs to maintain the sake of simplicity, and for that, we are including the archive directory to be collected as well.
sosreport_sos
train
py
ed85835b26fdc3fcc8d216b2cfe7bfc38b96ea92
diff --git a/lib/pause/action.rb b/lib/pause/action.rb index <HASH>..<HASH> 100644 --- a/lib/pause/action.rb +++ b/lib/pause/action.rb @@ -67,6 +67,9 @@ module Pause def ok? Pause.analyzer.check(self).nil? + rescue ::Redis::CannotConnectError => e + $stderr.puts "Error connecting to redis: #{e.inspect}" + false end def analyze diff --git a/spec/pause/action_spec.rb b/spec/pause/action_spec.rb index <HASH>..<HASH> 100644 --- a/spec/pause/action_spec.rb +++ b/spec/pause/action_spec.rb @@ -60,6 +60,15 @@ describe Pause::Action do action.ok?.should be_false end + + it "should return false and silently fail if redis is not available" do + Redis.any_instance.stub(:zrange) { raise Redis::CannotConnectError } + time = period_marker(resolution, Time.now.to_i) + + action.increment! 4, time - 25 + + action.ok?.should be_false + end end describe "#analyze" do
Making ok? check on action silently fail and return false if redis is dead.
kigster_pause
train
rb,rb
5f5073c2769c862c63340516ce59ecf66673b0ef
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,8 @@ setup( 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 3', 'Topic :: System :: Logging', ] )
Updated setup.py python version classifiers
madzak_python-json-logger
train
py
1413853b7aece72da588d5bbfcc498ac2fd77bd0
diff --git a/openquake/utils/db/loader.py b/openquake/utils/db/loader.py index <HASH>..<HASH> 100644 --- a/openquake/utils/db/loader.py +++ b/openquake/utils/db/loader.py @@ -534,9 +534,8 @@ class SourceModelLoader(object): # for now, just skip this object continue - data = read(src) - - # not serializing on the database - results.extend(data) + results.extend( + write(self.meta, read(src), owner_id=self.owner_id, + input_id=self.input_id)) return results
re-enabled database serialization
gem_oq-engine
train
py
edb0c2dc81b9664ac2593362da71ceefb331293c
diff --git a/gosu-lab/src/main/java/editor/BatchDocument.java b/gosu-lab/src/main/java/editor/BatchDocument.java index <HASH>..<HASH> 100644 --- a/gosu-lab/src/main/java/editor/BatchDocument.java +++ b/gosu-lab/src/main/java/editor/BatchDocument.java @@ -37,7 +37,7 @@ public class BatchDocument extends DefaultStyledDocument synchronized( _batch ) { _batch.addAll( getElementsForString( str, a ) ); - while( _batch.size() > 2000 ) + while( _batch.size() > 100 * 1024 ) { _batch.remove( 0 ); }
increase output buffer size regulator from 2k to <I>k e.g., should be able to run simple loop to print 1 - <I> and see all <I> in the console
gosu-lang_gosu-lang
train
java
34d83db29c561732d1b5d567a600d1b2ac7b2b7d
diff --git a/linkcheck/checker/httpurl.py b/linkcheck/checker/httpurl.py index <HASH>..<HASH> 100644 --- a/linkcheck/checker/httpurl.py +++ b/linkcheck/checker/httpurl.py @@ -247,6 +247,11 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport): self.aliases.append(newurl) # XXX on redirect errors this is not printed self.add_info(_("Redirected to `%(url)s'.") % {'url': newurl}) + + # Reset extern and recalculate + self.extern = None + self.set_extern(newurl) + self.urlparts = strformat.url_unicode_split(newurl) self.build_url_parts() self.url_connection = response
When following redirections update url.extern
wummel_linkchecker
train
py
19581a5a32f3a372bf70b6bb7b38c9865cb6fbeb
diff --git a/lib/android/index.js b/lib/android/index.js index <HASH>..<HASH> 100644 --- a/lib/android/index.js +++ b/lib/android/index.js @@ -12,6 +12,9 @@ const path = require('path'); class Android { constructor(options) { if (Android.instance) { + // This is hack for https://github.com/sitespeedio/browsertime/issues/1239 + // In the long run we should rework how we use the Android object. + Android.instance.port = options.devToolsPort; return Android.instance; } @@ -135,6 +138,7 @@ class Android { } async removeFw() { + this.forward = undefined; // Remove forwards are missing in the adbkit return execa('adb', [ '-s',
Hack for handling crawling on Android devices from sitespeed.io. (#<I>) How we create the Android instance object isn't optimal and we can rework that in the future.
sitespeedio_browsertime
train
js
f187622a0d26c4931a2079ce3b02e999db16f66b
diff --git a/lib/blocklib.php b/lib/blocklib.php index <HASH>..<HASH> 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -1285,7 +1285,10 @@ class block_manager { } else if ($data = $mform->get_data()) { $bi = new stdClass; $bi->id = $block->instance->id; + + // This may get overwritten by the special case handling below. $bi->pagetypepattern = $data->bui_pagetypepattern; + $bi->showinsubcontexts = $data->bui_contexts; if (empty($data->bui_subpagepattern) || $data->bui_subpagepattern == '%@NULL@%') { $bi->subpagepattern = null; } else {
MDL-<I> block editing: show in subcontexts does not work on category pages. Thanks to Ian David Wild for pointing to the proper fix.
moodle_moodle
train
php
8892b4779659f0a792748002d963e19a26950fc4
diff --git a/pingparsing/_stats.py b/pingparsing/_stats.py index <HASH>..<HASH> 100644 --- a/pingparsing/_stats.py +++ b/pingparsing/_stats.py @@ -18,7 +18,7 @@ class PingStats(object): self.__rtt_mdev = kwargs.pop("rtt_mdev", None) self.__duplicates = kwargs.pop("duplicates", None) - self.__icmp_reply_list = kwargs.pop("icmp_reply_list", []) + self.__icmp_replies = kwargs.pop("icmp_reply_list", []) @property def destination(self): @@ -159,7 +159,7 @@ class PingStats(object): |list| of |dict|: """ - return self.__icmp_reply_list + return self.__icmp_replies def as_dict(self): """
Refactor: rename a private variable
thombashi_pingparsing
train
py
3f3b0659ad4f2de5112bde5c2bb085416de85ac6
diff --git a/test/lib/model.js b/test/lib/model.js index <HASH>..<HASH> 100644 --- a/test/lib/model.js +++ b/test/lib/model.js @@ -162,7 +162,7 @@ var modelBatch = function(typeName, className, testSchema, testData) { 'passed-in fields are there': function(err, created) { var prop; for (prop in testData.create) { - assert.equal(created[prop], testData.create[prop]); + assert.deepEqual(created[prop], testData.create[prop]); } }, 'and we modify it': { @@ -176,7 +176,7 @@ var modelBatch = function(typeName, className, testSchema, testData) { 'modified fields are modified': function(err, updated) { var prop; for (prop in testData.update) { - assert.equal(updated[prop], testData.update[prop]); + assert.deepEqual(updated[prop], testData.update[prop]); } }, 'and we delete it': {
use deepEqual() to check modified fields
pump-io_pump.io
train
js
11a7e2858b813783f887da98cabe4d5937491619
diff --git a/osprey/search_space.py b/osprey/search_space.py index <HASH>..<HASH> 100644 --- a/osprey/search_space.py +++ b/osprey/search_space.py @@ -59,7 +59,7 @@ class SearchSpace(object): raise ValueError('variable %s: warp=%s is not supported. use ' 'None or "log",' % (name, warp)) - self.variables[name] = EnumVariable(name, list(choices)) + self.variables[name] = EnumVariable(name, choices.tolist()) def add_int(self, name, min, max, warp=None): """An integer-valued dimension bounded between `min` <= x <= `max`.
Jump variables now cast to nearest Python equivalent No test case yet
msmbuilder_osprey
train
py
c2a65432bb664360b9d015ac46866a3b450cedf3
diff --git a/zeroneed.php b/zeroneed.php index <HASH>..<HASH> 100755 --- a/zeroneed.php +++ b/zeroneed.php @@ -30,4 +30,4 @@ require __DIR__ . '/vendor/autoload.php'; | */ -ZN\ZN::run('EIP', '5.7.2.3', 'Vecihi Hürkuş'); \ No newline at end of file +ZN\ZN::run('EIP', '5.7.2.4', 'Vecihi Hürkuş'); \ No newline at end of file
<I>: Updated version.
znframework_znframework
train
php
023e950f78f7cdf9348292572cadc469ade03969
diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-dockerfile/syntax.js b/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-dockerfile/syntax.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-dockerfile/syntax.js +++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-dockerfile/syntax.js @@ -1,6 +1,6 @@ /******************************************************************************* * @license - * Copyright (c) 2014 IBM Corporation and others. + * Copyright (c) 2014, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials are made * available under the terms of the Eclipse Public License v1.0 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution @@ -12,13 +12,17 @@ /*eslint-env browser, amd*/ define("orion/editor/stylers/text_x-dockerfile/syntax", ["orion/editor/stylers/lib/syntax"], function(mLib) { var keywords = [ - "add", + "add", "arg", "cmd", "copy", "entrypoint", "env", "expose", "from", + "healthcheck", + "label", "maintainer", "onbuild", "run", + "shell", + "stopsignal", "user", "volume", "workdir"
Bug <I> - Update Dockerfile keywords Update the syntax file with new keywords that have been introduced into Docker.
eclipse_orion.client
train
js
2dfcded782468980e063d0f675705d1fb011d486
diff --git a/gwpy/timeseries/core.py b/gwpy/timeseries/core.py index <HASH>..<HASH> 100644 --- a/gwpy/timeseries/core.py +++ b/gwpy/timeseries/core.py @@ -1296,4 +1296,3 @@ class TimeSeriesBaseList(list): def __getslice__(self, i, j): return type(self)(*super(TimeSeriesBaseList, self).__getslice__(i, j)) - __getslice__.__doc__ = list.__getslice__.__doc__
TimeSeriesBaseList.__getslice__: removed __doc__ in python3 `list` doesn't have `__getslice__`, and we don't really need a docstring anyway
gwpy_gwpy
train
py
511c76f2f44aac85844a210320419cf87cdef5a6
diff --git a/template/app/view/cls/Toolbar.js b/template/app/view/cls/Toolbar.js index <HASH>..<HASH> 100644 --- a/template/app/view/cls/Toolbar.js +++ b/template/app/view/cls/Toolbar.js @@ -71,7 +71,7 @@ Ext.define('Docs.view.cls.Toolbar', { } this.items = this.items.concat([ - { width: 10 }, + { xtype: 'tbspacer', width: 10 }, this.filterField = Ext.widget("textfield", { emptyText: 'Find class members...', enableKeyEvents: true,
Make member-filter separator into spacer. It was rendered as a button before.
senchalabs_jsduck
train
js
560e6c6f68b685acbab437b6a23177ef8dc91400
diff --git a/angr/analyses/cfg.py b/angr/analyses/cfg.py index <HASH>..<HASH> 100644 --- a/angr/analyses/cfg.py +++ b/angr/analyses/cfg.py @@ -605,6 +605,10 @@ class CFG(Analysis, CFGBase): new_state = current_entry.state.copy() new_state.set_mode('symbolic') new_state.options.add(simuvex.o.DO_RET_EMULATION) + # Remove bad constraints + # FIXME: This is so hackish... + new_state.se._solver.constraints = [ c for c in new_state.se.constraints if c.op != 'I' or c.args[0] is not False ] + new_state.se._solver._result = None # Swap them saved_state, current_entry.state = current_entry.state, new_state sim_run, error_occurred, _ = self._get_simrun(addr, current_entry)
Remove all False constarints before converting a state from fastpath mode to symbolic mode when generating cfg
angr_angr
train
py
9df55c42ef5577eba462f8233e7090a0aeec7eb0
diff --git a/cell/lrp_test.go b/cell/lrp_test.go index <HASH>..<HASH> 100644 --- a/cell/lrp_test.go +++ b/cell/lrp_test.go @@ -11,7 +11,7 @@ import ( "github.com/cloudfoundry-incubator/bbs/models" "github.com/cloudfoundry-incubator/inigo/fixtures" "github.com/cloudfoundry-incubator/inigo/helpers" - "github.com/cloudfoundry-incubator/route-emitter/cfroutes" + "github.com/cloudfoundry-incubator/routing-info/cfroutes" "github.com/cloudfoundry-incubator/stager/diego_errors" archive_helper "github.com/pivotal-golang/archiver/extractor/test_helper" "github.com/pivotal-golang/lager" diff --git a/helpers/bbs_requests.go b/helpers/bbs_requests.go index <HASH>..<HASH> 100644 --- a/helpers/bbs_requests.go +++ b/helpers/bbs_requests.go @@ -5,7 +5,7 @@ import ( "github.com/cloudfoundry-incubator/bbs" "github.com/cloudfoundry-incubator/bbs/models" - "github.com/cloudfoundry-incubator/route-emitter/cfroutes" + "github.com/cloudfoundry-incubator/routing-info/cfroutes" . "github.com/onsi/gomega" )
Move cfroutes to routing-info [#<I>]
cloudfoundry_inigo
train
go,go
eedb51bd562ea8e458a41ae0fbfde7d5950c21b3
diff --git a/libkbfs/folder_block_ops.go b/libkbfs/folder_block_ops.go index <HASH>..<HASH> 100644 --- a/libkbfs/folder_block_ops.go +++ b/libkbfs/folder_block_ops.go @@ -1327,6 +1327,10 @@ func (fbo *folderBlockOps) GetDirtyDir( return fbo.getDirtyDirLocked(ctx, lState, kmd, dir, rtype) } +var hiddenEntries = map[string]bool{ + ".kbfs_git": true, +} + // GetDirtyDirChildren returns a map of EntryInfos for the (possibly // dirty) children entries of the given directory. func (fbo *folderBlockOps) GetDirtyDirChildren( @@ -1343,6 +1347,10 @@ func (fbo *folderBlockOps) GetDirtyDirChildren( children := make(map[string]EntryInfo) for k, de := range dblock.Children { + if hiddenEntries[k] { + fbo.log.CDebugf(ctx, "Hiding entry %s", k) + continue + } children[k] = de.EntryInfo } return children, nil
folder_block_ops: don't return .kbfs_git entry We don't want it to show up in `ls`, and we don't want `rm -rf` to clobber it on accident. Issue: KBFS-<I>
keybase_client
train
go
b235c06e1bbeb17abbc64f639d1f0f51dff86487
diff --git a/src/Context/Argument/PageObjectArgumentResolver.php b/src/Context/Argument/PageObjectArgumentResolver.php index <HASH>..<HASH> 100644 --- a/src/Context/Argument/PageObjectArgumentResolver.php +++ b/src/Context/Argument/PageObjectArgumentResolver.php @@ -85,6 +85,6 @@ class PageObjectArgumentResolver implements ArgumentResolver */ private function getClassName(\ReflectionParameter $parameter) { - return $parameter->getClass() ? $parameter->getClass()->getName() : null; + return $parameter->getClass() ? $parameter->getClass()->name : null; } }
Fix a problem discovered by scrutinizer
sensiolabs_BehatPageObjectExtension
train
php
7541837cb0cd4a0c6f47e152d36781aa2404b2d6
diff --git a/src/Assimp/Command/CommandExecutor.php b/src/Assimp/Command/CommandExecutor.php index <HASH>..<HASH> 100644 --- a/src/Assimp/Command/CommandExecutor.php +++ b/src/Assimp/Command/CommandExecutor.php @@ -105,7 +105,10 @@ class CommandExecutor */ public function setBinary($bin) { - if (!is_file($bin) || !is_executable($bin)) { + if (!is_file($bin)) { + throw new \InvalidArgumentException('Binary file not exists: '.$bin, ErrorCodes::FILE_NOT_FOUND); + } + if (!is_executable($bin)) { throw new \InvalidArgumentException('Binary file is not executable: '.$bin, ErrorCodes::FILE_NOT_EXECUTABLE); } $this->bin = $bin;
splitted checks on assimp-binary
magdev_php-assimp
train
php
ce46e0a2cad3b4213d66be02ab67f5f5512e7f0f
diff --git a/app/models/esr_record.rb b/app/models/esr_record.rb index <HASH>..<HASH> 100644 --- a/app/models/esr_record.rb +++ b/app/models/esr_record.rb @@ -4,10 +4,10 @@ class EsrRecord < ActiveRecord::Base belongs_to :booking, :dependent => :destroy belongs_to :invoice - named_scope :valid, :conditions => "state = 'valid'" - named_scope :missing, :conditions => "state = 'missing'" - named_scope :bad, :conditions => "state = 'bad'" - named_scope :invalid, :conditions => "state != 'valid'" + scope :valid, where(:state => 'valid') + scope :missing, where(:state => 'missing') + scope :bad, where(:state => 'bad') + scope :invalid, where(:state => 'valid') private def parse_date(value)
Port scope definitions in EsrRecord to Rails 3 syntax.
raskhadafi_vesr
train
rb
c7e86417d437d1368726a018a0478f5e5d263288
diff --git a/lib/init.js b/lib/init.js index <HASH>..<HASH> 100644 --- a/lib/init.js +++ b/lib/init.js @@ -66,28 +66,21 @@ class Init { await this.writeFile('package.json', JSON.stringify(packageInfo, null, 2)) } - async writeEditorConfig() { - const name = '.editorconfig' - await copyFile(packagePath(name), this.currentPath(name)) - } - - async writeESLintConfig() { - const name = '.eslintrc.js' + async writeTemplateFile(name) { await copyFile(template(name), this.currentPath(name)) } - async writeCommitlintConfig() { - const name = '.commitlintrc.js' - await copyFile(template(name), this.currentPath(name)) + async writePackageFile(name) { + await copyFile(packagePath(name), this.currentPath(name)) } } module.exports = async function init() { const cmd = new Init(process.cwd()) await cmd.updatePackageFile() - await cmd.writeEditorConfig() - await cmd.writeESLintConfig() - await cmd.writeCommitlintConfig() + await cmd.writePackageFile('.editorconfig') + await cmd.writeTemplateFile('.eslintrc.js') + await cmd.writeTemplateFile('.commitlintrc.js') } module.exports.desc = `Setup npm project:
refactor(init): reduce duplication of methods (#<I>)
ybiquitous_ybiq
train
js
b18c00f0241515aa6f3c99a34ed53a10dab8bc95
diff --git a/manager.go b/manager.go index <HASH>..<HASH> 100644 --- a/manager.go +++ b/manager.go @@ -108,10 +108,7 @@ func NewCookieManager(key string) *Manager { } func (m *Manager) Multi(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - ctx := context.WithValue(r.Context(), m.opts.name, m.Load(r)) - next.ServeHTTP(w, r.WithContext(ctx)) - }) + return m.Use(next) } func (m *Manager) Use(next http.Handler) http.Handler {
[refactor] Alias Multi() to Use()
alexedwards_scs
train
go
f7c1e596244d23dad290446ac70c1651a31c8911
diff --git a/python_modules/dagster/dagster_tests/daemon_tests/integration_tests/test_queued.py b/python_modules/dagster/dagster_tests/daemon_tests/integration_tests/test_queued.py index <HASH>..<HASH> 100644 --- a/python_modules/dagster/dagster_tests/daemon_tests/integration_tests/test_queued.py +++ b/python_modules/dagster/dagster_tests/daemon_tests/integration_tests/test_queued.py @@ -1,3 +1,4 @@ +import pytest from dagster.core.host_representation import PipelineHandle from dagster.core.storage.pipeline_run import PipelineRun from dagster.core.test_utils import create_run_for_test, poll_for_finished_run @@ -26,6 +27,7 @@ def assert_events_in_order(logs, expected_events): assert filtered_logged_events == expected_events +@pytest.mark.skip("Flaky, see https://github.com/dagster-io/dagster/issues/3771") def test_queue_from_schedule_and_sensor(tmpdir, foo_example_repo): dagster_home_path = tmpdir.strpath with setup_instance(
Disable flaky daemon test Summary: We should investigate why this is segfaulting as it likely indicates a real issue, but skip for now. Test Plan: BK Reviewers: johann, prha, alangenfeld, catherinewu Reviewed By: catherinewu Differential Revision: <URL>
dagster-io_dagster
train
py
ea576e7c53d29c61e47b6588e6bb8a406e8f48ea
diff --git a/twarc/command2.py b/twarc/command2.py index <HASH>..<HASH> 100644 --- a/twarc/command2.py +++ b/twarc/command2.py @@ -696,18 +696,6 @@ def timeline( Retrieve recent tweets for the given user. """ - tweets = _timeline_tweets( - T, - use_search, - user_id, - since_id, - until_id, - start_time, - end_time, - exclude_retweets, - exclude_replies, - ) - count = 0 pbar = tqdm @@ -726,6 +714,18 @@ def timeline( "disable": hide_progress, } + tweets = _timeline_tweets( + T, + use_search, + user_id, + since_id, + until_id, + start_time, + end_time, + exclude_retweets, + exclude_replies, + ) + with pbar(**pbar_params) as progress: for result in tweets: _write(result, outfile) @@ -896,7 +896,7 @@ def _timeline_tweets( q += " -is:retweet" if exclude_replies and "-is:reply" not in q: q += " -is:reply" - tweets = T.search_all(q, since_id, until_id, start_time, end_time) + tweets = T.search_all(q, since_id, until_id, start_time, end_time, 100) else: tweets = T.timeline( user_id,
fix _timeline_tweets search not working when start_time was not set
DocNow_twarc
train
py
1719c066b1f2238c62ea71f43ac9379f87ae7b35
diff --git a/src/Field.php b/src/Field.php index <HASH>..<HASH> 100644 --- a/src/Field.php +++ b/src/Field.php @@ -55,6 +55,13 @@ class Field public $editable = true; /** + * Setting this to true will never actually store + * the field in the database. It will action as normal, + * but will be skipped by update/insert. + */ + public $never_persist = false; + + /** * Constructor. You can pass field properties as array. * * @param array $defaults diff --git a/src/Persistence_SQL.php b/src/Persistence_SQL.php index <HASH>..<HASH> 100644 --- a/src/Persistence_SQL.php +++ b/src/Persistence_SQL.php @@ -571,7 +571,7 @@ class Persistence_SQL extends Persistence // apply all fields we got from get foreach ($data as $field => $value) { $f = $m->getElement($field); - if (!$f->editable) { + if (!$f->editable || $f->never_persist) { continue; } $insert->set($f->actual ?: $f->short_name, $value); @@ -649,6 +649,9 @@ class Persistence_SQL extends Persistence $cnt = 0; foreach ($data as $field => $value) { $f = $m->getElement($field); + if ($f->never_persist) { + continue; + } $update->set($f->actual ?: $f->short_name, $value); $cnt++; }
First we need ability to avoid field persistence If model is saving field and join is saving on top, we get problem.
atk4_data
train
php,php
51261167b4a1de53cd38cc2b1553e5d71ba360ce
diff --git a/transformers/modeling_bert.py b/transformers/modeling_bert.py index <HASH>..<HASH> 100644 --- a/transformers/modeling_bert.py +++ b/transformers/modeling_bert.py @@ -633,7 +633,7 @@ class BertModel(BertPreTrainedModel): See base class PreTrainedModel """ for layer, heads in heads_to_prune.items(): - self.encoder.layer[layer].attention.prune_heads(heads) + self.encoder.layer[layer].self_attention.prune_heads(heads) def forward(self, input_ids, attention_mask=None, token_type_ids=None, position_ids=None, head_mask=None): if attention_mask is None: @@ -736,7 +736,8 @@ class BertDecoderModel(BertPreTrainedModel): See base class PreTrainedModel """ for layer, heads in heads_to_prune.items(): - self.encoder.layer[layer].attention.prune_heads(heads) + self.decoder.layer[layer].attention.prune_heads(heads) + self.decoder.layer[layer].self_attention.prune_heads(heads) def forward(self, input_ids, encoder_outputs, attention_mask=None, token_type_ids=None, position_ids=None, head_mask=None): if attention_mask is None:
prune both attention and self-attention heads
huggingface_pytorch-pretrained-BERT
train
py
8d78e752ed78862eebb451fdb4cab35da29e5ed8
diff --git a/addons/tab_completion/tab_completion.rb b/addons/tab_completion/tab_completion.rb index <HASH>..<HASH> 100644 --- a/addons/tab_completion/tab_completion.rb +++ b/addons/tab_completion/tab_completion.rb @@ -36,20 +36,24 @@ class TabCompletion < Addon # +pre_word_context+ is the "lib/" if the user hits tab after typing "ls lib/" # because the current word will be set to "" def pre_word_context - # Work our way backwards thru the text because we can stop as soon as - # see a word break character rather than having to keep track of them. - i = @before_text.length - str = "" - loop do - i -= 1 - ch = @before_text[i] - if ch =~ filtered_work_break_characters_rgx && (i>0 && @before_text[i-1] != '\\') - break - else - str << ch + if @before_text.length == 0 + "" + else + # Work our way backwards thru the text because we can stop as soon as + # see a word break character rather than having to keep track of them. + i = @before_text.length + str = "" + loop do + i -= 1 + ch = @before_text[i] + if ch =~ filtered_work_break_characters_rgx && (i>0 && @before_text[i-1] != '\\') + break + else + str << ch + end end + str.reverse end - str.reverse end def get_filename_completion_matches
Update pre_word_context for tab completion to be an empty string if there is no before_text to choose from. Resolves issue hitting tab when nothing has been input into the REPL.
zdennis_yap-shell-core
train
rb
3b7b282b697f92ab74f9d9bb2a289d3355f3501b
diff --git a/src/client/Client.js b/src/client/Client.js index <HASH>..<HASH> 100644 --- a/src/client/Client.js +++ b/src/client/Client.js @@ -395,8 +395,9 @@ class Client extends EventEmitter { * <warn>Bots can only fetch their own profile.</warn> * @param {Snowflake} [id='@me'] ID of application to fetch * @returns {Promise<OAuth2Application>} + * @example * client.fetchApplication() - * .then(application => console.log(`Obtained application with name: ${application.name}`) + * .then(application => console.log(`Obtained application with name: ${application.name}`)) * .catch(console.error); */ fetchApplication(id = '@me') {
docs(Client): add missing example tag and closing parenthesis (#<I>)
discordjs_discord.js
train
js
ebc4a4f1b0e3056dec9557f012d02760803d5131
diff --git a/autopython/highlighter.py b/autopython/highlighter.py index <HASH>..<HASH> 100644 --- a/autopython/highlighter.py +++ b/autopython/highlighter.py @@ -130,12 +130,12 @@ else: class Token: pass - Token.Index = object() - Token.Prompt = object() - Token.Text = object() - Token.Literal = object() - Token.Literal.String = object() - Token.Literal.String.Doc = object() + Token.Index = Token() + Token.Prompt = Token() + Token.Text = Token() + Token.Literal = Token() + Token.Literal.String = Token() + Token.Literal.String.Doc = Token() Token.Generic = Token COLOR_SCHEMES = {'default': {}}
Exception when colorama or pygments were not installed
gosella_autopython
train
py
4905a63acfcda49f92ce1a72939f44afef9f0cd5
diff --git a/lib/puppet/node/facts.rb b/lib/puppet/node/facts.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/node/facts.rb +++ b/lib/puppet/node/facts.rb @@ -59,7 +59,7 @@ class Puppet::Node::Facts end end - # Sanitize fact values by converting everything not a string, boolean + # Sanitize fact values by converting everything not a string, Boolean # numeric, array or hash into strings. def sanitize values.each do |fact, value|
(maint) Spell-check facts.rb.
puppetlabs_puppet
train
rb
3c79df28c16804d761eac281758ca5446a8c4e1f
diff --git a/lib/chef/provider/file.rb b/lib/chef/provider/file.rb index <HASH>..<HASH> 100644 --- a/lib/chef/provider/file.rb +++ b/lib/chef/provider/file.rb @@ -144,6 +144,7 @@ class Chef end def setup_acl + return if Chef::Platform.windows? acl_scanner = ScanAccessControl.new(@new_resource, @current_resource) acl_scanner.set_all! end
[CHEF-<I>] skip file metadata reporting on win for now
chef_chef
train
rb
8f26f6df8355540dd8f351e9f71f7bf056838e2c
diff --git a/packages/babel-generator/src/printer.js b/packages/babel-generator/src/printer.js index <HASH>..<HASH> 100644 --- a/packages/babel-generator/src/printer.js +++ b/packages/babel-generator/src/printer.js @@ -367,7 +367,7 @@ export default class Printer { const loc = t.isProgram(node) || t.isFile(node) ? null : node.loc; this.withSource("start", loc, () => { - this[node.type](node, parent); + printMethod.call(this, node, parent); }); this._printTrailingComments(node);
change var name for coherence (#<I>)
babel_babel
train
js
685a90efb88200f13ddc0722f446a72ae163286e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -24,6 +24,6 @@ setup( keywords="zha quirks homeassistant hass", packages=find_packages(exclude=["tests"]), python_requires=">=3", - install_requires=["zigpy>=0.28.1"], + install_requires=["zigpy>=0.28.2"], tests_require=["pytest"], ) diff --git a/zhaquirks/xiaomi/__init__.py b/zhaquirks/xiaomi/__init__.py index <HASH>..<HASH> 100644 --- a/zhaquirks/xiaomi/__init__.py +++ b/zhaquirks/xiaomi/__init__.py @@ -541,7 +541,7 @@ def handle_quick_init( if not model: return - for quirk in zigpy.quirks.get_model_quirks(model): + for quirk in zigpy.quirks.get_quirk_list(LUMI, model): if issubclass(quirk, XiaomiQuickInitDevice): sender.debug("Found '%s' quirk for '%s' model", quirk.__name__, model) try:
Syncup with zigpy regression fix (#<I>)
dmulcahey_zha-device-handlers
train
py,py
835962b55a572a828a7d2e7ca6899d2794401ba7
diff --git a/bbq-core/lib/bbq/rspec.rb b/bbq-core/lib/bbq/rspec.rb index <HASH>..<HASH> 100644 --- a/bbq-core/lib/bbq/rspec.rb +++ b/bbq-core/lib/bbq/rspec.rb @@ -21,7 +21,7 @@ module Bbq @locator = locator end - match_for_should do |page| + match do |page| if @locator page.within(@locator) do page.see? text @@ -31,7 +31,7 @@ module Bbq end end - match_for_should_not do |page| + match_when_negated do |page| if @locator page.within(@locator) do page.not_see? text @@ -41,7 +41,7 @@ module Bbq end end - failure_message_for_should do |page| + failure_message do |page| body = if @locator page.find(@locator).text else @@ -50,7 +50,7 @@ module Bbq "expected to see #{text} in #{body}" end - failure_message_for_should_not do |page| + failure_message_when_negated do |page| body = if @locator page.find(@locator).text else
Update rpsec matchers to use non-deprecated methods
drugpl_bbq
train
rb
6fa429cf42c4aa110db299a0e320ee502310881d
diff --git a/prometheus/go_collector_test.go b/prometheus/go_collector_test.go index <HASH>..<HASH> 100644 --- a/prometheus/go_collector_test.go +++ b/prometheus/go_collector_test.go @@ -44,9 +44,14 @@ func TestGoCollectorGoroutines(t *testing.T) { go func() { c.Collect(metricCh) - go func(c <-chan struct{}) { - <-c - }(endGoroutineCh) + for i := 1; i <= 10; i++ { + // Start 10 goroutines to be sure we'll detect an + // increase even if unrelated goroutines happen to + // terminate during this test. + go func(c <-chan struct{}) { + <-c + }(endGoroutineCh) + } <-waitCh c.Collect(metricCh) close(endCollectionCh) @@ -73,9 +78,8 @@ func TestGoCollectorGoroutines(t *testing.T) { continue } - if diff := int(pb.GetGauge().GetValue()) - old; diff != 1 { - // TODO: This is flaky in highly concurrent situations. - t.Errorf("want 1 new goroutine, got %d", diff) + if diff := old - int(pb.GetGauge().GetValue()); diff > -1 { + t.Errorf("want at least one new goroutine, got %d fewer", diff) } case <-time.After(1 * time.Second): t.Fatalf("expected collect timed out")
Unflake TestGoCollectorGoroutines This is not a great solution, but it's also hard to test for this moving target.
prometheus_client_golang
train
go
13ac27fdccb530f15f81a03368c1388b9f0fbea6
diff --git a/mods/parsoid.js b/mods/parsoid.js index <HASH>..<HASH> 100644 --- a/mods/parsoid.js +++ b/mods/parsoid.js @@ -295,8 +295,7 @@ PSP.generateAndSave = function(restbase, req, format, currentContentRes) { }, body: body }); - }) - .catch(function(e) { + }, function(e) { // Fall back to plain GET return restbase.get({ uri: pageBundleUri }); });
Don't retry failed Parsoid POST requests Only fall back to GET if the internal storage request failed, but don't do so if the Parsoid POST fails. While this catch papers over a Parsoid v3 API incompatibility right now, it would be nicer to detect such failures more quickly. Tests for this patch won't pass until <URL>
wikimedia_restbase
train
js
1baca604c3a72d3ebc0da66be48197e9f058a057
diff --git a/tests/models.py b/tests/models.py index <HASH>..<HASH> 100644 --- a/tests/models.py +++ b/tests/models.py @@ -35,7 +35,7 @@ class Example(models.Model): @property def property_should_not_index(self): - return True + return False @property def property_string(self): diff --git a/tests/test_index.py b/tests/test_index.py index <HASH>..<HASH> 100644 --- a/tests/test_index.py +++ b/tests/test_index.py @@ -254,7 +254,7 @@ class IndexTestCase(TestCase): class ExampleIndex(AlgoliaIndex): fields = 'name' - should_index = 'static_should_not_index' + should_index = 'property_should_not_index' index = ExampleIndex(Example, self.client) self.assertFalse(index._should_index(self.instance),
fix: test_should_index_property with correct negative case
algolia_algoliasearch-django
train
py,py
2699a8c8ba387524e9a27367a6a86445ebce7e38
diff --git a/src/browser-client/main.js b/src/browser-client/main.js index <HASH>..<HASH> 100644 --- a/src/browser-client/main.js +++ b/src/browser-client/main.js @@ -7,13 +7,13 @@ // It doesn't load "q.js" dynamically anymore -- that task has been replaced // by a script tag load in the HTML page: // -// <script src="QM_WWW_URL/homepage.js"></script> +// <script src="./homepage.js"></script> // // KNOWN ISSUES: // https://bugzilla.mozilla.org/show_bug.cgi?id=756028 // // ~~ (c) SRW, 23 May 2012 -// ~~ last updated 10 Jan 2013 +// ~~ last updated 12 Jan 2013 (function () { 'use strict'; @@ -26,10 +26,10 @@ /*properties Q, QM, activeElement, alert, avar, blur, box, call, clearTimeout, - click, console, document, error, exit, getItem, hasOwnProperty, id, is, - jQuery, join, key, keydown, localStorage, log, on, preventDefault, - prototype, ready, revive, setItem, setTimeout, stay, val, value, - volunteer, volunteer_timer, which + click, console, document, error, exit, focus, getItem, hasOwnProperty, + id, is, jQuery, join, key, keydown, localStorage, log, on, + preventDefault, prototype, ready, revive, setItem, setTimeout, stay, + val, value, volunteer, volunteer_timer, which */ // Prerequisites
Linted "main.js" and fixed an out-of-date comment
qmachine_qm-nodejs
train
js
424b6bdfbde213dbaee4658883cb6755620b73df
diff --git a/archive.go b/archive.go index <HASH>..<HASH> 100644 --- a/archive.go +++ b/archive.go @@ -214,6 +214,10 @@ func (v *volume) next() (*fileBlockHeader, error) { } func (v *volume) Close() error { + // may be nil if os.Open fails in next() + if v.f == nil { + return nil + } return v.f.Close() }
check for nil file handle when closing volume
nwaples_rardecode
train
go
68d1c1ae79466138675cdfc9cda4d76a46ea625a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ from setuptools import setup _version_re = re.compile(r'__version__\s+=\s+(.*)') requirements = [ 'sanic-base-extension==0.1.1', - 'aioamqp==0.11.0', + 'aioamqp==0.12.0', ]
Updated version of the aioamqp package
Relrin_sanic-amqp-extension
train
py
9fc39a4c97ad6e9fa14bc3f2c5d26660148901ce
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -169,7 +169,8 @@ describe('Puppeteer', function() { await browser2.close(); rm(userDataDir); })); - it('userDataDir option should restore cookies', SX(async function() { + // @see https://github.com/GoogleChrome/puppeteer/issues/1537 + xit('userDataDir option should restore cookies', SX(async function() { const userDataDir = fs.mkdtempSync(path.join(__dirname, 'test-user-data-dir')); const options = Object.assign({userDataDir}, defaultBrowserOptions); const browser = await puppeteer.launch(options);
test: disable 'userDataDir option should restore cookies' (#<I>) References #<I>
GoogleChrome_puppeteer
train
js
008e318a482888123724fa9895ae540782e71c6e
diff --git a/lib/scripts/gen-docs.js b/lib/scripts/gen-docs.js index <HASH>..<HASH> 100755 --- a/lib/scripts/gen-docs.js +++ b/lib/scripts/gen-docs.js @@ -911,9 +911,6 @@ var generate = function (options_in, callBack) { fileName = fileName[fileName.length - 1]; fse.copySync(path.resolve(process.cwd(), file), ABS_WEBAPP + '/resources/extra/css/' + fileName); } - - return Q.all(); - }).then(function() { //generate information on the groups for the UI generateGroupManifest(groups);
Remove unneeded promise and Q.all in the end of gen-docs.generate
Vertafore_docular
train
js
5e529e16e241a50f010ae868258f187c35f292e9
diff --git a/src/com/google/javascript/jscomp/GatherModuleMetadata.java b/src/com/google/javascript/jscomp/GatherModuleMetadata.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/GatherModuleMetadata.java +++ b/src/com/google/javascript/jscomp/GatherModuleMetadata.java @@ -261,8 +261,9 @@ public final class GatherModuleMetadata implements HotSwapCompilerPass { @Override public void visit(NodeTraversal t, Node n, Node parent) { if (processCommonJsModules && currentModule != null && currentModule.isScript()) { - if (ProcessCommonJSModules.isCommonJsExport(t, n, moduleResolutionMode) - || ProcessCommonJSModules.isCommonJsImport(n, moduleResolutionMode)) { + // A common JS import (call to "require") does not force a module to be rewritten as + // commonJS. Only an export statement. + if (ProcessCommonJSModules.isCommonJsExport(t, n, moduleResolutionMode)) { currentModule.moduleType(ModuleType.COMMON_JS, t, n); return; }
Only mark a module as CommonJS when an export statement is encountered. The CommonJS "require" call can be used as a module loader from a script tag. The presence of a "require" call does not indicate that the file is a CommonJS module. Fixes #<I> Closes <URL>
google_closure-compiler
train
java
3db889d5823f7f739b54b4316f973fce42115300
diff --git a/pycbc/inference/sampler/__init__.py b/pycbc/inference/sampler/__init__.py index <HASH>..<HASH> 100644 --- a/pycbc/inference/sampler/__init__.py +++ b/pycbc/inference/sampler/__init__.py @@ -22,18 +22,22 @@ from __future__ import absolute_import from .base import (initial_dist_from_config, create_new_output_file) from .emcee import EmceeEnsembleSampler from .emcee_pt import EmceePTSampler -from .epsie import EpsieSampler from .multinest import MultinestSampler # list of available samplers samplers = {cls.name: cls for cls in ( EmceeEnsembleSampler, EmceePTSampler, - EpsieSampler, MultinestSampler )} try: + from .epsie import EpsieSampler + samplers[EpsieSampler.name] = EpsieSampler +except ImportError: + pass + +try: from .cpnest import CPNestSampler samplers[CPNestSampler.name] = CPNestSampler except ImportError:
don't hard require epsie (#<I>)
gwastro_pycbc
train
py
0fdf7d979ac128cd6b08faa90f645957ddafb5b1
diff --git a/integration_tests/ctesque/src/sharedTest/java/android/content/res/ResourcesTest.java b/integration_tests/ctesque/src/sharedTest/java/android/content/res/ResourcesTest.java index <HASH>..<HASH> 100644 --- a/integration_tests/ctesque/src/sharedTest/java/android/content/res/ResourcesTest.java +++ b/integration_tests/ctesque/src/sharedTest/java/android/content/res/ResourcesTest.java @@ -452,7 +452,9 @@ public class ResourcesTest { float density = resources.getDisplayMetrics().density; NinePatchDrawable ninePatchDrawable = (NinePatchDrawable) resources.getDrawable(R.drawable.nine_patch_drawable); - assertThat((float) ninePatchDrawable.getIntrinsicWidth()).isEqualTo(98.0f * density); + // Use Math.round to convert calculated float width to int, + // see NinePatchDrawable#scaleFromDensity. + assertThat(ninePatchDrawable.getIntrinsicWidth()).isEqualTo(Math.round(98.0f * density)); } @Test
Round calculated NinePatchDrawable intrinsic width for ResourcesTest See NinePatchDrawable#scaleFromDensity.
robolectric_robolectric
train
java
a12f7ab8bd284bad5ae3b6a51f278e0f42007267
diff --git a/webtul/db.py b/webtul/db.py index <HASH>..<HASH> 100644 --- a/webtul/db.py +++ b/webtul/db.py @@ -103,7 +103,10 @@ class MySQL: if not isinstance(param, list) and not isinstance(param, tuple): param = (param,) cursor = self.conn.cursor() - ret = cursor.execute(sql, param) + if param is not (): + ret = cursor.execute(sql, param) + else: + ret = cursor.execute(sql) res = cursor.fetchall() cursor.close() return ret, res
fix a bug that sql statement have %s or %s and so on, that it doesn't work
zagfai_webtul
train
py
bdd3d14e169d8eab14349ea9d2431c136e74e104
diff --git a/main.go b/main.go index <HASH>..<HASH> 100644 --- a/main.go +++ b/main.go @@ -222,10 +222,10 @@ func readContents(path string) ([]byte, error) { if err != nil { return nil, err } + defer res.Body.Close() if res.StatusCode != http.StatusOK { return nil, fmt.Errorf("status %s", res.Status) } - defer res.Body.Close() return ioutil.ReadAll(res.Body) }
close the response body regardless of the status code Change-Id: Ieb4aecebfa<I>a<I>adca<I>e<I>f2b<I>
campoy_embedmd
train
go
686aa788f302adf3f0254f0b5fd7ec63d2de45b1
diff --git a/docs/webpack.prd.config.js b/docs/webpack.prd.config.js index <HASH>..<HASH> 100644 --- a/docs/webpack.prd.config.js +++ b/docs/webpack.prd.config.js @@ -57,14 +57,14 @@ module.exports = Object.assign({}, webpackBaseConfig, { context: '.', manifest: dllManifest, }), - // new webpack.optimize.UglifyJsPlugin({ - // compress: { - // warnings: false, - // }, - // output: { - // comments: false, - // }, - // }), + new webpack.optimize.UglifyJsPlugin({ + compress: { + warnings: false, + }, + output: { + comments: false, + }, + }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify('production'),
minify docs bundle in production
sghall_resonance
train
js
070c971d112b545c644f1ccf58ccb731bb11f48e
diff --git a/telethon/tl/custom/message.py b/telethon/tl/custom/message.py index <HASH>..<HASH> 100644 --- a/telethon/tl/custom/message.py +++ b/telethon/tl/custom/message.py @@ -90,6 +90,9 @@ class Message(ChatGetter, SenderGetter, TLObject, abc.ABC): You may want to access the `photo`, `document` etc. properties instead. + If the media was not present or it was :tl:`MessageMediaEmpty`, + this member will instead be ``None`` for convenience. + reply_markup (:tl:`ReplyMarkup`): The reply markup for this message (which was sent either via a bot or by a bot). You probably want @@ -153,7 +156,9 @@ class Message(ChatGetter, SenderGetter, TLObject, abc.ABC): self.message = message self.fwd_from = fwd_from self.via_bot_id = via_bot_id - self.media = media + self.media = None if isinstance( + media, types.MessageMediaEmpty) else media + self.reply_markup = reply_markup self.entities = entities self.views = views
Set media as None if it is MessageMediaEmpty
LonamiWebs_Telethon
train
py
fe1e2dbe6e21c3f1d7edc86fc796adbc809d578c
diff --git a/cli/lib/cli/version.rb b/cli/lib/cli/version.rb index <HASH>..<HASH> 100644 --- a/cli/lib/cli/version.rb +++ b/cli/lib/cli/version.rb @@ -1,5 +1,5 @@ module Bosh module Cli - VERSION = "0.3.7" + VERSION = "0.4.0" end end
CLI -> <I> (new syntax for some commands)
cloudfoundry_bosh
train
rb
002ed4b3ed83018b5e802e74d87e2d1587248aff
diff --git a/src/IBAN/Core/IBAN.php b/src/IBAN/Core/IBAN.php index <HASH>..<HASH> 100644 --- a/src/IBAN/Core/IBAN.php +++ b/src/IBAN/Core/IBAN.php @@ -70,6 +70,7 @@ class IBAN } private function getNumericRepresentation($letterRepresentation) { + $numericRepresentation = ''; foreach (str_split($letterRepresentation) as $char) { if (array_search($char, \IBAN\Core\Constants::$letterMapping)) { $numericRepresentation .= array_search($char, \IBAN\Core\Constants::$letterMapping) + 9;
Initialized property numericRepresentation
jschaedl_Iban
train
php
07de8c7577d36904e85a1e51f4fdd60a30e114d2
diff --git a/src/feat/agencies/emu/database.py b/src/feat/agencies/emu/database.py index <HASH>..<HASH> 100644 --- a/src/feat/agencies/emu/database.py +++ b/src/feat/agencies/emu/database.py @@ -157,6 +157,9 @@ class Database(common.ConnectionManager, log.LogProxy, ChangeListener, d.addCallback(self._perform_reduce, factory) return d + def disconnect(self): + pass + ### private def _matches_filter(self, tup, **filter_options): diff --git a/src/feat/agencies/net/agency.py b/src/feat/agencies/net/agency.py index <HASH>..<HASH> 100644 --- a/src/feat/agencies/net/agency.py +++ b/src/feat/agencies/net/agency.py @@ -416,6 +416,8 @@ class Agency(agency.Agency): d.addCallback(defer.drop_param, self._gateway.cleanup) if self._journaler: d.addCallback(defer.drop_param, self._journaler.close) + if self._database: + d.addCallback(defer.drop_param, self._database.disconnect) if self._broker: d.addCallback(defer.drop_param, self._broker.disconnect) return d
Disconnect the DB when terminating the agency
f3at_feat
train
py,py
faed552e082d05cfcf87fbbfc71b6b891abce023
diff --git a/Random.php b/Random.php index <HASH>..<HASH> 100644 --- a/Random.php +++ b/Random.php @@ -164,7 +164,7 @@ class Random { * @param int $size * The number of random keys to add to the object. * - * @return \stdClass + * @return object * The generated object, with the specified number of random keys. Each key * has a random string value. */
Issue #<I> by yogeshmpawar, idebr, pifagor, klausi: Fix unused imports and update Coder to <I>
drupal_core-utility
train
php
8fd667e4e5e2975e2127f0acb60b9c30742e9b40
diff --git a/lib/jdbc_adapter/jdbc_postgre.rb b/lib/jdbc_adapter/jdbc_postgre.rb index <HASH>..<HASH> 100644 --- a/lib/jdbc_adapter/jdbc_postgre.rb +++ b/lib/jdbc_adapter/jdbc_postgre.rb @@ -121,7 +121,9 @@ module ::JdbcSpec end def quote_regclass(table_name) - table_name.to_s.split('.').map { |part| quote_table_name(part) }.join('.') + table_name.to_s.split('.').map do |part| + part =~ /".*"/i ? part : quote_table_name(part) + end.join('.') end # Find a table's primary key and sequence.
FIX: table name parts were being quoted, even if they already had quotes.
jruby_activerecord-jdbc-adapter
train
rb
af812ff84331289b1ff9c7e6460b7bd35dae3817
diff --git a/test_project/tests/model_tests.py b/test_project/tests/model_tests.py index <HASH>..<HASH> 100644 --- a/test_project/tests/model_tests.py +++ b/test_project/tests/model_tests.py @@ -251,6 +251,26 @@ class TestEntityManager(EntityTestCase): set(entities_0se).union([team_entity, team2_entity, team_group_entity, competitor_entity]), set(Entity.objects.intersect_super_entities())) + def test_intersect_super_entities_none_is_type(self): + """ + Tests the base case of intersection on no super entities with a type specified. + """ + # Create test accounts that have three types of super entities + team = Team.objects.create() + team2 = Team.objects.create() + team_group = TeamGroup.objects.create() + competitor = Competitor.objects.create() + + # Create accounts that have four super entities + for i in range(5): + Account.objects.create(competitor=competitor, team=team, team2=team2, team_group=team_group) + + # Create accounts that have no super entities + entities_0se = set(Entity.objects.get_for_obj(Account.objects.create()) for i in range(5)) + + self.assertEquals( + set(entities_0se), set(Entity.objects.intersect_super_entities().is_type(self.account_type))) + def test_intersect_super_entities_manager(self): """ Tests the intersection of super entity types for an entity directly from the entity manager.
added one more test for intersection with type filtering
ambitioninc_django-entity
train
py
46756114060fce89898f489f6b7f04f7a255d08b
diff --git a/salt/client/ssh/__init__.py b/salt/client/ssh/__init__.py index <HASH>..<HASH> 100644 --- a/salt/client/ssh/__init__.py +++ b/salt/client/ssh/__init__.py @@ -137,7 +137,7 @@ class SSH(object): def get_pubkey(self): ''' - Return the keystring for the SSH public key + Return the key string for the SSH public key ''' priv = self.opts.get( 'ssh_priv', @@ -245,7 +245,7 @@ class SSH(object): def handle_ssh(self): ''' Spin up the needed threads or processes and execute the subsequent - rouintes + routines ''' que = multiprocessing.Queue() running = {} @@ -470,7 +470,7 @@ class Single(object): def cmd(self): ''' - Prepare the precheck command to send to the subsystem + Prepare the pre-check command to send to the subsystem ''' # 1. check if python is on the target # 2. check is salt-call is on the target @@ -496,7 +496,7 @@ class Single(object): def cmd_block(self, is_retry=False): ''' - Prepare the precheck command to send to the subsystem + Prepare the pre-check command to send to the subsystem ''' # 1. check if python is on the target # 2. check is salt-call is on the target
More spelling fixes in in-line docs.
saltstack_salt
train
py
3c7f6d639155b476c4c787a9cce6b0cdf74d2eff
diff --git a/core-bundle/src/Resources/contao/library/Contao/Model/Collection.php b/core-bundle/src/Resources/contao/library/Contao/Model/Collection.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/library/Contao/Model/Collection.php +++ b/core-bundle/src/Resources/contao/library/Contao/Model/Collection.php @@ -139,13 +139,11 @@ class Collection implements \ArrayAccess, \Countable, \IteratorAggregate static public function createFromDbResult(\Database\Result $objResult, $strTable) { $arrModels = array(); + $strClass = \Model::getClassFromTable($strTable); while ($objResult->next()) { - $strClass = \Model::getClassFromTable($strTable); - $strPk = $strClass::getPk(); - $intPk = $objResult->$strPk; - $objModel = \Model\Registry::getInstance()->fetch($strTable, $intPk); + $objModel = \Model\Registry::getInstance()->fetch($strTable, $objResult->{$strClass::getPk()}); if ($objModel !== null) {
[Core] Micro-optimize the `Model\Collection::createFromDbResult()` method
contao_contao
train
php
ad5cb7cab6a8f49d25bcc33ee965d5514abeffb0
diff --git a/core/src/main/java/jenkins/util/JSONSignatureValidator.java b/core/src/main/java/jenkins/util/JSONSignatureValidator.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/jenkins/util/JSONSignatureValidator.java +++ b/core/src/main/java/jenkins/util/JSONSignatureValidator.java @@ -73,6 +73,9 @@ public class JSONSignatureValidator { // which isn't useful at all Set<TrustAnchor> anchors = new HashSet<TrustAnchor>(); // CertificateUtil.getDefaultRootCAs(); Jenkins j = Jenkins.getInstance(); + if (j == null) { + return FormValidation.error("Jenkins has shut down, cannot find root CAs"); + } for (String cert : (Set<String>) j.servletContext.getResourcePaths("/WEB-INF/update-center-rootCAs")) { if (cert.endsWith(".txt")) continue; // skip text files that are meant to be documentation anchors.add(new TrustAnchor((X509Certificate)cf.generateCertificate(j.servletContext.getResourceAsStream(cert)),null));
Avoid NPE if DailyCheck happens to run during shutdown.
jenkinsci_jenkins
train
java
d35e1b62e7de866825c16038d88064e85a24a151
diff --git a/tests/acceptance/SwitchOffCest.php b/tests/acceptance/SwitchOffCest.php index <HASH>..<HASH> 100644 --- a/tests/acceptance/SwitchOffCest.php +++ b/tests/acceptance/SwitchOffCest.php @@ -46,7 +46,15 @@ class SwitchOffCest extends Cest { ] ); $I->amEditingPostWithId( $id ); $I->switchOff(); - $I->seeCurrentUrlEquals( '/hello-world?switched_off=true' ); + + try { + // WordPress >= 5.7: + $I->seeCurrentUrlEquals( '/hello-world?switched_off=true' ); + } catch ( \PHPUnit\Framework\ExpectationFailedException $e ) { + // WordPress < 5.7: + $I->seeCurrentUrlEquals( '?switched_off=true' ); + } + $I->amLoggedOut(); }
Allow the redirect location assertion to vary.
johnbillion_user-switching
train
php
0f9d1bb223bb1ba5edbdd557f2f2f3551a51061f
diff --git a/release/long_running_tests/workloads/serve_failure.py b/release/long_running_tests/workloads/serve_failure.py index <HASH>..<HASH> 100644 --- a/release/long_running_tests/workloads/serve_failure.py +++ b/release/long_running_tests/workloads/serve_failure.py @@ -56,7 +56,6 @@ class RandomKiller: class RandomTest: def __init__(self, max_deployments=1): - self.client = serve.connect() self.max_deployments = max_deployments self.weighted_actions = [ (self.create_deployment, 1), @@ -69,8 +68,7 @@ class RandomTest: def create_deployment(self): if len(self.deployments) == self.max_deployments: deployment_to_delete = self.deployments.pop() - self.client.delete_deployment(deployment_to_delete) - self.client.delete_backend(deployment_to_delete) + serve.delete_deployment(deployment_to_delete) new_name = "".join( [random.choice(string.ascii_letters) for _ in range(10)])
Serve failure release test fix (#<I>) This test is currently not tested in CI
ray-project_ray
train
py
45a301842905cc9c2a3d6a7f5bee4d46495864d5
diff --git a/benchbuild/project.py b/benchbuild/project.py index <HASH>..<HASH> 100644 --- a/benchbuild/project.py +++ b/benchbuild/project.py @@ -227,7 +227,7 @@ class Project(metaclass=ProjectDecorator): source: Sources = attr.ib( default=attr.Factory(lambda self: type(self).SOURCE, takes_self=True)) - primary_source: source.BaseSource = attr.ib(init=False) + primary_source: str = attr.ib(init=False) @primary_source.default def __default_primary_source(self) -> str:
project: annotate the correct type
PolyJIT_benchbuild
train
py
5e4eb1315d5c64be9337ba78b75408a50bafd7f4
diff --git a/Lib/glyphsLib/classes.py b/Lib/glyphsLib/classes.py index <HASH>..<HASH> 100755 --- a/Lib/glyphsLib/classes.py +++ b/Lib/glyphsLib/classes.py @@ -401,14 +401,19 @@ class GSCustomParameter(GSBase): class GSAlignmentZone(GSBase): + + def __init__(self, line = None, pos = 0, size = 20): + if line: + super(GSAlignmentZone, self).__init__(line) + else: + self.position = pos + self.size = size + def read(self, src): if src is not None: p = point(src) self.position = float(p.value[0]) self.size = float(p.value[1]) - else: - self.position = 0 - self.size = 20 return self def __repr__(self):
add init method to GSAlignmentZone
googlefonts_glyphsLib
train
py
8ad3c54a1c6a9df8ee2babbdcdf7910c7922d67c
diff --git a/devices/philips.js b/devices/philips.js index <HASH>..<HASH> 100644 --- a/devices/philips.js +++ b/devices/philips.js @@ -1866,7 +1866,7 @@ module.exports = [ ota: ota.zigbeeOTA, }, { - zigbeeModel: ['LOM002', 'LOM004'], + zigbeeModel: ['LOM002', 'LOM004', 'LOM010'], model: '046677552343', vendor: 'Philips', description: 'Hue smart plug bluetooth', @@ -2104,6 +2104,20 @@ module.exports = [ extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [222, 454]}), }, { + zigbeeModel: ['LWE005'], + model: '9290024796', + vendor: 'Philips', + description: 'Hue Filament White E12', + extend: hueExtend.light_onoff_brightness(), + }, + { + zigbeeModel: ['LTA007'], + model: '9290024783', + vendor: 'Philips', + description: 'Hue Filament White Ambiance A60/E27 Bluetooth', + extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [222, 454]}), + }, + { zigbeeModel: ['LWV002'], model: '046677551780', vendor: 'Philips',
Add LOM<I> to <I> and add <I>, <I> (#<I>) * Update philips.js * Update philips.js * Update philips.js * Update philips.js * Update philips.js
Koenkk_zigbee-shepherd-converters
train
js
f870ec5c2c684f8fccb805d444cbb97b2f1ace2d
diff --git a/lib/chef/resource/apt_repository.rb b/lib/chef/resource/apt_repository.rb index <HASH>..<HASH> 100644 --- a/lib/chef/resource/apt_repository.rb +++ b/lib/chef/resource/apt_repository.rb @@ -120,7 +120,7 @@ class Chef property :components, Array, description: "Package groupings, such as 'main' and 'stable'.", - default: lazy { [] } + default: lazy { [] }, default_description: "'main' if using a PPA repository." property :arch, [String, nil, FalseClass], description: "Constrain packages to a particular CPU architecture such as 'i386' or 'amd64'."
apt_repository: add a description for components when using a PPA When you're using a PPA there's a default here that doesn't apply to non-PPA repos.
chef_chef
train
rb
ebada92c0151033ccda50eabe08606753e4098f3
diff --git a/test/assertions/to-have-items-satisfying.spec.js b/test/assertions/to-have-items-satisfying.spec.js index <HASH>..<HASH> 100644 --- a/test/assertions/to-have-items-satisfying.spec.js +++ b/test/assertions/to-have-items-satisfying.spec.js @@ -151,14 +151,6 @@ describe('to have items satisfying assertion', () => { ); }); - it('provides the item index to the callback function', () => { - var arr = ['0', '1', '2', '3']; - expect(arr, 'to have items satisfying', function(item, index) { - expect(index, 'to be a number'); - expect(index, 'to be', parseInt(item, 10)); - }); - }); - it('fails when the assertion fails', () => { expect( function() {
to have items satisfying: Don't expect the index to be passed as the 2nd parameter
unexpectedjs_unexpected
train
js
96b565cd42a3bbfec4800d31c7300dcb2f173518
diff --git a/tests/codeception/_support/WorkingSilex.php b/tests/codeception/_support/WorkingSilex.php index <HASH>..<HASH> 100644 --- a/tests/codeception/_support/WorkingSilex.php +++ b/tests/codeception/_support/WorkingSilex.php @@ -26,6 +26,11 @@ class WorkingSilex extends Silex public function _before(TestInterface $test) { $this->reloadApp(); + } + + protected function loadApp() + { + parent::loadApp(); $this->app->finish(function () { if ($this->app['mailer.initialized'] && $this->app['swiftmailer.use_spool'] && $this->app['swiftmailer.spooltransport'] instanceof \Swift_Transport_SpoolTransport) {
[Codeception] Move mailer hack to `loadApp` method to ensure it's always applied.
bolt_bolt
train
php
8197e437083efb3f97170d7024dce695c4ce5980
diff --git a/src/core/plugin.js b/src/core/plugin.js index <HASH>..<HASH> 100644 --- a/src/core/plugin.js +++ b/src/core/plugin.js @@ -28,4 +28,4 @@ module.exports = plugin; //module.exports._plugins = _plugins; module.exports.enable = enable; module.exports.getList = getList; -module.exports.getActive = function(){return active}; \ No newline at end of file +module.exports.getActive = function(){return active;}; \ No newline at end of file diff --git a/src/loader/particleParser.js b/src/loader/particleParser.js index <HASH>..<HASH> 100644 --- a/src/loader/particleParser.js +++ b/src/loader/particleParser.js @@ -8,6 +8,6 @@ module.exports = function() { console.log('Es una particula'); next(); - } + }; }; \ No newline at end of file
fixed some jshint errors
Nazariglez_perenquen
train
js,js
a99a52da8bdfb54ff7e2c4f5494fd14bd05fcbff
diff --git a/SpiffWorkflow/serializer/dict.py b/SpiffWorkflow/serializer/dict.py index <HASH>..<HASH> 100644 --- a/SpiffWorkflow/serializer/dict.py +++ b/SpiffWorkflow/serializer/dict.py @@ -585,9 +585,19 @@ class DictionarySerializer(Serializer): s_state = dict(name=spec.name, description=spec.description, file=spec.file) + + if 'Root' not in spec.task_specs: + # This is to fix up the case when we + # load in a task spec and there is no root object. + # it causes problems when we deserialize and then re-serialize + # because the deserialize process adds a root. + root = Simple(spec, 'Root') + spec.task_specs['Root'] = root + mylista = [v for k, v in list(spec.task_specs.items())] mylist = [(k, v.serialize(self)) for k, v in list(spec.task_specs.items())] + s_state['task_specs'] = dict(mylist) return s_state
Fixed a problem when we had a serialize/deserialize loop where root was not in the initial serialize, but the deserialize added it
knipknap_SpiffWorkflow
train
py
4eb85f3f40fe3102b9dd1a196f7d292d35b60295
diff --git a/lib/routes.js b/lib/routes.js index <HASH>..<HASH> 100644 --- a/lib/routes.js +++ b/lib/routes.js @@ -28,7 +28,7 @@ const _ = require('lodash'), */ function addSiteLocals(site) { return function (req, res, next) { - res.locals.url = req.protocol + '://' + req.get('host') + req.originalUrl; + res.locals.url = req.protocol + '://' + req.hostname + req.originalUrl; res.locals.site = site; next();
use X-Forwarded-Host for locals.url if exists
clay_amphora
train
js
9fbd2e94bd54a9b67b47b772c9c8fa056cfb62bc
diff --git a/cmd/minikube/cmd/update-context.go b/cmd/minikube/cmd/update-context.go index <HASH>..<HASH> 100644 --- a/cmd/minikube/cmd/update-context.go +++ b/cmd/minikube/cmd/update-context.go @@ -45,5 +45,11 @@ var updateContextCmd = &cobra.Command{ } else { out.T(style.Meh, `No changes required for the "{{.context}}" context`, out.V{"context": cname}) } + + if err := kubeconfig.SetCurrentContext(cname, kubeconfig.PathFromEnv()); err != nil { + out.ErrT(style.Sad, `Error while setting kubectl current context: {{.error}}`, out.V{"error": err}) + } else { + out.T(style.Kubectl, `Current context is "{{.context}}"`, out.V{"context": cname}) + } }, }
update-context: Automatically set the context as current/active in kubeconfig
kubernetes_minikube
train
go
6e8a2175051d2591e85b0c58ed397fa95df46e89
diff --git a/src/Payload/Decoder.php b/src/Payload/Decoder.php index <HASH>..<HASH> 100644 --- a/src/Payload/Decoder.php +++ b/src/Payload/Decoder.php @@ -55,7 +55,7 @@ class Decoder extends AbstractPayload implements Countable ($payload[0] >> 0b100) & 0b1]; // rsv3 $this->opCode = $payload[0] & 0xF; - $this->mask = (bool) $payload[1] >> 0b111; + $this->mask = (bool) ($payload[1] >> 0b111); $payloadOffset = 2;
$this->mask is boolean type!
Wisembly_elephant.io
train
php
f6e616334bf190b04bc492f6074f1119ce97aee1
diff --git a/test/integration/test-promise-wrappers.js b/test/integration/test-promise-wrappers.js index <HASH>..<HASH> 100644 --- a/test/integration/test-promise-wrappers.js +++ b/test/integration/test-promise-wrappers.js @@ -1,5 +1,12 @@ var config = require('../common.js').config; +var skipTest = false; +if (!Promise) { + console.log('no Promise support, skipping test'); + skipTest = true; + return; +} + var assert = require('assert'); var createConnection = require('../../promise.js').createConnection; @@ -49,6 +56,9 @@ testBasic(); testErrors(); process.on('exit', function () { + if (skipTest) { + return; + } assert.equal(doneCalled, true); assert.equal(exceptionCaught, true); });
skip Promise test in node with no Promise support
sidorares_node-mysql2
train
js
519d9b2ee9200201433cbcad9f190c82f0482f1f
diff --git a/jest-common/src/main/java/io/searchbox/client/config/discovery/NodeChecker.java b/jest-common/src/main/java/io/searchbox/client/config/discovery/NodeChecker.java index <HASH>..<HASH> 100644 --- a/jest-common/src/main/java/io/searchbox/client/config/discovery/NodeChecker.java +++ b/jest-common/src/main/java/io/searchbox/client/config/discovery/NodeChecker.java @@ -19,7 +19,7 @@ import java.util.Map.Entry; public class NodeChecker extends AbstractScheduledService { private final static Logger logger = LoggerFactory.getLogger(NodeChecker.class); - private final NodesInfo action = new NodesInfo.Builder().build(); + private final NodesInfo action = new NodesInfo.Builder().http(true).build(); //actual client config instance JestClient client; ClientConfig clientConfig;
enhancement: NodesInfo action in NodeChecker needs only the http section but requested all. This should reduce the payload for each NodeChecker run.
searchbox-io_Jest
train
java
a5cbaf9d4646d2b2d06e1d7659e728d625c07ca3
diff --git a/lib/jets/spec_helpers.rb b/lib/jets/spec_helpers.rb index <HASH>..<HASH> 100644 --- a/lib/jets/spec_helpers.rb +++ b/lib/jets/spec_helpers.rb @@ -9,7 +9,7 @@ module Jets end end -unless ENV["SKIP_MIGRATION_CHECK"] == "true" +if File.exist?("#{Jets.root}/config/database.yml") && !ENV["SKIP_MIGRATION_CHECK"] ActiveRecord::Tasks::DatabaseTasks.db_dir = "#{Jets.root}/db" ActiveRecord::Migration.extend ActiveRecord::MigrationChecker ActiveRecord::Migration.prepare_test_db
fix rspec execution for projects with no database
tongueroo_jets
train
rb