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
4967d7470258c82bb466f574b82b97dc45619f7c
diff --git a/lib/run.js b/lib/run.js index <HASH>..<HASH> 100644 --- a/lib/run.js +++ b/lib/run.js @@ -244,12 +244,7 @@ module.exports = function (options, callback) { stack: 'AssertionFailure: Expected tests["' + assertion + '"] to be truthy\n' + ' at Object.eval test.js:' + (index + 1) + ':' + ((o.cursor && o.cursor.position || 0) + 1) + ')' - }), { - cursor: o.cursor, - assertion: assertion, - event: o.event, - item: o.item - }); + }), _.extend({ assertion: assertion }, o)); index += 1; });
Made sure that the assertion event emitted by run handler forwards all event arguments
postmanlabs_newman
train
js
6df87a03837e8c73ed6d7fdbba5048aad037a1fb
diff --git a/internal/uidriver/glfw/ui.go b/internal/uidriver/glfw/ui.go index <HASH>..<HASH> 100644 --- a/internal/uidriver/glfw/ui.go +++ b/internal/uidriver/glfw/ui.go @@ -631,6 +631,7 @@ func (u *UserInterface) SetCursorShape(shape driver.CursorShape) { func (u *UserInterface) DeviceScaleFactor() float64 { if !u.isRunning() { + // TODO: Use the initWindowPosition. This requires to convert the units correctly (#1575). return devicescale.GetAt(u.initMonitor.GetPos()) } diff --git a/internal/uidriver/glfw/window.go b/internal/uidriver/glfw/window.go index <HASH>..<HASH> 100644 --- a/internal/uidriver/glfw/window.go +++ b/internal/uidriver/glfw/window.go @@ -245,8 +245,7 @@ func (w *window) SetSize(width, height int) { } func (w *window) SizeLimits() (minw, minh, maxw, maxh int) { - minw, minh, maxw, maxh = w.ui.getWindowSizeLimitsInDP() - return + return w.ui.getWindowSizeLimitsInDP() } func (w *window) SetSizeLimits(minw, minh, maxw, maxh int) {
internal/uidriver: Add comments Updates #<I>
hajimehoshi_ebiten
train
go,go
1cf25e9e9952c07c1864f879ec886750aab68cd5
diff --git a/lib/pg_charmer.rb b/lib/pg_charmer.rb index <HASH>..<HASH> 100644 --- a/lib/pg_charmer.rb +++ b/lib/pg_charmer.rb @@ -62,11 +62,14 @@ end ActionController::Base.instance_eval do def use_db_connection(connection, args) - klasses = args.delete(:for).map { |klass| if klass.is_a? String then klass else klass.name end } + default_connections = {} + klass_names = args.delete(:for) + klass_names.each do |klass_name| + default_connections[klass_name] = connection + end + before_filter(args) do |controller, &block| - klasses.each do |klass| - PgCharmer.overwritten_default_connections[klass] = connection - end + PgCharmer.overwritten_default_connections.merge!(default_connections) end end
Premature optimization never hurt :)
sauspiel_postamt
train
rb
f106354105ad57369dac75357e9225bd52842e1b
diff --git a/commands/ui/ui.go b/commands/ui/ui.go index <HASH>..<HASH> 100644 --- a/commands/ui/ui.go +++ b/commands/ui/ui.go @@ -71,7 +71,7 @@ func NewTestUI(out io.Writer) UI { // DisplayTable presents a two dimentional array of strings as a table func (ui UI) DisplayTable(prefix string, table [][]string) { - tw := tabwriter.NewWriter(ui.Out, 0, 1, 2, ' ', 0) + tw := tabwriter.NewWriter(ui.Out, 0, 1, 4, ' ', 0) for _, row := range table { fmt.Fprint(tw, prefix)
change padding on common help to 4 spaces [fixes #<I>]
cloudfoundry_cli
train
go
b8d81c2276d6f6ecd7801c8b65eea2b90c7eabe7
diff --git a/src/EdvinasKrucas/Notification/NotificationServiceProvider.php b/src/EdvinasKrucas/Notification/NotificationServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/EdvinasKrucas/Notification/NotificationServiceProvider.php +++ b/src/EdvinasKrucas/Notification/NotificationServiceProvider.php @@ -28,12 +28,12 @@ class NotificationServiceProvider extends ServiceProvider { */ public function register() { + $this->app['config']->package('edvinaskrucas/notification', __DIR__.'/../config'); + $this->app['notification'] = $this->app->share(function($app) { return new Notification($this->app['config'], $this->app['session']); }); - - $this->app['config']->package('edvinaskrucas/notification', __DIR__.'/../config'); } /**
Changed method order in register() method
edvinaskrucas_notification
train
php
3b772abc541a3ab95943fbc9ea12d699142a5287
diff --git a/test/connection.js b/test/connection.js index <HASH>..<HASH> 100644 --- a/test/connection.js +++ b/test/connection.js @@ -5,7 +5,7 @@ var assert = require("chai").assert; var CasparCG = require("../"); -var debug = false; +var debug = true; var port = 8000; describe("connection", function () { @@ -13,7 +13,7 @@ describe("connection", function () { var server1; var connection1; - beforeEach(function (done) { + before(function (done) { server1 = new net.createServer(); server1.listen(port); @@ -49,7 +49,7 @@ describe("connection", function () { var server3; var connection3; - beforeEach(function (done) { + before(function (done) { server2 = new net.createServer(); server2.listen(port);
turn on debug output and simplify tests
respectTheCode_node-caspar-cg
train
js
be4130e6f04b79606da4ccf13e2d1a98e47d4633
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -156,6 +156,7 @@ function cors (opts) { obj[key] = _handler }) } else { + var obj = {} var _handler = toCors(handler) obj.options = _handler obj.get = _handler
need an obj in cors if-else (#<I>)
shipharbor_merry
train
js
b4ee219d92461305636f4e3e8189db2cb92dbd80
diff --git a/src/admin/importers/CmslayoutImporter.php b/src/admin/importers/CmslayoutImporter.php index <HASH>..<HASH> 100644 --- a/src/admin/importers/CmslayoutImporter.php +++ b/src/admin/importers/CmslayoutImporter.php @@ -57,6 +57,14 @@ class CmslayoutImporter extends Importer try { $json = Json::decode($json); + + // the rows column defines the placeholders + // if the rows column does not exists fail back to normal layout processing + if (isset($json['rows'])) { + $json = $json['rows']; + } else { + $json = false; + } } catch (\Exception $e) { $json = false; }
Added ability to provide json file for cms layouts in order to render the grid in the admin according to the frontend. closes #<I>
luyadev_luya-module-cms
train
php
4986a65489f0c687de60b04e639f066e9911d835
diff --git a/mtools/mlaunch/mlaunch.py b/mtools/mlaunch/mlaunch.py index <HASH>..<HASH> 100755 --- a/mtools/mlaunch/mlaunch.py +++ b/mtools/mlaunch/mlaunch.py @@ -221,7 +221,7 @@ class MLaunchTool(BaseCmdLineTool): getattr(self, self.args['command'])() - # -- below are the main commands: init, start, stop, list + # -- below are the main commands: init, start, stop, list, kill def init(self): """ sub-command init. Branches out to sharded, replicaset or single node methods. """ @@ -833,6 +833,8 @@ class MLaunchTool(BaseCmdLineTool): in_dict['protocol_version'] = 1 self.loaded_args = in_dict self.startup_info = {} + # hostname was added recently + self.loaded_args['hostname'] = socket.gethostname() elif in_dict['protocol_version'] == 2: self.startup_info = in_dict['startup_info']
fixed bug with hostname not available on upgrade.
rueckstiess_mtools
train
py
c260d9b154936a5f92dd9ad0f91bffac966e4d2f
diff --git a/lib/rackstash/buffer.rb b/lib/rackstash/buffer.rb index <HASH>..<HASH> 100644 --- a/lib/rackstash/buffer.rb +++ b/lib/rackstash/buffer.rb @@ -29,10 +29,10 @@ module Rackstash # # Generally, a non-buffering Buffer will be flushed to the sink after each # logged message. This thus mostly resembles the way traditional loggers work - # in Ruby. A buffering Buffer however holds log messages for a longer time. - # Only at a certain time, all log messages and stored fields will be flushed - # to the {Sink} as a single log event. A common scope for such an event is a - # full request to a Rack app as is used by the shipped Rack {Middleware}. + # in Ruby. A buffering Buffer however holds log messages for a longer time, + # e.g., for the duration of a web request. Only after the request finished + # all log messages and stored fields for this request will be flushed to the + # {Sink} as a single log event. # # While the fields structure of a Buffer is geared towards the format used by # Logstash, it can be adaptd in many ways suited for a specific log target.
Don't refer to the (non-existing yet) rack middleware in the docs
meineerde_rackstash
train
rb
1dfe238263cce7ce377f04cdcb38667d7d47be11
diff --git a/salt/utils/event.py b/salt/utils/event.py index <HASH>..<HASH> 100644 --- a/salt/utils/event.py +++ b/salt/utils/event.py @@ -294,7 +294,7 @@ class Reactor(multiprocessing.Process, salt.state.Compiler): Execute the reaction state ''' for chunk in chunks: - self.wrap.run(low) + self.wrap.run(chunk) def run(self): '''
chunk, not low... This commit completes the circle, the reaction system works!
saltstack_salt
train
py
252c7bf7f6d34d752190dde5865de37043943151
diff --git a/lib/Widget/Db/QueryBuilder.php b/lib/Widget/Db/QueryBuilder.php index <HASH>..<HASH> 100644 --- a/lib/Widget/Db/QueryBuilder.php +++ b/lib/Widget/Db/QueryBuilder.php @@ -223,6 +223,11 @@ class QueryBuilder return $this->execute(); } + /** + * Execute a COUNT query to receive the rows number + * + * @return int + */ public function count() { return (int)$this->db->fetchColumn($this->getSqlForCount(), $this->params);
added docblock for query builder count method
twinh_wei
train
php
3ce19356c2e004c787c7f3508f861cae7851eafc
diff --git a/tests/unit/modules/test_state.py b/tests/unit/modules/test_state.py index <HASH>..<HASH> 100644 --- a/tests/unit/modules/test_state.py +++ b/tests/unit/modules/test_state.py @@ -975,3 +975,19 @@ class StateTestCase(TestCase, LoaderModuleMockMixin): MockJson.flag = False with patch('salt.utils.fopen', mock_open()): self.assertTrue(state.pkg(tar_file, 0, "md5")) + + def test_get_pillar_errors_CC(self): + ''' + Test _get_pillar_errors function. + CC: External clean, Internal clean + :return: + ''' + for int_pillar, ext_pillar in [({'foo': 'bar'}, {'fred': 'baz'}), + ({'foo': 'bar'}, None), + ({}, {'fred': 'baz'})]: + with patch('salt.modules.state.__pillar__', int_pillar): + for opts, res in [({'force': True}, None), + ({'force': False}, None), + ({}, None)]: + assert res == state._get_pillar_errors(kwargs=opts, pillar=ext_pillar) +
Add unit test for _get_pillar_errors when external and internal pillars are clean
saltstack_salt
train
py
167ff563d16a405a89ce449fdb34eb6d99631053
diff --git a/core/state/snapshot/generate.go b/core/state/snapshot/generate.go index <HASH>..<HASH> 100644 --- a/core/state/snapshot/generate.go +++ b/core/state/snapshot/generate.go @@ -151,7 +151,7 @@ func journalProgress(db ethdb.KeyValueWriter, marker []byte, stats *generatorSta // generate is a background thread that iterates over the state and storage tries, // constructing the state snapshot. All the arguments are purely for statistics -// gethering and logging, since the method surfs the blocks as they arrive, often +// gathering and logging, since the method surfs the blocks as they arrive, often // being restarted. func (dl *diskLayer) generate(stats *generatorStats) { // If a database wipe is in operation, wait until it's done
core/state/snapshot: gethring -> gathering typo (#<I>)
ethereum_go-ethereum
train
go
58fe664dd7278ab834fc598d691d8fa6c7f99c3a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -36,9 +36,12 @@ setup(name='zeroless', 'Operating System :: MacOS :: MacOS X', 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX', - 'License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)' + 'License :: OSI Approved :: GNU Lesser General Public License v2\ + or later (LGPLv2+)' ], - keywords='pyzmq zeromq zmq ØMQ networking distributed socket', + keywords='pyzmq zeromq zmq ØMQ networking distributed socket client\ + server p2p publish subscribe request reply push pull\ + communication internet backend microservices', url='https://github.com/zmqless/zeroless', author='Lucas Lira Gomes', author_email='x8lucas8x@gmail.com', diff --git a/zeroless/__init__.py b/zeroless/__init__.py index <HASH>..<HASH> 100644 --- a/zeroless/__init__.py +++ b/zeroless/__init__.py @@ -1,4 +1,4 @@ from .zeroless import * from zeroless_helpers import version -__version__ = version() \ No newline at end of file +__version__ = version()
Updated keywords in setup.py file.
zmqless_python-zeroless
train
py,py
1b52371a664165ccd9569db1b7e78b463cd996b8
diff --git a/pymongo/database.py b/pymongo/database.py index <HASH>..<HASH> 100644 --- a/pymongo/database.py +++ b/pymongo/database.py @@ -355,11 +355,23 @@ class Database(object): result = self.command("validate", unicode(name), full=full) + valid = True + # Pre 1.9 results if "result" in result: info = result["result"] if info.find("exception") != -1 or info.find("corrupt") != -1: raise CollectionInvalid("%s invalid: %s" % (name, info)) + # Post 1.9 sharded results + elif "raw" in result: + for repl, res in result["raw"].iteritems(): + if not res.get("valid", False): + valid = False + break + # Post 1.9 non-sharded results. elif not result.get("valid", False): + valid = False + + if not valid: raise CollectionInvalid("%s invalid: %r" % (name, result)) return result
Support <I> sharded output in validate_collection.
mongodb_mongo-python-driver
train
py
1fdc559b3d97ce9c575cc0c7317ee109f9afea72
diff --git a/wunderlist.js b/wunderlist.js index <HASH>..<HASH> 100755 --- a/wunderlist.js +++ b/wunderlist.js @@ -3,11 +3,15 @@ var app = require('commander') var pkg = require('./package.json') -app - .version(pkg.version) - .command('ls', 'List all of your tasks') +app.version(pkg.version) + .command('inbox', 'View your inbox').alias('ls') + .command('starred', 'View your starred tasks') + .command('today', 'View tasks that are due today') + .command('week', 'View tasks that are due this week') + .command('all', 'View all of your tasks') .command('add [task]', 'Add a task to your inbox') .command('open', 'Open Wunderlist') .command('whoami', 'Display effective user') .command('flush', 'Flush the application cache') - .parse(process.argv) + +app.parse(process.argv)
adds new commands, renames some existing ones
wayneashleyberry_wunderline
train
js
31019c183667e0f9d7d934ff1be218948b00f7c4
diff --git a/character.py b/character.py index <HASH>..<HASH> 100644 --- a/character.py +++ b/character.py @@ -38,7 +38,8 @@ item's name, and the name of the attribute. "SELECT character FROM character_things UNION " "SELECT character FROM character_places UNION " "SELECT character FROM character_portals UNION " - "SELECT character FROM character_subcharacters UNION" + "SELECT inner_character FROM character_subcharacters UNION " + "SELECT outer_character FROM character_subcharacters UNION " "SELECT character FROM character_skills UNION " "SELECT character FROM character_stats"] demands = ["thing_location", "portal", "spot_coords"] diff --git a/closet.py b/closet.py index <HASH>..<HASH> 100644 --- a/closet.py +++ b/closet.py @@ -957,6 +957,8 @@ def mkdb(DB_NAME='default.sqlite'): except sqlite3.OperationalError as e: print("OperationalError during postlude from {0}:".format(tn)) print(e) + import pdb + pdb.set_trace() saveables.append( (demands, provides, prelude, tablenames, postlude)) continue
silly error in SQL of character_subcharacters
LogicalDash_LiSE
train
py,py
e20b30da90f2a1d9071621f9a337c8c41388514f
diff --git a/src/Archive/SearchInterface.php b/src/Archive/SearchInterface.php index <HASH>..<HASH> 100644 --- a/src/Archive/SearchInterface.php +++ b/src/Archive/SearchInterface.php @@ -3,7 +3,7 @@ namespace DreadLabs\VantomasWebsite\Archive; use DreadLabs\VantomasWebsite\Page\PageType; -interface SearchInterface extends \IteratorAggregate, \Countable +interface SearchInterface { /**
[TASK] Remove unnecessary interfaces from Archive/SearchInterface
DreadLabs_VantomasWebsite
train
php
29d888b42757cb7cf89056514c8e894676cab9e0
diff --git a/lib/faye-rails/version.rb b/lib/faye-rails/version.rb index <HASH>..<HASH> 100644 --- a/lib/faye-rails/version.rb +++ b/lib/faye-rails/version.rb @@ -1,3 +1,3 @@ module FayeRails - VERSION = "2.0.1" + VERSION = "2.0.2" end
Bump gem version to <I>.
jamesotron_faye-rails
train
rb
a27b90cfee516caccdefc63ff2d35cb5272f7ac9
diff --git a/src/RootSnippetSourceListBuilder.php b/src/RootSnippetSourceListBuilder.php index <HASH>..<HASH> 100644 --- a/src/RootSnippetSourceListBuilder.php +++ b/src/RootSnippetSourceListBuilder.php @@ -39,7 +39,7 @@ class RootSnippetSourceListBuilder $sourceDataPairs = array_map(function ($productsPerPageData) { $this->validateProductsPerPageData($productsPerPageData); $context = $this->contextBuilder->getContext($productsPerPageData['context']); - return ['context' => $context, 'numItemsPerPage' => (int) $productsPerPageData['number']]; + return ['context' => $context, 'numItemsPerPage' => $productsPerPageData['number']]; }, $sourceArray['products_per_page']); return RootSnippetSourceList::fromArray($sourceDataPairs);
Issue #<I>: Remove superfluous type casting
lizards-and-pumpkins_catalog
train
php
33b21a169f5ad7a7ca43ea148227cc32426f8b68
diff --git a/src/Beaudierman/Ups/Ups.php b/src/Beaudierman/Ups/Ups.php index <HASH>..<HASH> 100644 --- a/src/Beaudierman/Ups/Ups.php +++ b/src/Beaudierman/Ups/Ups.php @@ -173,7 +173,7 @@ class Ups { </PackagingType> <PackageWeight> <UnitOfMeasurement> - <Code>LBS</Code> + <Code>' . $measurement . '</Code> </UnitOfMeasurement> <Weight>' . $weight . '</Weight> </PackageWeight>
Add measurement var instead of hardcoded value for UOM
beaudierman_ups
train
php
a67bd3ba385941c832bd8e728476a5d4a540259c
diff --git a/src/Illuminate/Foundation/helpers.php b/src/Illuminate/Foundation/helpers.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Foundation/helpers.php +++ b/src/Illuminate/Foundation/helpers.php @@ -673,7 +673,7 @@ if (! function_exists('validator')) { * @param array $customAttributes * @return \Illuminate\Contracts\Validation\Validator */ - function validator(array $data, array $rules, array $messages = [], array $customAttributes = []) + function validator(array $data = [], array $rules = [], array $messages = [], array $customAttributes = []) { $factory = app(ValidationFactory::class);
Fix to validator() helper so that a new ValidationFactory can successfully be returned when no arguments are provided.
laravel_framework
train
php
531c494d00ac6e2d320c74427bb588373afb8ae5
diff --git a/lepo/router.py b/lepo/router.py index <HASH>..<HASH> 100644 --- a/lepo/router.py +++ b/lepo/router.py @@ -19,7 +19,7 @@ class Router: @classmethod def from_file(cls, filename): with open(filename) as infp: - if filename.endswith('.yaml'): + if filename.endswith('.yaml') or filename.endswith('.yml'): import yaml data = yaml.safe_load(infp) else:
Also read .yml as YAML Fixes #4
akx_lepo
train
py
b1a5cabc8618119433e16e32bd9a2c53bc3a0a8e
diff --git a/lib/dragonfly/server.rb b/lib/dragonfly/server.rb index <HASH>..<HASH> 100644 --- a/lib/dragonfly/server.rb +++ b/lib/dragonfly/server.rb @@ -68,7 +68,7 @@ module Dragonfly rescue Job::NoSHAGiven => e [400, {"Content-Type" => 'text/plain'}, ["You need to give a SHA parameter"]] rescue Job::IncorrectSHA => e - [400, {"Content-Type" => 'text/plain'}, ["The SHA parameter you gave (#{e}) is incorrect"]] + [400, {"Content-Type" => 'text/plain'}, ["The SHA parameter you gave is incorrect"]] rescue JobNotAllowed => e Dragonfly.warn(e.message) [403, {"Content-Type" => 'text/plain'}, ["Forbidden"]]
Remove incorrect sha parameter from error message The output of the sha param is reported as an XSS vulnerability in some PCI scanners.
markevans_dragonfly
train
rb
191f5dc14a45025fed507e30539ec621b57117a8
diff --git a/client/blocks/stats-navigation/intervals.js b/client/blocks/stats-navigation/intervals.js index <HASH>..<HASH> 100644 --- a/client/blocks/stats-navigation/intervals.js +++ b/client/blocks/stats-navigation/intervals.js @@ -19,7 +19,7 @@ const Intervals = props => { 'is-standalone': standalone, } ); return ( - <SegmentedControl primary className={ classes }> + <SegmentedControl compact primary className={ classes }> { intervals.map( i => { const path = pathTemplate.replace( /{{ interval }}/g, i.value ); return (
Stats: Make segmented control in header compact (#<I>)
Automattic_wp-calypso
train
js
7b9e51096461e44d7d15f19c6cf2cbfc8a068aa5
diff --git a/spyder/plugins/application/container.py b/spyder/plugins/application/container.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/application/container.py +++ b/spyder/plugins/application/container.py @@ -384,10 +384,21 @@ class ApplicationContainer(PluginMainContainer): @Slot() def restart_debug(self): - answer = QMessageBox.warning(self, _("Warning"), - _("Spyder will restart in debug mode: <br><br>" - "Do you want to continue?"), - QMessageBox.Yes | QMessageBox.No) - if answer == QMessageBox.Yes: + box = QMessageBox(QMessageBox.Question, _("Question"), + _("Which debug mode do you want Spyder to restart in?"), + QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel, + parent=self) + verbose = box.button(QMessageBox.Yes) + minimal = box.button(QMessageBox.No) + verbose.setText(_("Verbose")) + minimal.setText(_("Minimal")) + box.exec_() + + if box.clickedButton() == minimal: + os.environ['SPYDER_DEBUG'] = '2' + elif box.clickedButton() == verbose: os.environ['SPYDER_DEBUG'] = '3' - self.sig_restart_requested.emit() + else: + return + + self.sig_restart_requested.emit()
* Add option to select debug mode on restart in debug mode
spyder-ide_spyder
train
py
6f6c7897ae31262d5e7c7defcf18e042e479c849
diff --git a/test/runnel.js b/test/runnel.js index <HASH>..<HASH> 100644 --- a/test/runnel.js +++ b/test/runnel.js @@ -220,7 +220,12 @@ test('\n second callback has syntax error', function (t) { setup(); runnel(uno, synerror, tres, function (err) { - t.ok(/aa/.test(err.message), 'passes syntax error'); + if (!process.browser) + // no way to cover all possible error messages for each browser + t.ok(/aa is not defined/.test(err.message), 'passes syntax error'); + else + t.ok(err, 'passes syntax error') + t.ok(unocalled, 'called uno'); t.notOk(trescalled, 'not called tres');
just testing for existence of syntax error in browsers
thlorenz_runnel
train
js
58bf695de4e054d5eb9614247043a3df4f7a8a2c
diff --git a/sorter/src/main/java/sortpom/util/FileUtil.java b/sorter/src/main/java/sortpom/util/FileUtil.java index <HASH>..<HASH> 100644 --- a/sorter/src/main/java/sortpom/util/FileUtil.java +++ b/sorter/src/main/java/sortpom/util/FileUtil.java @@ -6,7 +6,6 @@ import sortpom.parameter.PluginParameters; import java.io.*; import java.net.URL; -import java.nio.charset.Charset; import java.nio.charset.UnsupportedCharsetException; import java.nio.file.Files; import java.util.Optional; @@ -80,9 +79,9 @@ public class FileUtil { */ public String getPomFileContent() { String content; - try { - content = Files.readString(pomFile.toPath(), Charset.forName(encoding)); - } catch (UnsupportedCharsetException ex) { + try (InputStream inputStream = new FileInputStream(pomFile)) { + content = IOUtils.toString(inputStream, encoding); + } catch (UnsupportedCharsetException ex) { throw new FailureException("Could not handle encoding: " + encoding, ex); } catch (IOException ex) { throw new FailureException("Could not read pom file: " + pomFile.getAbsolutePath(), ex);
Reverted functionality which don't exists until Java <I>
Ekryd_sortpom
train
java
da088b4bc12a11a3900694a28d0be96e64deebf4
diff --git a/src/A256KW.php b/src/A256KW.php index <HASH>..<HASH> 100644 --- a/src/A256KW.php +++ b/src/A256KW.php @@ -17,13 +17,9 @@ class A256KW /** * @param string $kek The Key Encryption Key - * - * @throws \InvalidArgumentException If the size of the KEK is invalid */ protected static function checkKEKSize($kek) { - if (strlen($kek) !== 32) { - throw new \InvalidArgumentException('Bad KEK size'); - } + Assertion::eq(strlen($kek), 32, 'Bad KEK size'); } }
Update A<I>KW.php
Spomky-Labs_aes-key-wrap
train
php
b02d759460391206b2923ca864f0c040be37df57
diff --git a/services/OauthService.php b/services/OauthService.php index <HASH>..<HASH> 100644 --- a/services/OauthService.php +++ b/services/OauthService.php @@ -619,7 +619,8 @@ class OauthService extends BaseApplicationComponent foreach($oauthProviderTypes as $oauthProviderType) { - $providers[$oauthProviderType] = $this->_createProvider($oauthProviderType); + $provider = $this->_createProvider($oauthProviderType); + $providers[$provider->getHandle()] = $provider; } ksort($providers);
Fixed a bug where providers were not properly alphabetically sorted
dukt_oauth
train
php
ca1cfcb230d35925b86baf1201f67868249fcade
diff --git a/parsl/monitoring/monitoring.py b/parsl/monitoring/monitoring.py index <HASH>..<HASH> 100644 --- a/parsl/monitoring/monitoring.py +++ b/parsl/monitoring/monitoring.py @@ -6,6 +6,7 @@ import time import typeguard import datetime import zmq +from functools import wraps import queue from parsl.multiprocessing import ForkProcess, SizedQueue @@ -324,6 +325,7 @@ class MonitoringHub(RepresentationMixin): """ Internal Wrap the Parsl app with a function that will call the monitor function and point it at the correct pid when the task begins. """ + @wraps(f) def wrapped(*args: List[Any], **kwargs: Dict[str, Any]) -> Any: # Send first message to monitoring router send_first_message(try_id,
adds wraps to monitoring so functions have their names back (#<I>) Callables lose their name attributes when monitoring is turned on as the wrapper function for monitoring doesn't wrap callables correctly. More details can be found in this issue: <URL>
Parsl_parsl
train
py
a4fc5be046870d2d24d6bf7b9db6eac28028c35b
diff --git a/app/assets/javascripts/pageflow/editor/views/entry_preview_view.js b/app/assets/javascripts/pageflow/editor/views/entry_preview_view.js index <HASH>..<HASH> 100644 --- a/app/assets/javascripts/pageflow/editor/views/entry_preview_view.js +++ b/app/assets/javascripts/pageflow/editor/views/entry_preview_view.js @@ -93,7 +93,7 @@ pageflow.EntryPreviewView = Backbone.Marionette.ItemView.extend({ view.ui.overview.overview(); }); - this.$el.toggleClass('emphasize_chapter_beginning', !!this.model.get('emphasize_chapter_beginning')); + this.$el.toggleClass('emphasize_chapter_beginning', !!this.model.configuration.get('emphasize_chapter_beginning')); }, updateWidgets: function(partials) {
Read emphasize_chapter_beginning from Entry Configuration
codevise_pageflow
train
js
b38bdfc1c72dc72a9068a3e0a86fdf2e376f7ce6
diff --git a/recordext/functions/set_record_documents.py b/recordext/functions/set_record_documents.py index <HASH>..<HASH> 100644 --- a/recordext/functions/set_record_documents.py +++ b/recordext/functions/set_record_documents.py @@ -24,7 +24,7 @@ import os from invenio.base.utils import toposort_depends from invenio.modules.documents import api from invenio.modules.documents.tasks import set_document_contents -from invenio.modules.pidstore.recordext.functions import reserve_recid +from invenio_records.recordext.functions import reserve_recid from invenio_records.signals import before_record_insert from invenio_records.utils import name_generator
pidstore: removal of recid provider * INCOMPATIBLE Removes recid provider, reserve recid function and * datacite tasks as they were ported to invenio-records package. (addresses inveniosoftware/invenio-records#6)
inveniosoftware-attic_invenio-documents
train
py
527ffc8af46a13fdda6a438fff851bcf913bf2a7
diff --git a/lib/neo4j/rails/relationships/node_dsl.rb b/lib/neo4j/rails/relationships/node_dsl.rb index <HASH>..<HASH> 100644 --- a/lib/neo4j/rails/relationships/node_dsl.rb +++ b/lib/neo4j/rails/relationships/node_dsl.rb @@ -58,6 +58,10 @@ module Neo4j @storage.persisted? end + def to_ary + all.to_a + end + # Specifies the depth of the traversal def depth(d) adapt_to_traverser.depth(d)
Add a to_ary since the Rails ActionView needs(Thanks Depaak) [#<I>]
neo4jrb_neo4j
train
rb
effd5447f8072607f7dffc94c33241d154971ee2
diff --git a/core-bundle/tests/Controller/FrontendModule/TwoFactorControllerTest.php b/core-bundle/tests/Controller/FrontendModule/TwoFactorControllerTest.php index <HASH>..<HASH> 100644 --- a/core-bundle/tests/Controller/FrontendModule/TwoFactorControllerTest.php +++ b/core-bundle/tests/Controller/FrontendModule/TwoFactorControllerTest.php @@ -43,13 +43,6 @@ use Symfony\Contracts\Translation\TranslatorInterface; class TwoFactorControllerTest extends TestCase { - protected function setUp(): void - { - parent::setUp(); - - System::setContainer($this->getContainerWithContaoConfiguration()); - } - public function testReturnsEmptyResponseIfTheUserIsNotFullyAuthenticated(): void { $container = $this->getContainerWithFrameworkTemplate(
Removed an unused setup method (see #<I>) Description ----------- Figured out this setup method is never used because every test method calls `getContainerWithFrameworkTemplate` which sets `System::setContainer` anyway. Commits ------- 4f<I> Removed unused setup method
contao_contao
train
php
1a1e42a15d5cd0c5dff58c42fc7a2c278d4da2bc
diff --git a/src/nerdbank-gitversioning.npm/gulpfile.js b/src/nerdbank-gitversioning.npm/gulpfile.js index <HASH>..<HASH> 100644 --- a/src/nerdbank-gitversioning.npm/gulpfile.js +++ b/src/nerdbank-gitversioning.npm/gulpfile.js @@ -24,9 +24,9 @@ gulp.task('tsc', function() { } }; return merge([ - tsResult.dts.pipe(gulp.dest(`${outDir}/definitions`)), + tsResult.dts.pipe(gulp.dest(outDir)), tsResult.js - .pipe(sourcemaps.write(`maps`)) + .pipe(sourcemaps.write('.')) .pipe(replace({ tokens: replacements, preserveUnknownTokens: true // we'll set the remaining ones later.
Keep typings and maps in root directory of package
AArnott_Nerdbank.GitVersioning
train
js
37b9550d62685d450553437776978518ccca631b
diff --git a/coremain/version.go b/coremain/version.go index <HASH>..<HASH> 100644 --- a/coremain/version.go +++ b/coremain/version.go @@ -2,7 +2,7 @@ package coremain // Various CoreDNS constants. const ( - CoreVersion = "1.6.2" + CoreVersion = "1.6.3" coreName = "CoreDNS" serverType = "dns" )
Up version to <I> (#<I>)
coredns_coredns
train
go
2ec66293fab3193ea351848930a89786d79bcd6e
diff --git a/lib/rspec_api_documentation/example.rb b/lib/rspec_api_documentation/example.rb index <HASH>..<HASH> 100644 --- a/lib/rspec_api_documentation/example.rb +++ b/lib/rspec_api_documentation/example.rb @@ -39,7 +39,7 @@ module RspecApiDocumentation end def explanation - metadata[:explanation] || "" + metadata[:explanation] || nil end end end diff --git a/spec/example_spec.rb b/spec/example_spec.rb index <HASH>..<HASH> 100644 --- a/spec/example_spec.rb +++ b/spec/example_spec.rb @@ -138,7 +138,7 @@ describe RspecApiDocumentation::Example do end it "should return an empty string when not set" do - example.explanation.should == "" + example.explanation.should == nil end end end
Example#explanation should return nil so that the Mustache template won't render it
zipmark_rspec_api_documentation
train
rb,rb
8097b2df561b963cb479b252f0308926198725a6
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -104,9 +104,16 @@ module.exports = { return `<link rel="preload" href="${rootUrl}/assets/fonts/${font}" as="font" type="font/woff2" crossorigin="anonymous">`; }); const linkText = links.join("\n"); + let polyfillIoScript = ''; + + if (env.environment === "production") { + //provides polyfills based on the users browser, Safari 12 requires Intl.PluralRules and Intl.RelativeTimeFormat for each locale we support + polyfillIoScript = '<script src="https://polyfill.io/v3/polyfill.min.js?version=3.52.1&features=Intl.PluralRules%252CIntl.PluralRules.%257Elocale.en%252CIntl.PluralRules.%257Elocale.es%252CIntl.PluralRules.%257Elocale.fr%252CIntl.RelativeTimeFormat%252CIntl.RelativeTimeFormat.%257Elocale.en%252CIntl.RelativeTimeFormat.%257Elocale.fr%252CIntl.RelativeTimeFormat.%257Elocale.es"></script>'; + } return ` <title>Ilios</title> + ${polyfillIoScript} ${linkText} `; }
Add polyfill for safari <I> This version, which is still in active use, doesn't have the Intl libs we need. Using the polyfill.io service creates a script that uses the browser agent to decide what data to send so users of more modern browsers won't need to download and execute this.
ilios_common
train
js
c6c9e4a33e66a81b4eb322c1702d1364fe30d52d
diff --git a/payment_sixpay/indico_payment_sixpay/controllers.py b/payment_sixpay/indico_payment_sixpay/controllers.py index <HASH>..<HASH> 100644 --- a/payment_sixpay/indico_payment_sixpay/controllers.py +++ b/payment_sixpay/indico_payment_sixpay/controllers.py @@ -114,7 +114,7 @@ class RHInitSixpayPayment(RHPaymentBase): try: resp.raise_for_status() except RequestException as exc: - self.logger.error('Could not initialize payment: %s', exc.response.text) + SixpayPaymentPlugin.logger.error('Could not initialize payment: %s', exc.response.text) raise Exception('Could not initialize payment') return resp.json()
Payment/Sixpay: Fix error logging
indico_indico-plugins
train
py
29dbbe3af31e91d820becb2c355144fb3d22374f
diff --git a/cmd/kops/secrets_expose.go b/cmd/kops/secrets_expose.go index <HASH>..<HASH> 100644 --- a/cmd/kops/secrets_expose.go +++ b/cmd/kops/secrets_expose.go @@ -100,7 +100,7 @@ func (cmd *ExposeSecretsCommand) Run() error { return fmt.Errorf("secret type not known: %q", cmd.Type) } - _, err := fmt.Fprint(os.Stdout, value) + _, err := fmt.Fprint(os.Stdout, value + "\n") if err != nil { return fmt.Errorf("error writing to output: %v", err) }
When exposing secrets, output a blank line afterwards Otherwise it becomes hard to copy and paste
kubernetes_kops
train
go
34e2972cc227fbce7886bc978a3215f669eff388
diff --git a/lib/mapnik.js b/lib/mapnik.js index <HASH>..<HASH> 100644 --- a/lib/mapnik.js +++ b/lib/mapnik.js @@ -11,9 +11,11 @@ var sm = new (require('sphericalmercator')); var cache = {}; -// Increase number of threads to 1.5x the number of logical CPUs. -var threads = Math.ceil(Math.max(4, require('os').cpus().length * 1.5)); -require('eio').setMinParallel(threads); +if (process.platform !== 'win32') { + // Increase number of threads to 1.5x the number of logical CPUs. + var threads = Math.ceil(Math.max(4, require('os').cpus().length * 1.5)); + require('eio').setMinParallel(threads); +} exports = module.exports = MapnikSource;
node-eio only makes sense on unix
mapbox_tilelive-mapnik
train
js
2d3eb3defee126da75d3c28baef1c5cad789250f
diff --git a/src/main/java/com/lazerycode/jmeter/testrunner/TestManager.java b/src/main/java/com/lazerycode/jmeter/testrunner/TestManager.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/lazerycode/jmeter/testrunner/TestManager.java +++ b/src/main/java/com/lazerycode/jmeter/testrunner/TestManager.java @@ -119,6 +119,15 @@ public class TestManager { JMeterProcessBuilder.addArguments(argumentsArray); try { final Process process = JMeterProcessBuilder.startProcess(); + + Runtime.getRuntime().addShutdownHook(new Thread() { + @Override + public void run() { + LOGGER.info("Shutdown detected, destroying JMeter process..."); + process.destroy(); + } + }); + BufferedReader br = new BufferedReader(new InputStreamReader(process.getInputStream())); String line; while ((line = br.readLine()) != null) {
Fix #<I> add a shutdown hook to destroy the JMeter process if the parent thread is terminated.
jmeter-maven-plugin_jmeter-maven-plugin
train
java
fdd900ac9c84c87206742a5b44741167236e392d
diff --git a/tasks/jekyll_post.js b/tasks/jekyll_post.js index <HASH>..<HASH> 100644 --- a/tasks/jekyll_post.js +++ b/tasks/jekyll_post.js @@ -69,6 +69,8 @@ module.exports = function(grunt) { } else { grunt.fail.warn("Your Gruntfile's jekyll_post task needs a `title` question."); } + + done(); }); } });
Added done(); so the task can move on
JasonEtco_grunt-jekyll-post
train
js
e124acca476a5b2b5e327a125be8c5949a306995
diff --git a/Kwc/Articles/Directory/Controller.php b/Kwc/Articles/Directory/Controller.php index <HASH>..<HASH> 100644 --- a/Kwc/Articles/Directory/Controller.php +++ b/Kwc/Articles/Directory/Controller.php @@ -4,7 +4,10 @@ class Kwc_Articles_Directory_Controller extends Kwf_Controller_Action_Auto_Kwc_G protected $_buttons = array('save', 'add'); protected $_paging = 25; protected $_filters = array('text'=>true); - protected $_defaultOrder = array('field'=>'date', 'direction'=>'DESC'); + protected $_defaultOrder = array( + array('field'=>'date', 'direction'=>'DESC'), + array('field'=>'priority', 'direction'=>'DESC') + ); protected function _initColumns() {
added order for priority in backend for articles
koala-framework_koala-framework
train
php
83a513901ab3bade0995405fe70c3e1d3668b6ca
diff --git a/completer.js b/completer.js index <HASH>..<HASH> 100644 --- a/completer.js +++ b/completer.js @@ -175,15 +175,21 @@ exports.search = search = function(phrase, count, callback) { } if (iter == keys.length) { - return callback(null, results); + // it's annoying to deal with dictionaries in js + // turn it into a sorted list for the client's convenience + var ret = []; + for (var key in results) { + ret.push(key); + } + ret.sort(function(a,b) { return results[b] - results[a] }); + return callback(null, ret); } }); }); } else { - callback(null, {}); + callback(null, []); } } }); } -
return search results as sorted list, not dict of scores
jedp_redis-completer
train
js
c0a1e94fc97082f283429bc6c195cac7d821ff4d
diff --git a/src/com/google/javascript/jscomp/Es6ToEs3Converter.java b/src/com/google/javascript/jscomp/Es6ToEs3Converter.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/Es6ToEs3Converter.java +++ b/src/com/google/javascript/jscomp/Es6ToEs3Converter.java @@ -339,8 +339,8 @@ public final class Es6ToEs3Converter implements NodeTraversal.Callback, HotSwapC Node typeNode = type.getRoot(); Node memberType = typeNode.getType() == Token.ELLIPSIS - ? typeNode.getFirstChild().cloneNode() - : typeNode.cloneNode(); + ? typeNode.getFirstChild().cloneTree() + : typeNode.cloneTree(); arrayType.addChildToFront( new Node(Token.BLOCK, memberType).useSourceInfoIfMissingFrom(typeNode)); JSDocInfoBuilder builder = new JSDocInfoBuilder(false);
Use cloneTree instead of cloneNode so that we don't end up with invalid trees. <URL>
google_closure-compiler
train
java
c4eeeee21fb8b1185cc23728cbcc913139347c2c
diff --git a/src/Manager.php b/src/Manager.php index <HASH>..<HASH> 100644 --- a/src/Manager.php +++ b/src/Manager.php @@ -131,4 +131,25 @@ final class Manager { return false; } + + /** + * Check if a table is installed. + * + * @since 1.0 + * + * @param Table $table + * + * @return bool + */ + public static function is_table_installed( Table $table ) { + + /** @var $wpdb \wpdb */ + global $wpdb; + + $name = $table->get_table_name( $wpdb ); + + $results = $wpdb->get_results( "SHOW TABLES LIKE '$name'" ); + + return count( $results ) > 0; + } } \ No newline at end of file
Add method for checking if a table is installed.
iron-bound-designs_IronBound-DB
train
php
29e6f38f26bf06c1c59920948bf3229a21cff81a
diff --git a/src/Command.php b/src/Command.php index <HASH>..<HASH> 100644 --- a/src/Command.php +++ b/src/Command.php @@ -18,8 +18,11 @@ class Command extends \hiqdev\hiart\Command public function search($options = []) { $rows = parent::search($options); - $isBatch = $this->request->getQuery()->getOption('batch'); - return $isBatch ? $rows : reset($rows); + if ($this->request->getQuery()->getOption('batch')) { + return $rows; + } + + return $rows === [] ? null : reset($rows); } }
Fixed Command::search() to treat empty array response for Batch query as null
hiqdev_hipanel-hiart
train
php
297d568a13eb159c21ead592cfe8c7e9ffddb7c6
diff --git a/tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAtomTypeMatcher.java b/tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAtomTypeMatcher.java index <HASH>..<HASH> 100644 --- a/tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAtomTypeMatcher.java +++ b/tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAtomTypeMatcher.java @@ -203,9 +203,11 @@ final class MmffAtomTypeMatcher { * @param symbs symbolic atom types */ private void assignPreliminaryTypes(IAtomContainer container, String[] symbs) { - SmartsMatchers.prepare(container, true); + // shallow copy + IAtomContainer cpy = container.getBuilder().newInstance(IAtomContainer.class, container); + SmartsMatchers.prepare(cpy, true); for (AtomTypePattern matcher : patterns) { - for (final int idx : matcher.matches(container)) { + for (final int idx : matcher.matches(cpy)) { if (symbs[idx] == null) { symbs[idx] = matcher.symb; }
Perform SMARTS matching on a shallow copy.
cdk_cdk
train
java
c300028af9a87071f74a3a430df9ff3f4aaceb82
diff --git a/source/Application/Controller/Admin/statistic_main.php b/source/Application/Controller/Admin/statistic_main.php index <HASH>..<HASH> 100644 --- a/source/Application/Controller/Admin/statistic_main.php +++ b/source/Application/Controller/Admin/statistic_main.php @@ -54,7 +54,7 @@ class Statistic_Main extends oxAdminDetails } // setting all reports data: check for reports and load them - $sPath = getShopBasePath() . "Application/controllers/admin/reports"; + $sPath = getShopBasePath() . "Application/Controller/Admin/Report"; $iLanguage = (int) oxRegistry::getConfig()->getRequestParameter("editlanguage"); $aAllreports = array();
ESDEV-<I> Update path to file to uppercase in statistic_main.php
OXID-eSales_oxideshop_ce
train
php
f48d881b1df3765ed11d0c7227c72b8e19007d1a
diff --git a/configargparse.py b/configargparse.py index <HASH>..<HASH> 100644 --- a/configargparse.py +++ b/configargparse.py @@ -741,10 +741,11 @@ class ArgumentParser(argparse.ArgumentParser): self.error("Unexpected value for %s: '%s'. Expecting 'true', " "'false', 'yes', 'no', '1' or '0'" % (key, value)) elif isinstance(value, list): - accepts_list = (isinstance(action, argparse._StoreAction) and - action.nargs in ('+', '*')) or ( - isinstance(action, argparse._StoreAction) and - isinstance(action.nargs, int) and action.nargs > 1) + accepts_list = ((isinstance(action, argparse._StoreAction) or + isinstance(action, argparse._AppendAction)) and + action.nargs is not None and ( + action.nargs in ('+', '*')) or + (isinstance(action.nargs, int) and action.nargs > 1)) if action is None or isinstance(action, argparse._AppendAction): for list_elem in value:
Redo fix for nargs and append
bw2_ConfigArgParse
train
py
74da98a2dc1e33f9dfc93ec5ba6139922fb810da
diff --git a/src/Dhl/resources/capabilities.php b/src/Dhl/resources/capabilities.php index <HASH>..<HASH> 100644 --- a/src/Dhl/resources/capabilities.php +++ b/src/Dhl/resources/capabilities.php @@ -57,14 +57,10 @@ return array( ), 'option' => array( - 'description' => 'The shipment options', - 'type' => 'array', + 'description' => 'The shipment options (comma separated)', + 'type' => 'string', 'required' => false, - 'location' => 'query', - 'items' => - array( - 'type' => 'string', - ), + 'location' => 'query' ), 'fromPostalCode' => array(
Change option-key in capabiliteis to comma-separated
dhlparcel_dhl-api-wrapper
train
php
4373b9f58c6f461bac1884586002867b1bea3f23
diff --git a/storybook/main.js b/storybook/main.js index <HASH>..<HASH> 100644 --- a/storybook/main.js +++ b/storybook/main.js @@ -8,5 +8,6 @@ module.exports = { '../src/js/contexts/**/stories/typescript/*.tsx', '../src/js/contexts/**/stories/*.(ts|tsx|js|jsx)', '../src/js/all/**/stories/*.(ts|tsx|js|jsx)', + '../src/js/all/stories/typescript/*.tsx', ], };
Added tsx loader for All stories (#<I>)
grommet_grommet
train
js
d44ac50609e3003ec69ad2412ee7aa374c1e78e7
diff --git a/chess/uci.py b/chess/uci.py index <HASH>..<HASH> 100644 --- a/chess/uci.py +++ b/chess/uci.py @@ -1140,6 +1140,8 @@ def popen_engine(command, engine_cls=Engine, setpgrp=False, _popen_lock=threadin >>> engine.author 'T. Romstad, M. Costalba, J. Kiiski, G. Linscott' + :param command: + :param engine_cls: :param setpgrp: Open the engine process in a new process group. This will stop signals (such as keyboard interrupts) from propagating from the parent process. Defaults to ``False``. diff --git a/chess/xboard.py b/chess/xboard.py index <HASH>..<HASH> 100644 --- a/chess/xboard.py +++ b/chess/xboard.py @@ -1449,6 +1449,8 @@ def popen_engine(command, engine_cls=Engine, setpgrp=False, _popen_lock=threadin >>> engine = chess.xboard.popen_engine("/usr/games/crafty") >>> engine.xboard() + :param command: + :param engine_cls: :param setpgrp: Opens the engine process in a new process group. This will stop signals (such as keyboard interrupts) from propagating from the parent process. Defaults to ``False``.
Add some missing :param: docs
niklasf_python-chess
train
py,py
675812eca20b252fa572404be81aecf0c54b114d
diff --git a/pypika/__init__.py b/pypika/__init__.py index <HASH>..<HASH> 100644 --- a/pypika/__init__.py +++ b/pypika/__init__.py @@ -38,4 +38,4 @@ from .utils import JoinException, GroupingException, CaseException, UnionExcepti __author__ = "Timothy Heys" __email__ = "theys@kayak.com" -__version__ = "0.1.14" \ No newline at end of file +__version__ = "0.2.0" \ No newline at end of file
Upgraded verson to <I>
kayak_pypika
train
py
474a8d844d38d7fa47beadea7acf62f35f698d92
diff --git a/it/it-tests/src/test/java/it/serverSystem/RestartTest.java b/it/it-tests/src/test/java/it/serverSystem/RestartTest.java index <HASH>..<HASH> 100644 --- a/it/it-tests/src/test/java/it/serverSystem/RestartTest.java +++ b/it/it-tests/src/test/java/it/serverSystem/RestartTest.java @@ -51,7 +51,7 @@ public class RestartTest { @Rule public ExpectedException thrown = ExpectedException.none(); @Rule - public TestRule safeguardTimeout = new DisableOnDebug(Timeout.seconds(60)); + public TestRule safeguardTimeout = new DisableOnDebug(Timeout.seconds(900)); @After public void stop() {
Fix safeguard timeout in IT RestartTest
SonarSource_sonarqube
train
java
a1cc00eac58793b2edf847229cf9ee664e405e54
diff --git a/src/JpnForPhp/Transliterator/Kana.php b/src/JpnForPhp/Transliterator/Kana.php index <HASH>..<HASH> 100644 --- a/src/JpnForPhp/Transliterator/Kana.php +++ b/src/JpnForPhp/Transliterator/Kana.php @@ -139,7 +139,7 @@ class Kana protected $mapPunctuationMarks = array( ' ' => ' ', ',' => '、', ', ' => '、', '-' => '・', '.' => '。', ':' => ':', '!' => '!', '?' => '?', '(' => '(', ')' => ')', '{' => '{', '}' => '}', - '[' => '[', ']' => ']', '[' => '【', ']' => '】', + '[' => '[', ']' => ']', '~' => '〜', );
Remove duplicated opening/closing brackets (Fixes #<I>)
mbilbille_jpnforphp
train
php
54ba56ac7fe33528150169869ef90752af4f97ce
diff --git a/lib/fog/hmac.rb b/lib/fog/hmac.rb index <HASH>..<HASH> 100644 --- a/lib/fog/hmac.rb +++ b/lib/fog/hmac.rb @@ -2,17 +2,33 @@ module Fog class HMAC def initialize(type, key) - @digest = case type + @key = key + case type when 'sha1' - OpenSSL::Digest::Digest.new('sha1') + setup_sha1 when 'sha256' - OpenSSL::Digest::Digest.new('sha256') + setup_sha256 end - @key = key end def sign(data) - OpenSSL::HMAC.digest(@digest, @key, data) + @signer.call(data) + end + + private + + def setup_sha1 + @digest = OpenSSL::Digest::Digest.new('sha1') + @signer = lambda do |data| + OpenSSL::HMAC.digest(@digest, @key, data) + end + end + + def setup_sha256 + @digest = OpenSSL::Digest::Digest.new('sha256') + @signer = lambda do |data| + OpenSSL::HMAC.digest(@digest, @key, data) + end end end
make hmac stuff a bit more flexible
fog_fog
train
rb
e3ab17ff372a2e40fbb0ea1e749d00433060cf94
diff --git a/lib/fluent/supervisor.rb b/lib/fluent/supervisor.rb index <HASH>..<HASH> 100644 --- a/lib/fluent/supervisor.rb +++ b/lib/fluent/supervisor.rb @@ -359,7 +359,11 @@ module Fluent end def run_worker - require 'sigdump/setup' + begin + require 'sigdump/setup' + rescue Exception + # ignore LoadError and others (related with signals): it may raise these errors in Windows + end @log.init Process.setproctitle("worker:#{@process_name}") if @process_name
fix to rescue any errors for loading sigdump
fluent_fluentd
train
rb
bfdbf81eb0ff5cb88740c2871bd09858f8ab89aa
diff --git a/cmd/gazelle/fix-update.go b/cmd/gazelle/fix-update.go index <HASH>..<HASH> 100644 --- a/cmd/gazelle/fix-update.go +++ b/cmd/gazelle/fix-update.go @@ -234,7 +234,12 @@ func newFixUpdateConfiguration(cmd command, args []string) (*updateConfig, error return nil, fmt.Errorf("failed to evaluate symlinks for repo root: %v", err) } - for _, dir := range uc.c.Dirs { + for i, dir := range uc.c.Dirs { + dir, err = filepath.EvalSymlinks(dir) + if err != nil { + return nil, fmt.Errorf("failed to evaluate symlinks for dir: %v", err) + } + uc.c.Dirs[i] = dir if !isDescendingDir(dir, uc.c.RepoRoot) { return nil, fmt.Errorf("dir %q is not a subdirectory of repo root %q", dir, uc.c.RepoRoot) }
Evaluate symlinks in positional arguments (#<I>) This fixes an error that occurs when Gazelle's positional command line arguments are symbolic links.
bazelbuild_bazel-gazelle
train
go
99241271bb6f583271921e373ff16eab811ad6cd
diff --git a/lib/rest-ftp-daemon/job.rb b/lib/rest-ftp-daemon/job.rb index <HASH>..<HASH> 100644 --- a/lib/rest-ftp-daemon/job.rb +++ b/lib/rest-ftp-daemon/job.rb @@ -9,7 +9,7 @@ module RestFtpDaemon include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation end - FIELDS = [:source, :target, :label, :priority, :notify, :overwrite, :mkdir, :tempfile] + FIELDS = [:source, :target, :label, :priority, :notify, :overwrite, :mkdir, :tempfile, :runs] attr_accessor :wid @@ -212,13 +212,13 @@ module RestFtpDaemon oops :ended, exception, :timeout end - protected - def age return nil if @queued_at.nil? (Time.now - @queued_at).round(2) end + protected + def set attribute, value @mutex.synchronize do @params || {}
Job: make .age method public
bmedici_rest-ftp-daemon
train
rb
ffe4cfad6fcde978e5bf0f580f3c07837a295eae
diff --git a/lockfile.go b/lockfile.go index <HASH>..<HASH> 100644 --- a/lockfile.go +++ b/lockfile.go @@ -108,8 +108,18 @@ func (l Lockfile) TryLock() error { return err } - // return value intentionally ignored, as ignoring it is part of the algorithm - _ = os.Link(tmplock.Name(), name) + // EEXIST and similiar error codes, caught by os.IsExist, are intentionally ignored, + // as it means that someone was faster creating this link + // and ignoring this kind of error is part of the algorithm. + // The we will probably fail the pid owner check later, if this process is still alive. + // We cannot ignore ALL errors, since failure to support hard links, disk full + // as well as many other errors can happen to a filesystem operation + // and we really want to abort on those. + if err := os.Link(tmplock.Name(), name); err != nil { + if !os.IsExist(err) { + return err + } + } fiTmp, err := os.Lstat(tmplock.Name()) if err != nil {
fail properly on unexpected link errors also document the behavior more clearly. Updates #<I>
nightlyone_lockfile
train
go
c7a21fe8ed22e25d7da9d6e8859eccb51720f4b8
diff --git a/fmttab_border_test.go b/fmttab_border_test.go index <HASH>..<HASH> 100644 --- a/fmttab_border_test.go +++ b/fmttab_border_test.go @@ -45,10 +45,10 @@ func TestBorderHorizontalMulti(t *testing.T) { org := fmt.Sprintf("Table%[1]s╔═══════╤═══════╤═══════╗%[1]s║Column1│Column2│Column3║%[1]s╟───────┼───────┼───────╢%[1]s║test │ │ ║ %[1]s╟───────┼───────┼───────╢%[1]s║test2 │ │ ║%[1]s╚═══════╧═══════╧═══════╝%[1]s", eol.EOL) - tab := fmttab.New("Table",fmttab.BorderDouble,nil) - tab.AddColumn("Column1",fmttab.WidthAuto,fmttab.AlignLeft) - tab.AddColumn("Column2",fmttab.WidthAuto,fmttab.AlignLeft) - tab.AddColumn("Column3",fmttab.WidthAuto,fmttab.AlignLeft) + tab := New("Table",BorderDouble,nil) + tab.AddColumn("Column1",WidthAuto,AlignLeft) + tab.AddColumn("Column2",WidthAuto,AlignLeft) + tab.AddColumn("Column3",WidthAuto,AlignLeft) tab.CloseEachColumn=true; tab.AppendData(map[string]interface{} { "Column1": "test",
Update fmttab_border_test.go
arteev_fmttab
train
go
79b4250eac2afa8cf67664075b7c9ec64564de0e
diff --git a/Controller/SnapshotAdminController.php b/Controller/SnapshotAdminController.php index <HASH>..<HASH> 100644 --- a/Controller/SnapshotAdminController.php +++ b/Controller/SnapshotAdminController.php @@ -50,7 +50,7 @@ class SnapshotAdminController extends Controller $form = $this->createForm(CreateSnapshotType::class, $snapshot); if ($request->getMethod() == 'POST') { - $form->submit($request); + $form->submit($request->request->get($form->getName())); if ($form->isValid()) { $snapshotManager = $this->get('sonata.page.manager.snapshot');
Pass form data instead of request object to form::submit (#<I>)
sonata-project_SonataPageBundle
train
php
7fab583ec5dbae190a028faa61e2333c06d4fc69
diff --git a/src/bins.js b/src/bins.js index <HASH>..<HASH> 100644 --- a/src/bins.js +++ b/src/bins.js @@ -169,7 +169,7 @@ module.exports = function(RAW_GENOME_DATA) { return { uniformBinMapper: function(binWidth) { - var name = 'uniform_' + binWidth + '__bin'; + var name = 'uniform_' + binWidth + 'Mb__bin'; if(!isNumber(binWidth)) { throw new Error('binWidth must be numeric: ' + binWidth); } diff --git a/src/genomes.js b/src/genomes.js index <HASH>..<HASH> 100644 --- a/src/genomes.js +++ b/src/genomes.js @@ -20,6 +20,10 @@ Genomes.prototype.binCount = function() { return this._bins.length; }; +Genomes.prototype.getBin = function(idx) { + return this._bins[idx]; +}; + Genomes.prototype.each = function(iteratee) { _.forEach(this._genomesArray, function(region) { iteratee(region, region.name);
Fix for uniform bin mapper request. Get bin by global idx.
warelab_gramene-bins-client
train
js,js
0604ff9897c566fb2759cd0799678cf3590582b1
diff --git a/clam/clamservice.py b/clam/clamservice.py index <HASH>..<HASH> 100755 --- a/clam/clamservice.py +++ b/clam/clamservice.py @@ -821,10 +821,6 @@ class Project: printlog("Creating project '" + project + "'") os.makedirs(settings.ROOT + "projects/" + user + '/' + project) - #project index will need to be regenerated, remove cache - if os.path.exists(os.path.join(settings.ROOT + "projects/" + user,'.index')): - os.unlink(os.path.join(settings.ROOT + "projects/" + user,'.index')) - if not os.path.isdir(settings.ROOT + "projects/" + user + '/' + project + '/input/'): os.makedirs(settings.ROOT + "projects/" + user + '/' + project + "/input") if not os.path.isdir(settings.ROOT + "projects/" + user + '/' + project + '/input'):
do not delete project index on project creation anymore
proycon_clam
train
py
ed83bd9d135a8108fffc4ea5c0b1543fe885bc39
diff --git a/vendor/visualmetrics.py b/vendor/visualmetrics.py index <HASH>..<HASH> 100755 --- a/vendor/visualmetrics.py +++ b/vendor/visualmetrics.py @@ -1172,7 +1172,7 @@ def render_video(directory, video_file): if current_image is not None: command = ['ffmpeg', '-f', 'image2pipe', '-vcodec', 'png', '-r', '30', '-i', '-', '-vcodec', 'libx264', '-r', '30', '-crf', '24', '-g', '15', - '-preset', 'superfast', '-y', video_file] + '-preset', 'superfast', '-vf', 'pad=ceil(iw/2)*2:ceil(ih/2)*2', '-y', video_file] try: proc = subprocess.Popen(command, stdin=subprocess.PIPE) if proc:
make sure the video has an even number of pixels (#<I>)
sitespeedio_browsertime
train
py
be3aa184b8609f3eff45cc18002550bb2ca1c1c3
diff --git a/keyrings/alt/file.py b/keyrings/alt/file.py index <HASH>..<HASH> 100644 --- a/keyrings/alt/file.py +++ b/keyrings/alt/file.py @@ -10,7 +10,7 @@ from keyring.py27compat import configparser from keyring.util import properties from keyring.util.escape import escape as escape_for_ini -from keyrings.cryptfile.file_base import ( +from keyrings.alt.file_base import ( Keyring, decodebytes, encodebytes, )
file.py: fix cherry-pick overlook
jaraco_keyrings.alt
train
py
c89a16e6d8ca6c8a4136d6a6d25579250d1e6fac
diff --git a/db/seeds.rb b/db/seeds.rb index <HASH>..<HASH> 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -78,12 +78,11 @@ params = { 'ovs_bridge_mappings' => [], 'ovs_bridge_uplinks' => [], 'ovs_tunnel_iface' => 'eth0', - 'tenant_network_type' => 'gre', + 'tenant_network_type' => 'vxlan', 'enable_tunneling' => 'True', 'ovs_vxlan_udp_port' => '4789', - 'ovs_tunnel_types' => [], + 'ovs_tunnel_types' => ['vxlan'], 'auto_assign_floating_ip' => 'True', - 'neutron_core_plugin' => 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2', 'cisco_vswitch_plugin' => 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2', 'cisco_nexus_plugin' => 'neutron.plugins.cisco.nexus.cisco_nexus_plugin_v2.NexusPlugin', 'nexus_config' => {},
BZ #<I> - Tweak settings for ML2 as default
theforeman_staypuft
train
rb
7528a1ebe7050de5b80af431e8e1c9de4d1df20f
diff --git a/extensions/wisdom-monitor/src/main/resources/assets/js/wisit/shell/WisitShellComp.js b/extensions/wisdom-monitor/src/main/resources/assets/js/wisit/shell/WisitShellComp.js index <HASH>..<HASH> 100644 --- a/extensions/wisdom-monitor/src/main/resources/assets/js/wisit/shell/WisitShellComp.js +++ b/extensions/wisdom-monitor/src/main/resources/assets/js/wisit/shell/WisitShellComp.js @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Fix file header (trailing space)
wisdom-framework_wisdom
train
js
03f15ebb2a21e24a2a7458b9022ce05e89137fa4
diff --git a/cherrypy/test/test_misc_tools.py b/cherrypy/test/test_misc_tools.py index <HASH>..<HASH> 100644 --- a/cherrypy/test/test_misc_tools.py +++ b/cherrypy/test/test_misc_tools.py @@ -197,7 +197,7 @@ class AutoVaryTest(helper.CPWebCase): def testAutoVary(self): self.getPage('/autovary/') self.assertHeader( - "Vary", 'Accept, Accept-Encoding, Host, If-Modified-Since, Range') + "Vary", 'Accept, Accept-Charset, Accept-Encoding, Host, If-Modified-Since, Range') if __name__ == "__main__":
Updated vary test for always-on encoding. We ''want'' Accept-Charset in the list since output will vary based on it.
cherrypy_cheroot
train
py
cfc461c3f8ee3a5f35fb05c75e492176c4d8854a
diff --git a/activerecord/lib/active_record/relation/calculations.rb b/activerecord/lib/active_record/relation/calculations.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/relation/calculations.rb +++ b/activerecord/lib/active_record/relation/calculations.rb @@ -391,7 +391,7 @@ module ActiveRecord def build_count_subquery(relation, column_name, distinct) relation.select_values = [ if column_name == :all - distinct ? table[Arel.star] : Arel.sql("1") + distinct ? table[Arel.star] : Arel.sql(FinderMethods::ONE_AS_ONE) else column_alias = Arel.sql("count_column") aggregate_column(column_name).as(column_alias)
Ensure `1 AS one` for SQL Server with calculations.
rails_rails
train
rb
d6597faba2898c2469ea175e16f0175b8bf00b6f
diff --git a/packages/cli-plugin-deploy-components/execute/Status.js b/packages/cli-plugin-deploy-components/execute/Status.js index <HASH>..<HASH> 100644 --- a/packages/cli-plugin-deploy-components/execute/Status.js +++ b/packages/cli-plugin-deploy-components/execute/Status.js @@ -20,6 +20,10 @@ class Status { } start() { + if (process.env.CI) { + return; + } + // Hide cursor always, to keep it clean process.stdout.write(ansiEscapes.cursorHide); this.status.running = true; @@ -65,6 +69,10 @@ class Status { } async render(status) { + if (process.env.CI) { + return; + } + // Start Status engine, if it isn't running yet if (!this.isRunning()) { this.start();
fix(cli-plugin-deploy-components): disable status messages in CI
Webiny_webiny-js
train
js
daf8d98f684cf2a1e44b9204ff9edfe4f09e39f7
diff --git a/lib/ooor/relation.rb b/lib/ooor/relation.rb index <HASH>..<HASH> 100644 --- a/lib/ooor/relation.rb +++ b/lib/ooor/relation.rb @@ -17,7 +17,7 @@ module Ooor def build_where(opts, other = [])#TODO OpenERP domain is more than just the intersection of restrictions case opts - when Array + when Array || '|' || '&' [opts] when Hash opts.keys.map {|key|["#{key}", "=", opts[key]]} @@ -26,7 +26,11 @@ module Ooor def where(opts, *rest) relation = clone - relation.where_values += build_where(opts, rest) unless opts.blank? + if opts.is_a?(Array) && opts.any? {|e| e.is_a? Array} + relation.where_values = opts + else + relation.where_values += build_where(opts, rest) unless opts.blank? + end relation end
ablity to pass full OpenERP S-expresions domains in relation.where(...)
akretion_ooor
train
rb
407ae82997e48ad604b31b0c53d1733d26703cb5
diff --git a/expr/node.go b/expr/node.go index <HASH>..<HASH> 100644 --- a/expr/node.go +++ b/expr/node.go @@ -779,9 +779,9 @@ func (m *IdentityNode) Equal(n Node) bool { if nt.Text != m.Text { return false } - if nt.Quote != m.Quote { - return false - } + // if nt.Quote != m.Quote { + // return false + // } return true } return false
Dont force identities to match quote type
araddon_qlbridge
train
go
adcbc2524f2a7aa677dc2098fc1d9e960cb26786
diff --git a/pymysql/tests/test_issues.py b/pymysql/tests/test_issues.py index <HASH>..<HASH> 100644 --- a/pymysql/tests/test_issues.py +++ b/pymysql/tests/test_issues.py @@ -76,7 +76,7 @@ class TestOldIssues(base.PyMySQLTestCase): warnings.filterwarnings("ignore") c.execute("drop table if exists test") c.execute("""CREATE TABLE `test` (`station` int(10) NOT NULL DEFAULT '0', `dh` -datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `echeance` int(1) NOT NULL +datetime NOT NULL DEFAULT '2015-01-01 00:00:00', `echeance` int(1) NOT NULL DEFAULT '0', `me` double DEFAULT NULL, `mo` double DEFAULT NULL, PRIMARY KEY (`station`,`dh`,`echeance`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;""") try:
datetime cannot have <I>-<I>-<I>... as a valid value in <I> - was not part of test so changed to a valid date
PyMySQL_PyMySQL
train
py
4934bb81ca1a1ef969c31fe4db63eef68059cb17
diff --git a/python/setup.py b/python/setup.py index <HASH>..<HASH> 100755 --- a/python/setup.py +++ b/python/setup.py @@ -7,7 +7,7 @@ setup(name='jsbeautifier', description='JavaScript unobfuscator and beautifier.', long_description=('Beautify, unpack or deobfuscate JavaScript. ' 'Handles popular online obfuscators.'), - author='Einar Lielmanis et al.', + author='Einar Lielmanis, Stefano Sanfilippo et al.', author_email='einar@jsbeautifier.org', url='http://jsbeautifier.org', packages=['jsbeautifier', 'jsbeautifier.tests',
Updated copyright notice in setup.py installation facility.
beautify-web_js-beautify
train
py
fca1ebbc55cf19f34227170b41b315ff326da72d
diff --git a/addon/components/sl-grid.js b/addon/components/sl-grid.js index <HASH>..<HASH> 100755 --- a/addon/components/sl-grid.js +++ b/addon/components/sl-grid.js @@ -201,6 +201,19 @@ export default Ember.Component.extend({ // ------------------------------------------------------------------------- // Events + /** + * Post-template insert hook to set column heading default widths + * + * @function + * @returns {undefined} + */ + didInsertElement: function() { + const colHeaders = $( '.list-pane .column-headers tr:first th' ); + this.$( '.list-pane .content > table tr:first td' ).each( function( index ) { + colHeaders.eq( index ).width( $( this ).width() ); + }); + }, + // ------------------------------------------------------------------------- // Properties
added an event hook to set widths on column headers based on data column widths
softlayer_sl-ember-components
train
js
ad72ef35707529058c7c680f334c285746b2f690
diff --git a/gitlab/base.py b/gitlab/base.py index <HASH>..<HASH> 100644 --- a/gitlab/base.py +++ b/gitlab/base.py @@ -16,6 +16,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import importlib +from types import ModuleType from typing import Any, Dict, Optional, Type from .client import Gitlab, GitlabList @@ -38,7 +39,12 @@ class RESTObject(object): without ID in the url. """ - _id_attr = "id" + _id_attr: Optional[str] = "id" + _attrs: Dict[str, Any] + _module: ModuleType + _parent_attrs: Dict[str, Any] + _updated_attrs: Dict[str, Any] + manager: "RESTManager" def __init__(self, manager: "RESTManager", attrs: Dict[str, Any]) -> None: self.__dict__.update(
chore: add additional type-hints for gitlab/base.py Add type-hints for the variables which are set via self.__dict__ mypy doesn't see them when they are assigned via self.__dict__. So declare them in the class definition.
python-gitlab_python-gitlab
train
py
215631d870f5fdc81b3a87ac2ef4bc9e51709a42
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -76,6 +76,7 @@ function attachVirtuals(schema, res) { function attachVirtualsToDoc(schema, doc, virtuals) { const numVirtuals = virtuals.length; + if (doc == null) return; if (Array.isArray(doc)) { for (let i = 0; i < doc.length; ++i) { attachVirtualsToDoc(schema, doc[i], virtuals);
fix: avoid undefined doc from being virtualized
vkarpov15_mongoose-lean-virtuals
train
js
206c8fee1c46d9544f53c00632e23c8fd61013f8
diff --git a/src/Commands/ValidationMakeCommand.php b/src/Commands/ValidationMakeCommand.php index <HASH>..<HASH> 100644 --- a/src/Commands/ValidationMakeCommand.php +++ b/src/Commands/ValidationMakeCommand.php @@ -16,7 +16,7 @@ class ValidationMakeCommand extends GeneratorCommand * * @var string */ - protected $description = 'Create a new validation definition.'; + protected $description = 'Create a new validation definition'; /** * The type of class being generated.
format keep the same styling as existing artisan commands
browner12_validation
train
php
25435f193fb963957f11a16f51df0404f8f36cdf
diff --git a/datascience/tables.py b/datascience/tables.py index <HASH>..<HASH> 100644 --- a/datascience/tables.py +++ b/datascience/tables.py @@ -280,7 +280,32 @@ class Table(collections.abc.MutableMapping): return table def select(self, column_label_or_labels): - """Return a Table with selected column or columns by label.""" + """Return a Table with selected column or columns by label. + + Args: + ``column_label_or_labels`` (string or list of strings): The header + names of the columns to be selected. ``column_label_or_labels`` must + be an existing header name. + + Returns: + An instance of ``Table`` containing only selected columns. + + >>> print(t) + burgers | prices | calories + cheeseburger | 6 | 743 + hamburger | 5 | 651 + veggie burger | 5 | 582 + >>> print(t.select(['burgers', 'calories'])) + burgers | calories + cheeseburger | 743 + hamburger | 651 + veggie burger | 582 + >>> print(t.select('prices')) + prices + 6 + 5 + 5 + """ column_labels = _as_labels(column_label_or_labels) table = Table() for label in column_labels:
wrote docs for table.select
data-8_datascience
train
py
dd4d98086cca5e7e17735bbb3c08187fa5d07ffe
diff --git a/src/Controller/Plugin/FlashData.php b/src/Controller/Plugin/FlashData.php index <HASH>..<HASH> 100644 --- a/src/Controller/Plugin/FlashData.php +++ b/src/Controller/Plugin/FlashData.php @@ -237,18 +237,20 @@ class FlashData extends AbstractPlugin $routeName = $routeMatch->getMatchedRouteName(); } + $routeName = str_replace( + [ + '\\', + '/' + ], '_', $routeName + ); + if (array_key_exists($routeName, $this->sessions)) { return $this->sessions[$routeName]; } $this->sessions[$routeName] = new SessionContainer( $this->getName() . '_' . strtolower( - str_replace( - [ - '\\', - '/' - ], '_', $routeName - ) + $routeName ) );
Chore: Update flash data plugin route name
xloit_xloit-bridge-zend-mvc
train
php
090aef62d1a932254f3675d675bc12839ac446a2
diff --git a/src/Services/Adapters/RequestAdapter.php b/src/Services/Adapters/RequestAdapter.php index <HASH>..<HASH> 100644 --- a/src/Services/Adapters/RequestAdapter.php +++ b/src/Services/Adapters/RequestAdapter.php @@ -46,6 +46,7 @@ abstract class RequestAdapter extends BaseAdapter $payload = array( 'currency_code' => $this->config->baseCurrency, 'notification_url' => $this->config->notificationUrl, + 'redirect_url' => $this->config->redirectUrl, 'name' => $this->payment->person->name, 'email' => $this->payment->person->email, 'amount_total' => $this->payment->amountTotal,
Added redirect_url to adapter
ebanx_benjamin
train
php
47258ca9e2f922be00ca21978bcfa18561f835df
diff --git a/core/src/main/java/org/kohsuke/stapler/Stapler.java b/core/src/main/java/org/kohsuke/stapler/Stapler.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/kohsuke/stapler/Stapler.java +++ b/core/src/main/java/org/kohsuke/stapler/Stapler.java @@ -1,6 +1,5 @@ package org.kohsuke.stapler; -import net.sf.json.JSONObject; import org.apache.commons.beanutils.ConversionException; import org.apache.commons.beanutils.ConvertUtils; import org.apache.commons.beanutils.ConvertUtilsBean; @@ -374,7 +373,7 @@ public class Stapler extends HttpServlet { return null; try { //when URL contains escapes like %20, this does the conversion correctly - return new File(url.toURI().getPath()); + return new File(url.toURI()); } catch (URISyntaxException e) { try { // some containers, such as Winstone, doesn't escape ' ', and for those
new File(URI) is the correct way to convert a URI to a File (pending NIO<I>).
stapler_stapler
train
java
746687fddab09f41f6c46b9c6a22604d96db0730
diff --git a/lib/datapackage/schema.rb b/lib/datapackage/schema.rb index <HASH>..<HASH> 100644 --- a/lib/datapackage/schema.rb +++ b/lib/datapackage/schema.rb @@ -32,7 +32,6 @@ module DataPackage def dereference_schema path_or_url, schema @base_path = base_path path_or_url - paths = hash_to_slashed_path schema['properties'] ref_keys = paths.keys.find { |p| p =~ /\$ref/ } if ref_keys @@ -42,13 +41,10 @@ module DataPackage path = key.split('/')[0..-2] replacement = resolve(schema['properties'].dig(*path, '$ref')) - until path.count == 1 - schema['properties'] = schema['properties'][path.shift] - end - - last_path = path.shift - schema['properties'][last_path].merge! replacement - schema['properties'][last_path].delete '$ref' + s = "schema['properties']#{path.map { |k| "['#{k}']" }.join}.merge! replacement" + eval s + s = "schema['properties']#{path.map { |k| "['#{k}']" }.join}.delete '$ref'" + eval s end end
This feels wrong But I don’t know how else to do it
frictionlessdata_datapackage-rb
train
rb
132b949d44f10fde70eaa8f1d0467271f9bb27e9
diff --git a/lib/transformers.js b/lib/transformers.js index <HASH>..<HASH> 100644 --- a/lib/transformers.js +++ b/lib/transformers.js @@ -193,8 +193,8 @@ exports.mustache = new Transformer({ engines: ['mustache'], outputFormat: 'xml', sync: function(str, options){ - var tmpl = this.cache(options) || this.cache(options, this.engine.compile(str)); - return tmpl(options, options.partials); + str = this.cache(options) || this.cache(options, str); + return this.engine.to_html(str, options, options.partials); } });
Don't cache compiled mustache since the API sucks [closes #<I>] (it's not ideal but it works)
ForbesLindesay-Unmaintained_transformers
train
js
0cdf772d41a5c2abccf713e7541bfd31a802d00e
diff --git a/src/resolvelib/__init__.py b/src/resolvelib/__init__.py index <HASH>..<HASH> 100644 --- a/src/resolvelib/__init__.py +++ b/src/resolvelib/__init__.py @@ -11,7 +11,7 @@ __all__ = [ "ResolutionTooDeep", ] -__version__ = "0.8.0" +__version__ = "0.8.1.dev0" from .providers import AbstractProvider, AbstractResolver
Prebump to <I>.dev0
sarugaku_resolvelib
train
py
3702f744f7c3a4ff564152204ce8b9333076df37
diff --git a/html.go b/html.go index <HASH>..<HASH> 100644 --- a/html.go +++ b/html.go @@ -190,9 +190,9 @@ func (m Minify) HTML(w io.Writer, r io.Reader) error { getAttr(token, "rel") != "external" || attr.Key == "profile" || attr.Key == "xmlns" { if strings.HasPrefix(val, "http:") { val = val[5:] - } else if strings.HasPrefix(val, "https:") { - val = val[6:] - } + }// else if strings.HasPrefix(val, "https:") { // TODO: remove or readd; https: is not the default protocol + // val = val[6:] + //} } else if token.Data == "meta" && attr.Key == "content" { http_equiv := getAttr(token, "http-equiv") if http_equiv == "content-type" {
URL protocol https: not stripped https: is probably not the default protocol and cannot be inferred by the browser, therefore it cannot be removed
tdewolff_minify
train
go
3088f31e055b47c3fc5babc9bde5768def42b452
diff --git a/lib/client.js b/lib/client.js index <HASH>..<HASH> 100644 --- a/lib/client.js +++ b/lib/client.js @@ -192,13 +192,20 @@ Client.prototype.stream = function () { * @param {resultCallback} callback Executes callback(err, result) when the batch was executed */ Client.prototype.batch = function () { + var self = this; var args = this._parseBatchArgs.apply(null, arguments); //logged batch by default args.options = utils.extend({logged: true}, this.options.queryOptions, args.options); - var request = new requests.BatchRequest(args.queries, args.options.consistency, args.options); - var handler = new RequestHandler(this, this.options); - args.callback = utils.bindDomain(args.callback); - handler.send(request, null, args.callback); + + this.connect(function afterConnect(err) { + if (err) { + return args.callback(err); + } + var request = new requests.BatchRequest(args.queries, args.options.consistency, args.options); + var handler = new RequestHandler(self, self.options); + args.callback = utils.bindDomain(args.callback); + handler.send(request, null, args.callback); + }); }; /**
Ensure connection exists before executing batch queries
datastax_nodejs-driver
train
js
47170f8c0e6390a044e42d9189124805449b601c
diff --git a/src/DayPicker.js b/src/DayPicker.js index <HASH>..<HASH> 100644 --- a/src/DayPicker.js +++ b/src/DayPicker.js @@ -25,6 +25,7 @@ class Caption extends Component { // eslint-disable-line } export default class DayPicker extends Component { + static VERSION = "2.0.0"; static propTypes = { tabIndex: PropTypes.number,
Add version number to DayPicker class This can be helpful if you need to figure out what version of a library is actually running in your app.
gpbl_react-day-picker
train
js
631cae75bdb9a806fa3635109814a6b817f39c3a
diff --git a/example.js b/example.js index <HASH>..<HASH> 100644 --- a/example.js +++ b/example.js @@ -12,6 +12,14 @@ var client = new SambaClient({ username: 'Guest' }); +client.mkdir('test-directory', function(err) { + if (err) { + return console.error(err); + } + + console.log('created test directory on samba share at ' + client.address); +}); + client.sendFile(testFile, testFile, function(err) { if (err) { return console.error(err); @@ -28,6 +36,18 @@ client.sendFile(testFile, testFile, function(err) { console.log('got test file from samba share at ' + client.address); }); + + client.fileExists(testFile, function(err, exists) { + if (err) { + return console.error(err); + } + + if (exists) { + console.log('test file exists on samba share at ' + client.address); + } else { + console.log('test file does not exist on samba share at ' + client.address); + } + }); }); process.on('exit', function() {
add examples for mkdir, fileExists
eflexsystems_node-samba-client
train
js
ac109e762ba2e2035b3cd4bedecfd82c28bbefeb
diff --git a/src-modules/org/opencms/workplace/tools/sites/CmsSiteDialogObject.java b/src-modules/org/opencms/workplace/tools/sites/CmsSiteDialogObject.java index <HASH>..<HASH> 100644 --- a/src-modules/org/opencms/workplace/tools/sites/CmsSiteDialogObject.java +++ b/src-modules/org/opencms/workplace/tools/sites/CmsSiteDialogObject.java @@ -512,13 +512,14 @@ public class CmsSiteDialogObject { if ((site != null) && (site.getSiteMatcher() != null)) { uuid = (CmsUUID)site.getSiteRootUUID().clone(); } + String errorPage = CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_errorPage) ? m_errorPage : null; return new CmsSite( m_siteRoot, uuid, m_title, new CmsSiteMatcher(m_server), String.valueOf(m_position), - m_errorPage, + errorPage, matcher, m_exclusiveUrl, m_exclusiveError,
Do not write an empty error page attribute to the system configuration.
alkacon_opencms-core
train
java
42fd04f8dd3d86cac2f6bfa59a7e7fa93cd1deb7
diff --git a/salt/modules/rh_ip.py b/salt/modules/rh_ip.py index <HASH>..<HASH> 100644 --- a/salt/modules/rh_ip.py +++ b/salt/modules/rh_ip.py @@ -1013,7 +1013,10 @@ def build_interface(iface, iface_type, enabled, **settings): salt '*' ip.build_interface eth0 eth <settings> ''' if __grains__['os'] == 'Fedora': - rh_major = '6' + if __grains__['osmajorrelease'] >= 18: + rh_major = '7' + else: + rh_major = '6' else: rh_major = __grains__['osrelease'][:1]
Fix rh_ip template use for Fedora Salt assumes that all Fedora releases conform to the RHEL6 version. This means that on current Fedora releases an older interface template is used resulting in non-working routes. The logic could probably use a bit of rework as I could see future Fedora releases diverging more from RHEL but for now an additional check was added that handles Fedora <I> and higher as RHEL7 (which was branched off from F<I>).
saltstack_salt
train
py
29e4f5dc7c098746570d76987e2275846494ad64
diff --git a/lib/omnibus/project.rb b/lib/omnibus/project.rb index <HASH>..<HASH> 100644 --- a/lib/omnibus/project.rb +++ b/lib/omnibus/project.rb @@ -263,7 +263,7 @@ module Omnibus task "#{@name}:copy" => (package_types.map {|pkg_type| "#{@name}:#{pkg_type}"}) do if OHAI.platform == "windows" - cp_cmd = "xcopy #{config.package_dir}\\* pkg\\ /Y" + cp_cmd = "xcopy #{config.package_dir}\\*.msi pkg\\ /Y" else cp_cmd = "cp #{config.package_dir}/* pkg/" end
Modify release script to copy only msi files as release artifacts
chef_omnibus
train
rb
dab80e34b1e9010a45c9e11a22367fbba5651234
diff --git a/lib/rules/click-events-have-key-events.js b/lib/rules/click-events-have-key-events.js index <HASH>..<HASH> 100644 --- a/lib/rules/click-events-have-key-events.js +++ b/lib/rules/click-events-have-key-events.js @@ -18,7 +18,7 @@ module.exports = { }, create (context) { return VueUtils.defineTemplateBodyVisitor(context, { - "VAttribute[directive=true][key.name='on'][key.argument='click']" (node) { + "VAttribute[directive=true][key.name.name='on'][key.argument.name='click']" (node) { const requiredEvents = ['keydown', 'keyup', 'keypress']; const element = node.parent.parent; if (VueUtils.isCustomComponent(element)) { @@ -42,4 +42,4 @@ module.exports = { } }, JsxRule.create(context)) } -} \ No newline at end of file +}
fix: patch click-events-have-key-events rule
maranran_eslint-plugin-vue-a11y
train
js
3933ccf0fc1bc42fbb9d7e415392cae6e7d04a0e
diff --git a/any_urlfield/registry.py b/any_urlfield/registry.py index <HASH>..<HASH> 100644 --- a/any_urlfield/registry.py +++ b/any_urlfield/registry.py @@ -12,7 +12,7 @@ class UrlType(object): if form_field is None: # Generate default form field if nothing is provided. if has_id_value: - form_field = forms.ModelChoiceField(queryset=model._default_manager.all(), widget=widget) + form_field = lambda: forms.ModelChoiceField(queryset=model._default_manager.all(), widget=widget) else: form_field = forms.CharField(widget=widget)
Use delayed fields for auto-generated ModelChoiceField too.
edoburu_django-any-urlfield
train
py
e54d4f088e006783b1a250fe8764749023fca43c
diff --git a/runtests.py b/runtests.py index <HASH>..<HASH> 100755 --- a/runtests.py +++ b/runtests.py @@ -14,13 +14,12 @@ settings.configure( 'testserver', ], INSTALLED_APPS=[ - 'django_nose', 'permissions', 'permissions.tests', ], MIDDLEWARE_CLASSES=[], ROOT_URLCONF='permissions.tests.urls', - TEST_RUNNER='django_nose.NoseTestSuiteRunner' + TEST_RUNNER='django.test.runner.DiscoverRunner', ) if django.VERSION[:2] >= (1, 7): diff --git a/setup.cfg b/setup.cfg index <HASH>..<HASH> 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +0,0 @@ -[nosetests] -with-coverage = true -cover-package = permissions diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -24,8 +24,6 @@ setup( 'dev': [ 'coverage', 'django{version}'.format(version=django_version), - 'django-nose', - 'nose', 'six', ], },
Use Django's DiscoverRunner to run tests Use this instead of the django_nose runner and drop the django_nose and nose dev dependencies.
PSU-OIT-ARC_django-perms
train
py,cfg,py