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
363ddc78a84cb77d77fa2b48c0125ee79e4a9c54
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ def read(fname): return io.open(file_path, encoding='utf-8').read() -version = '0.8.5.dev0' +version = '0.8.4.3' setuptools.setup(
Preparing release <I>
ecmwf_cfgrib
train
py
b6f77bc58c10d367d38b43fdde4719bf434859f2
diff --git a/lib/config/webpack.config.base.js b/lib/config/webpack.config.base.js index <HASH>..<HASH> 100644 --- a/lib/config/webpack.config.base.js +++ b/lib/config/webpack.config.base.js @@ -4,6 +4,11 @@ const WebpackBar = require('webpackbar'); const ManifestPlugin = require('webpack-manifest-plugin'); const paths = require('./paths'); +let tty = false; +if (process.stdout) { + tty = Boolean(process.stdout.isTTY); +} + let config = { context: paths.appPath, @@ -28,7 +33,10 @@ let config = { }, plugins: [ new WebpackBar({ - color: 'green' + name: '', + color: 'green', + minimal: !tty, + compiledIn: false }), new ManifestPlugin({ fileName: 'static-manifest.json'
webpack config base的webpackBar配置
zuzucheFE_guido
train
js
41642f98156bed89ba99da8e7577576ba660b4f9
diff --git a/lib/generators/sauce/install/install_generator.rb b/lib/generators/sauce/install/install_generator.rb index <HASH>..<HASH> 100644 --- a/lib/generators/sauce/install/install_generator.rb +++ b/lib/generators/sauce/install/install_generator.rb @@ -41,7 +41,6 @@ module Sauce require 'sauce' Sauce.config do |conf| - conf.browser_url = "http://#{@random_id}.test/" conf.browsers = [ ["Windows 2003", "firefox", "3.6."] ]
Remove the unnecessary fake domain nonsense from the Rails2 generator Fixes #<I>
saucelabs_sauce_ruby
train
rb
83a93d2c522db9735a93f513d471489823d3a334
diff --git a/code/libraries/joomlatools/component/koowa/dispatcher/router/route.php b/code/libraries/joomlatools/component/koowa/dispatcher/router/route.php index <HASH>..<HASH> 100644 --- a/code/libraries/joomlatools/component/koowa/dispatcher/router/route.php +++ b/code/libraries/joomlatools/component/koowa/dispatcher/router/route.php @@ -176,8 +176,8 @@ class ComKoowaDispatcherRouterRoute extends KDispatcherRouterRoute // Set application language $params = Joomla\CMS\Component\ComponentHelper::getParams('com_languages'); - $language = $params->get('site', $app->get('language', 'en-GB')); - $app->loadLanguage(Joomla\CMS\Language\Language::getInstance($app->get('language'), $app->get('debug_lang'))); + $language = $params->get($client, $app->get('language', 'en-GB')); + $app->loadLanguage(Joomla\CMS\Language\Language::getInstance($language, $app->get('debug_lang'))); $menu_class = sprintf('\Joomla\CMS\Menu\%sMenu', ucfirst($client));
#<I> Set proper client and make use of the lnaguage variable value just fetched
joomlatools_joomlatools-framework
train
php
0fbef7757a7669cc6bbb94cb5ce41cbf82b6f550
diff --git a/lib/component-hint.js b/lib/component-hint.js index <HASH>..<HASH> 100755 --- a/lib/component-hint.js +++ b/lib/component-hint.js @@ -36,7 +36,7 @@ function loadData(checkPath, cb) { var componentFilename = path.join(checkPath, 'component.json'); fs.exists(componentFilename, function (exists) { if (!exists) { - return cb(new Error('Component JSON file does not exist: ' + componentFilename)); + return callback(new Error('Component JSON file does not exist: ' + componentFilename)); } componentJson = require(componentFilename); diff --git a/lib/tests/checkFilesExist.js b/lib/tests/checkFilesExist.js index <HASH>..<HASH> 100644 --- a/lib/tests/checkFilesExist.js +++ b/lib/tests/checkFilesExist.js @@ -4,11 +4,13 @@ var async = require('async'); /** + * This test checks each file type within the component.json file and checks whether or not they + * exist. * - * @param {type} componentPath - * @param {type} componentData - * @param {type} options - * @param {type} cb + * @param {String} componentPath + * @param {Object} componentData + * @param {Object} options + * @param {Function} cb * @returns {undefined} */ exports.test = function (componentPath, componentData, options, cb) {
Updated some documentation and fixed error with usage of incorrect callback
Wizcorp_component-hint
train
js,js
b4192547b209d7aa1c48fe6676ac164865152b90
diff --git a/src/javascript/runtime/Runtime.js b/src/javascript/runtime/Runtime.js index <HASH>..<HASH> 100644 --- a/src/javascript/runtime/Runtime.js +++ b/src/javascript/runtime/Runtime.js @@ -488,7 +488,9 @@ define('moxie/runtime/Runtime', [ return { uid: runtime.uid, type: runtime.type, - can: runtime.can + can: function() { + return runtime.can.apply(runtime, arguments); + } }; } return null;
Runtime: Run can() method returned from getRuntime() in runtime's object.
moxiecode_moxie
train
js
013fa1df5a5d4bcf3aa66f490d06ffb1c80fb036
diff --git a/test/transfer_test.go b/test/transfer_test.go index <HASH>..<HASH> 100644 --- a/test/transfer_test.go +++ b/test/transfer_test.go @@ -134,8 +134,16 @@ func testClientTransfer(t *testing.T, ps testClientTransferParams) { assert.NotEmpty(t, seederTorrent.PeerConns()) leecherPeerConns := leecherTorrent.PeerConns() assert.NotEmpty(t, leecherPeerConns) + foundSeeder := false for _, pc := range leecherPeerConns { - assert.EqualValues(t, leecherTorrent.Info().NumPieces(), pc.PeerPieces().Len()) + completed := pc.PeerPieces().Len() + t.Logf("peer conn %v has %v completed pieces", pc, completed) + if completed == leecherTorrent.Info().NumPieces() { + foundSeeder = true + } + } + if !foundSeeder { + t.Errorf("didn't find seeder amongst leecher peer conns") } seederStats := seederTorrent.Stats()
Fix transfer test check for seeder piece counts I suspect that there's a race where a connection is established to the seeder, but we haven't received it's completed piece information yet, and we already finished reading all the data we need from another connection. Probably comes up now because pending peers with the same address aren't clobbering each other since that was fixed.
anacrolix_torrent
train
go
1f2a61fe67f9b4f95b16702c81385de2eb5157d0
diff --git a/src/View/Cell/MenuCell.php b/src/View/Cell/MenuCell.php index <HASH>..<HASH> 100644 --- a/src/View/Cell/MenuCell.php +++ b/src/View/Cell/MenuCell.php @@ -128,7 +128,7 @@ class MenuCell extends Cell */ protected function _getMenuItemsFromEvent(EntityInterface $menu, array $modules = []) { - $event = new Event('Menu.Menu.getMenu', $this, [ + $event = new Event('Menu.Menu.getMenuItems', $this, [ 'name' => $menu->name, 'user' => $this->_user, 'fullBaseUrl' => $this->_fullBaseUrl,
Changed Event name (task #<I>)
QoboLtd_cakephp-menu
train
php
31b29a3f514d59ef27791eb23a03480f50fdce09
diff --git a/engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/dialect/impl/OracleSQLDialectAdapter.java b/engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/dialect/impl/OracleSQLDialectAdapter.java index <HASH>..<HASH> 100644 --- a/engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/dialect/impl/OracleSQLDialectAdapter.java +++ b/engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/dialect/impl/OracleSQLDialectAdapter.java @@ -48,7 +48,7 @@ public class OracleSQLDialectAdapter extends SQL99DialectAdapter { SqlDatatypes.put(Types.CHAR, "CHAR"); SqlDatatypes.put(Types.VARCHAR, "VARCHAR(4000)"); SqlDatatypes.put(Types.CLOB, "CLOB"); - SqlDatatypes.put(Types.TIMESTAMP, "VARCHAR(4000)"); + SqlDatatypes.put(Types.TIMESTAMP, "DATE"); SqlDatatypes.put(Types.INTEGER, "INTEGER"); SqlDatatypes.put(Types.BIGINT, "NUMBER(19)"); SqlDatatypes.put(Types.REAL, "NUMBER");
Change Oracle timestamp to DATE instead of VARCHAR(<I>) to maintain time information
ontop_ontop
train
java
e5be90256831f0612b2f5ac668d887e30ad602d7
diff --git a/src/util/Constants.js b/src/util/Constants.js index <HASH>..<HASH> 100644 --- a/src/util/Constants.js +++ b/src/util/Constants.js @@ -60,8 +60,6 @@ exports.DefaultOptions = { $os: process ? process.platform : 'discord.js', $browser: 'discord.js', $device: 'discord.js', - $referrer: '', - $referring_domain: '', }, version: 6, },
where we're going we don't need referrers (#<I>)
discordjs_discord.js
train
js
7e03edc9a79cac0730c5ce236cedf571edf13076
diff --git a/sockjs/cyclone/session.py b/sockjs/cyclone/session.py index <HASH>..<HASH> 100644 --- a/sockjs/cyclone/session.py +++ b/sockjs/cyclone/session.py @@ -437,14 +437,16 @@ class MultiplexChannelSession(BaseSession): self.base = base self.name = name - def send_message(self, msg): - self.base.sendMessage('msg,' + self.name + ',' + msg) + def send_message(self, msg, stats=True): + if not self.base.is_closed: + msg = 'msg,%s,%s' % (self.name, msg) + self.base.session.send_message(msg, stats) def messageReceived(self, msg): self.conn.messageReceived(msg) def close(self, code=3000, message='Go away!'): - self.base.sendMessage('uns,' + self.name) + self.base.sendMessage('uns,%s' % self.name) self._close(code, message) # Non-API version of the close, without sending the close message
added stats argument to send_message for Multiplex sessions
flaviogrossi_sockjs-cyclone
train
py
90850ab4a64a600a8868d27fcc0e51049cc892a7
diff --git a/urwid_datatable/datatable.py b/urwid_datatable/datatable.py index <HASH>..<HASH> 100644 --- a/urwid_datatable/datatable.py +++ b/urwid_datatable/datatable.py @@ -615,7 +615,6 @@ class DataTable(urwid.WidgetWrap): border = self.border, padding = self.padding ) - logger.info("border: %s, padding: %s" %(self.border, self.padding)) self.pile.contents.insert(0, (self.header, self.pile.options('pack')) ) @@ -767,8 +766,8 @@ class DataTable(urwid.WidgetWrap): try: v = self.df[index:index] except IndexError: - logger.error(traceback.format_exc()) - logger.error("%d, %s" %(index, self.df.index)) + logger.debug(traceback.format_exc()) + logger.debug("%d, %s" %(index, self.df.index)) return OrderedDict( (k, v[0])
Quiet logging a bit more.
tonycpsu_panwid
train
py
932ebc73dcc56ca50b7e23d18f2a79101761920d
diff --git a/Classes/TYPO3/Setup/Controller/SetupController.php b/Classes/TYPO3/Setup/Controller/SetupController.php index <HASH>..<HASH> 100644 --- a/Classes/TYPO3/Setup/Controller/SetupController.php +++ b/Classes/TYPO3/Setup/Controller/SetupController.php @@ -49,7 +49,7 @@ class SetupController extends \TYPO3\Flow\Mvc\Controller\ActionController { /** * @return void */ - public function initializeAction() { + protected function initializeAction() { $this->distributionSettings = $this->configurationSource->load(FLOW_PATH_CONFIGURATION . \TYPO3\Flow\Configuration\ConfigurationManager::CONFIGURATION_TYPE_SETTINGS); }
[TASK] initializeAction methods have to be protected Change-Id: I0eee<I>c<I>d0c<I>ccb<I>b<I>a<I>f<I>a<I>f9
neos_setup
train
php
b4c6d82be736baf971ed9c7bc1896413a0577d1e
diff --git a/src/main/java/org/jboss/netty/channel/socket/oio/OioServerSocketPipelineSink.java b/src/main/java/org/jboss/netty/channel/socket/oio/OioServerSocketPipelineSink.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jboss/netty/channel/socket/oio/OioServerSocketPipelineSink.java +++ b/src/main/java/org/jboss/netty/channel/socket/oio/OioServerSocketPipelineSink.java @@ -216,6 +216,12 @@ class OioServerSocketPipelineSink extends AbstractChannelSink { } catch (SocketTimeoutException e) { // Thrown every second to stop when requested. } catch (IOException e) { + // Don't log the exception if the server socket was closed + // by a user. + if (!channel.isBound()) { + break; + } + logger.warn( "Failed to accept a connection.", e); try {
Fixed issue: NETTY-<I> (Unnecessarily logged exception in the blocking I/O server socket) * Suppressed the expected exception logging
netty_netty
train
java
5f2e731f5d034c9d67ac8273dc0e4810f7cda289
diff --git a/sos/plugins/filesys.py b/sos/plugins/filesys.py index <HASH>..<HASH> 100644 --- a/sos/plugins/filesys.py +++ b/sos/plugins/filesys.py @@ -9,7 +9,7 @@ from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin -class Filesys(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): +class Filesys(Plugin, DebianPlugin, UbuntuPlugin): """Local file systems """ @@ -69,4 +69,11 @@ class Filesys(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): self.do_cmd_output_sub("lsof", regex, '') + +class RedHatFilesys(Filesys, RedHatPlugin): + + def setup(self): + super(RedHatFilesys, self).setup() + self.add_cmd_output("ls -ltradZ /tmp") + # vim: set et ts=4 sw=4 :
[filesys] Add permission and selinux check for /tmp Adds a check for the /tmp directory for permissions and selinux context. If either of these are incorrect, the system in question can exhibit strange behavior and otherwise be difficult for support teams to detect. On systems where SELinux is disabled, the permission check is still relevant and the command still produces useful output with the -Z option. Resolves: #<I>
sosreport_sos
train
py
350d234ad0326d3a005082ad6da7be25bc5de994
diff --git a/Layers.js b/Layers.js index <HASH>..<HASH> 100644 --- a/Layers.js +++ b/Layers.js @@ -444,6 +444,10 @@ Object.extend(cop, { // layer around only the class methods layerClass: function(layer, classObject, defs) { + if (!classObject || !classObject.prototype) { + throw new Error("ContextJS: can not refine class '" + + classObject + "' in " + layer); + } cop.layerObject(layer, classObject.prototype, defs); },
Merging remaining webwerkstatt changes for <I> release to core, part 2
LivelyKernel_ContextJS
train
js
ab2ba241a9c88676b4064548837d575b5d221a40
diff --git a/pyte/font/opentype/__init__.py b/pyte/font/opentype/__init__.py index <HASH>..<HASH> 100644 --- a/pyte/font/opentype/__init__.py +++ b/pyte/font/opentype/__init__.py @@ -144,4 +144,9 @@ class OpenTypeMetrics(FontMetrics): return lookup_table.lookup(a.code, b.code) except KeyError: pass + if 'kern' in self._tables: + try: + return self._tables['kern'][0].pairs[a.code][b.code] + except KeyError: + pass return 0.0
OpenType: fall back to using the kern table if GPOS/kern is not present
brechtm_rinohtype
train
py
9989327b5b26bf3079e2f9665cc74b7e5edd9749
diff --git a/cake/tests/lib/reporter/cake_cli_reporter.php b/cake/tests/lib/reporter/cake_cli_reporter.php index <HASH>..<HASH> 100644 --- a/cake/tests/lib/reporter/cake_cli_reporter.php +++ b/cake/tests/lib/reporter/cake_cli_reporter.php @@ -55,11 +55,8 @@ class CakeCliReporter extends CakeBaseReporter { * @param array $params * @return void */ - function CakeCLIReporter($separator = NULL, $params = array()) { - $this->CakeBaseReporter('utf-8', $params); - if (!is_null($separator)) { - $this->setFailDetailSeparator($separator); - } + function CakeCLIReporter($charset = 'utf-8', $params = array()) { + $this->CakeBaseReporter($charset, $params); } function setFailDetailSeparator($separator) {
Fixing constructor of CakeCliReporter to match CakeBaseReporter.
cakephp_cakephp
train
php
a98f721eb96d6e87cae9a2690fa9637fa51fb547
diff --git a/lib/xcodeproj/plist_helper.rb b/lib/xcodeproj/plist_helper.rb index <HASH>..<HASH> 100644 --- a/lib/xcodeproj/plist_helper.rb +++ b/lib/xcodeproj/plist_helper.rb @@ -53,10 +53,10 @@ module Xcodeproj def read(path) path = path.to_s unless File.exist?(path) - raise ArgumentError, "The plist file at path `#{path}` doesn't exist." + raise Informative, "The plist file at path `#{path}` doesn't exist." end if file_in_conflict?(path) - raise ArgumentError, "The file `#{path}` is in a merge conflict" + raise Informative, "The file `#{path}` is in a merge conflict." end CoreFoundation.RubyHashPropertyListRead(path) end
[PlistHelper] Raise Informatives when reading a plist fails (either due to a merge conflict or the plist not existing)
CocoaPods_Xcodeproj
train
rb
b5cc4768d5add5145e9bd9152908995c8294e1d5
diff --git a/lib/freeswitcher.rb b/lib/freeswitcher.rb index <HASH>..<HASH> 100644 --- a/lib/freeswitcher.rb +++ b/lib/freeswitcher.rb @@ -1,9 +1,17 @@ +require 'logger' require 'socket' require 'pp' $LOAD_PATH.unshift(File.dirname(__FILE__)) module FreeSwitcher + # Usage: + # + # Log.info('foo') + # Log.debug('bar') + # Log.warn('foobar') + # Log.error('barfoo') + Log = Logger.new($stdout) end require 'freeswitcher/event' diff --git a/lib/freeswitcher/commands/originate.rb b/lib/freeswitcher/commands/originate.rb index <HASH>..<HASH> 100644 --- a/lib/freeswitcher/commands/originate.rb +++ b/lib/freeswitcher/commands/originate.rb @@ -22,14 +22,9 @@ module FreeSwitcher::Commands else raise "Invalid originator or application" end - debug "saying #{orig_command}" + Log.debug "saying #{orig_command}" @fs_socket.say(orig_command) end - - def debug(message) - $stdout.puts message - $stdout.flush - end end register(:originate, Originate)
Adding FreeSwitcher::Log
vangberg_librevox
train
rb,rb
447241429b6f0c50242796066b050ddc9ebb2d8c
diff --git a/loomengine/client/server.py b/loomengine/client/server.py index <HASH>..<HASH> 100755 --- a/loomengine/client/server.py +++ b/loomengine/client/server.py @@ -90,9 +90,9 @@ class ServerControls: def status(self): verify_has_connection_settings() if is_server_running(): - print 'OK, the server is up.' + print 'OK, the server is up at %s' % get_server_url() else: - raise SystemExit('No response from server at "%s".' % get_server_url()) + raise SystemExit('No response from server at %s' % get_server_url()) @loom_settings_transaction def start(self):
"loom server status" reports ip address
StanfordBioinformatics_loom
train
py
67c264d3c86e778b38dfef6e7b9797a3355bc7e4
diff --git a/Core/PageTree/AlPageTree.php b/Core/PageTree/AlPageTree.php index <HASH>..<HASH> 100644 --- a/Core/PageTree/AlPageTree.php +++ b/Core/PageTree/AlPageTree.php @@ -59,7 +59,7 @@ class AlPageTree /** * Constructor * - * @param ContainerInterface $container + * @param Symfony\Component\DependencyInjection\ContainerInterface $container * @param AlPageBlocksInterface $pageBlocks */ public function __construct(ContainerInterface $container, AlPageBlocksInterface $pageBlocks = null) @@ -68,6 +68,16 @@ class AlPageTree $this->pageBlocks = $pageBlocks; $this->activeTheme = $this->container->get('alphalemon_theme_engine.active_theme'); } + + /** + * Returns the container + * + * @return Symfony\Component\DependencyInjection\ContainerInterface + */ + public function getContainer() + { + return $this->container; + } /** * Sets the template object
Added method to retrieve the container object
alphalemon_ThemeEngineBundle
train
php
3bc87091fba83e8a8dd23d67f06611609d6ef976
diff --git a/pkg/topom/topom.go b/pkg/topom/topom.go index <HASH>..<HASH> 100644 --- a/pkg/topom/topom.go +++ b/pkg/topom/topom.go @@ -103,7 +103,6 @@ func New(client models.Client, config *Config) (*Topom, error) { } s.store = models.NewStore(client, config.ProductName) - s.action.interval.Set(1000 * 10) s.stats.servers = make(map[string]*RedisStats) s.stats.proxies = make(map[string]*ProxyStats)
topom: set default interval of data migration to 0us
CodisLabs_codis
train
go
6c090a8304b689e85888b2a22564627b44176862
diff --git a/test/flac_file_test.rb b/test/flac_file_test.rb index <HASH>..<HASH> 100644 --- a/test/flac_file_test.rb +++ b/test/flac_file_test.rb @@ -44,7 +44,8 @@ class FlacFileTest < Test::Unit::TestCase should "contain flac-specific information" do assert_equal 16, @properties.sample_width - assert_equal "x\xD1\x9B\x86\xDF,\xD4\x88\xB3YW\xE6\xBD\x88Ih", @properties.signature + s = ["78d19b86df2cd488b35957e6bd884968"].pack('H*') + assert_equal s, @properties.signature end end
Fix test failure on Ruby <I> with binary string literal The problem was that <I> interprets string literals as UTF-8 by default now. As the expected string in that test case is binary, we use pack to write it as a literal. On <I>, there is also "string".b, but that is not compatible with <I>/<I>.
robinst_taglib-ruby
train
rb
59453e27d90962ed2c28a8dc06a5a9e401667e12
diff --git a/src/main/java/org/jsoup/parser/CharacterReader.java b/src/main/java/org/jsoup/parser/CharacterReader.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jsoup/parser/CharacterReader.java +++ b/src/main/java/org/jsoup/parser/CharacterReader.java @@ -382,11 +382,10 @@ final class CharacterReader { boolean rangeEquals(final int start, int count, final String cached) { if (count == cached.length()) { char one[] = input; - char two[] = cached.toCharArray(); int i = start; int j = 0; while (count-- != 0) { - if (one[i++] != two[j++]) + if (one[i++] != cached.charAt(j++)) return false; } return true;
Less GC in cache check At expense of getField
jhy_jsoup
train
java
a98993a23143a173ef59996641aa3beb770663cc
diff --git a/src/BankBillet/Views/BancoDoNordeste.php b/src/BankBillet/Views/BancoDoNordeste.php index <HASH>..<HASH> 100644 --- a/src/BankBillet/Views/BancoDoNordeste.php +++ b/src/BankBillet/Views/BancoDoNordeste.php @@ -54,13 +54,11 @@ class BancoDoNordeste extends CaixaEconomicaFederal } /** - * Prepare some data to be used during Draw - * - * @param mixed[] $data Data for the bank billet + * Banco do Banese requires the wallet field to be the wallet operation */ - protected function beforeDraw() + protected function drawBillet() { - $this->models['wallet']->symbol = $this->models['wallet']->operation; - parent::beforeDraw(); + $this->fields['wallet']['value'] = $this->models['wallet']->operation; + parent::drawBillet(); } }
Update BanoDoNordeste view - Replace obsolete beforeDraw() with drawBillet() - Fix wallet field
aryelgois_bank-interchange
train
php
e072f611ec2db1a196564049f9e787eb9079ed1f
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -2,9 +2,10 @@ var jf = require('jsonfile'); var fs = require('fs'); var path = require('path'); var mkdirp = require('mkdirp'); +var nachosHome = require('nachos-home'); -function SettingsFile(path) { - this._path = path; +function SettingsFile(app) { + this._path = nachosHome('data', app + '.json'); } SettingsFile.TEMPLATE = {global: {}, instances: {}};
Getting app name instead of path, using nachos-home
nachos_settings-file
train
js
be6ea0d8738857a1aeed5621506a02d85c84b401
diff --git a/django_deployer/paas_templates/dotcloud/mkadmin.py b/django_deployer/paas_templates/dotcloud/mkadmin.py index <HASH>..<HASH> 100644 --- a/django_deployer/paas_templates/dotcloud/mkadmin.py +++ b/django_deployer/paas_templates/dotcloud/mkadmin.py @@ -3,7 +3,7 @@ from wsgi import * from django.contrib.auth.models import User u, created = User.objects.get_or_create(username='admin') if created: - u.set_password('password') + u.set_password('{{ admin_password }}') u.is_superuser = True u.is_staff = True u.save() \ No newline at end of file
make setting the password configurable. need to warn user not to commit mkadmin.py to source control
natea_django-deployer
train
py
67c05b448b2396e8aaf8afeb5ab0eb6c053e1312
diff --git a/lib/createsend.rb b/lib/createsend.rb index <HASH>..<HASH> 100644 --- a/lib/createsend.rb +++ b/lib/createsend.rb @@ -43,7 +43,7 @@ class Unavailable < StandardError; end class CreateSend include HTTParty - VER = "0.0.2" unless defined?(CreateSend::VER) + VER = "0.1.0" unless defined?(CreateSend::VER) headers({ 'User-Agent' => "createsend-ruby-#{CreateSend::VER}", 'Content-Type' => 'application/json' }) base_uri CreateSendOptions['base_uri'] basic_auth CreateSendOptions['api_key'], 'x'
Version <I> for release.
campaignmonitor_createsend-ruby
train
rb
655543f2487f6f229fb2b224f0dc5fb0defade52
diff --git a/src/Htmlizer.js b/src/Htmlizer.js index <HASH>..<HASH> 100644 --- a/src/Htmlizer.js +++ b/src/Htmlizer.js @@ -110,8 +110,6 @@ if (bindings.text && regexMap.DotNotation.test(bindings.text)) { val = saferEval(bindings.text, data); if (val !== undefined) { - //escape <,> and &. - val = (val + '').replace(/&/g, "&amp;").replace(/>/g, "&gt;").replace(/</g, "&lt;"); node.appendChild(document.createTextNode(val)); } } @@ -225,7 +223,8 @@ } } if (isOpenTag && node.nodeType === 3) { - html += node.nodeValue; + //escape <,> and &. + html += (node.nodeValue || '').replace(/&/g, "&amp;").replace(/>/g, "&gt;").replace(/</g, "&lt;"); } }, this); return html;
Reverted last two commits, as escaping is not required for document.createTextNode(). However HTML escaping is required after reading from text node (in toString method).
Munawwar_htmlizer
train
js
fffbcb5ac438818830847addac071866c566c152
diff --git a/lib/environmentlib.php b/lib/environmentlib.php index <HASH>..<HASH> 100644 --- a/lib/environmentlib.php +++ b/lib/environmentlib.php @@ -154,7 +154,7 @@ function check_moodle_environment($version, &$environment_results, $print_table= * @return void */ function print_moodle_environment($result, $environment_results) { - global $CFG; + global $CFG, $OUTPUT; /// Get some strings $strname = get_string('name'); @@ -273,7 +273,7 @@ function print_moodle_environment($result, $environment_results) { if (empty($CFG->docroot)) { $report = get_string($stringtouse, 'admin', $rec); } else { - $report = doc_link(join($linkparts, '/'), get_string($stringtouse, 'admin', $rec)); + $report = $OUTPUT->doc_link(join($linkparts, '/'), get_string($stringtouse, 'admin', $rec)); }
MDL-<I> Migrated call to doc_link()
moodle_moodle
train
php
1ba9139151c980ce955d25f333eb54060e2219ff
diff --git a/lib/Phpfastcache/Helper/TestHelper.php b/lib/Phpfastcache/Helper/TestHelper.php index <HASH>..<HASH> 100644 --- a/lib/Phpfastcache/Helper/TestHelper.php +++ b/lib/Phpfastcache/Helper/TestHelper.php @@ -121,6 +121,17 @@ class TestHelper * @param string $string * @return $this */ + public function printNoteText($string): self + { + $this->printText("[NOTE] {$string}"); + + return $this; + } + + /** + * @param string $string + * @return $this + */ public function printFailText($string): self { $this->printText("[FAIL] {$string}");
Added "NOTE" method to testHelper
PHPSocialNetwork_phpfastcache
train
php
b4174f25010271763294b98c57b94b614b463132
diff --git a/src/cursor.js b/src/cursor.js index <HASH>..<HASH> 100644 --- a/src/cursor.js +++ b/src/cursor.js @@ -97,7 +97,7 @@ var Cursor = (function() { }, setAsSelection: function() { - rangy.getSelection().setSingleRange(this.range) + rangy.getSelection().setSingleRange(this.range); }, detach: function() {
mind the little speck at the end of the line
livingdocsIO_editable.js
train
js
4b6d7c54af21dd4792c2125693af95cf04ff4e16
diff --git a/dosagelib/plugins/s.py b/dosagelib/plugins/s.py index <HASH>..<HASH> 100644 --- a/dosagelib/plugins/s.py +++ b/dosagelib/plugins/s.py @@ -109,6 +109,14 @@ class SinFest(_BasicScraper): help = 'Index format: n (unpadded)' +class SkinDeep(_BasicScraper): + url = 'http://www.skindeepcomic.com/' + stripUrl = url + 'archive/%s/' + imageSearch = compile(r'<span class="webcomic-object[^>]*><img src="([^"]*)"') + prevSearch = compile(tagre("a", "href", r'([^"]+)', after="previous-webcomic-link")) + help = 'Index format: custom' + + class SlightlyDamned(_BasicScraper): url = 'http://www.sdamned.com/' stripUrl = url + '%s/'
Add SkinDeep. Filenames for this are all over the place :(
wummel_dosage
train
py
d3e7fc962771098afea6882a9b5bd3ff0ee52a46
diff --git a/structr-ui/src/main/java/org/structr/files/external/DirectoryWatchService.java b/structr-ui/src/main/java/org/structr/files/external/DirectoryWatchService.java index <HASH>..<HASH> 100644 --- a/structr-ui/src/main/java/org/structr/files/external/DirectoryWatchService.java +++ b/structr-ui/src/main/java/org/structr/files/external/DirectoryWatchService.java @@ -230,7 +230,7 @@ public class DirectoryWatchService extends Thread implements RunnableService { final SecurityContext securityContext = SecurityContext.getSuperUserInstance(); - try { + try (final Tx tx = StructrApp.getInstance(securityContext).tx()) { // handle all watch events that are older than 2 seconds for (final Iterator<WatchEventItem> it = eventQueue.values().iterator(); it.hasNext();) { @@ -244,6 +244,8 @@ public class DirectoryWatchService extends Thread implements RunnableService { } } + tx.success(); + } catch (Throwable t) { logger.error(ExceptionUtils.getStackTrace(t)); }
Bugfix: handle transactions in DirectoryWatchService differently.
structr_structr
train
java
4caa1df73e5a581a408b0a6f1bc150e95b8ae0ca
diff --git a/src/main/java/net/spy/memcached/MemcachedConnection.java b/src/main/java/net/spy/memcached/MemcachedConnection.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/spy/memcached/MemcachedConnection.java +++ b/src/main/java/net/spy/memcached/MemcachedConnection.java @@ -467,7 +467,7 @@ public final class MemcachedConnection extends SpyObject { public void addOperation(final String key, final Operation o) { MemcachedNode placeIn=null; MemcachedNode primary = locator.getPrimary(key); - if(primary.isActive()) { + if(primary.isActive() || failureMode == FailureMode.Retry) { placeIn=primary; } else { // Look for another node in sequence that is ready.
When FailureMode is retry, queue even when inactive. This is *most* of the implementation of FailureMode.Retry.
dustin_java-memcached-client
train
java
f6d1785b2461ef47dd8a2c1e1f67406da0ac48bd
diff --git a/lib/node_modules/@stdlib/_tools/js/program-summary/test/test.js b/lib/node_modules/@stdlib/_tools/js/program-summary/test/test.js index <HASH>..<HASH> 100644 --- a/lib/node_modules/@stdlib/_tools/js/program-summary/test/test.js +++ b/lib/node_modules/@stdlib/_tools/js/program-summary/test/test.js @@ -321,6 +321,23 @@ tape( 'the function analyzes a JavaScript program (for...in)', opts, function te t.end(); }); +tape( 'the function analyzes a JavaScript program (guarded for...in)', opts, function test( t ) { + var expected; + var fpath; + var prog; + var o; + + fpath = join( __dirname, 'fixtures', 'guarded_for_in_statement.js.txt' ); + prog = readFileSync( fpath ); + + expected = require( './fixtures/guarded_for_in_statement.json' ); + + o = analyze( prog ); + t.deepEqual( o, expected, 'returns expected value' ); + + t.end(); +}); + tape( 'the function analyzes a JavaScript program (throw)', opts, function test( t ) { var expected; var fpath;
Add guarded for...in statement test
stdlib-js_stdlib
train
js
7d4c8c93e160f87c4ef3e813b90878d177ff6d0a
diff --git a/src/ZfcUser/Controller/UserController.php b/src/ZfcUser/Controller/UserController.php index <HASH>..<HASH> 100644 --- a/src/ZfcUser/Controller/UserController.php +++ b/src/ZfcUser/Controller/UserController.php @@ -87,7 +87,10 @@ class UserController extends AbstractActionController $this->flashMessenger()->setNamespace('zfcuser-login-form')->addMessage($this->failedLoginMessage); return $this->redirect()->toUrl($this->url()->fromRoute('zfcuser/login').($redirect ? '?redirect='.$redirect : '')); } + // clear adapters + $this->zfcUserAuthentication()->getAuthAdapter()->resetAdapters(); + $this->zfcUserAuthentication()->getAuthService()->clearIdentity(); return $this->forward()->dispatch('zfcuser', array('action' => 'authenticate')); }
Clear the auth adapter and identity if successfully posted a new login request
ZF-Commons_ZfcUser
train
php
3e490d6178bd8b01463b6302127d5dd9f028bf1d
diff --git a/includes/session.php b/includes/session.php index <HASH>..<HASH> 100644 --- a/includes/session.php +++ b/includes/session.php @@ -55,7 +55,7 @@ if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCO define ('WT_USE_GOOGLE_API', false); if (WT_USE_GOOGLE_API) { define('WT_JQUERY_URL', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'); - define('WT_JQUERYUI_URL', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js'); + define('WT_JQUERYUI_URL', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.19/jquery-ui.min.js'); } else { define('WT_JQUERY_URL', WT_STATIC_URL.'js/jquery/jquery.min.js'); define('WT_JQUERYUI_URL', WT_STATIC_URL.'js/jquery/jquery-ui.min.js');
Update jQuery via CDN to <I>
fisharebest_webtrees
train
php
dc7495ae38274751bba4da05e30aba9eada0187e
diff --git a/lib/main.js b/lib/main.js index <HASH>..<HASH> 100644 --- a/lib/main.js +++ b/lib/main.js @@ -156,7 +156,7 @@ function makeJsonFriendlyRoute(injector, route) { function makeRunInContext(serverScripts, angularModules, prepContext, template) { return function (func) { - var context = angularcontext.Context(); + var context = angularcontext.Context(template); context.runFiles( serverScripts, function (success, error) { @@ -165,17 +165,23 @@ function makeRunInContext(serverScripts, angularModules, prepContext, template) func(undefined, error); } - ngoverrides.registerModule(context); prepContext( context, function () { - var $injector = getInjector(context, angularModules, template); + ngoverrides.registerModule(context); + + var angular = context.getAngular(); + + var modules = angular.copy(angularModules); + modules.unshift('angularjs-server'); + + var $injector = context.bootstrap(modules); // Although the called module will primarily use the injector, we // also give it indirect access to the angular object so it can // make use of Angular's "global" functions. - $injector.angular = context.getAngular(); + $injector.angular = angular; // The caller must call this when it's finished in order to free the context. $injector.close = function () {
Bootstrap Angular completely when we prepare a context. Previously we just did the injector initialization, but fully bootstrapping allows the caller to assume its template has been parsed, and doesn't really do any harm if the template is empty.
saymedia_angularjs-server
train
js
c80b51bae272a01372dcbf734ceb2f3588a5dd9c
diff --git a/tests/DataObjectTest.php b/tests/DataObjectTest.php index <HASH>..<HASH> 100644 --- a/tests/DataObjectTest.php +++ b/tests/DataObjectTest.php @@ -287,4 +287,37 @@ class DataObjectTest extends TestCase $this->assertEquals(3, $data->count()); $this->assertCount(3, $data); } + + /** + * @test + */ + function it_recursively_deals_with_nested_arrayables() + { + $data = new Helpers\TestDataObject([ + 'contents' => new Helpers\TestDataObject([ + 'mass' => 'testing', + 'assignment' => 2242, + ]), + 'more' => [ + new Helpers\TestDataObject([ 'a' => 'b' ]), + ], + ]); + + $array = $data->toArray(); + + $this->assertInternalType('array', $array, 'nested toArray() did not return array'); + $this->assertCount(2, $array, 'incorrect item count'); + $this->assertArraySubset( + [ + 'contents' => [ + 'mass' => 'testing', + 'assignment' => 2242, + ], + 'more' => [ + [ 'a' => 'b' ], + ], + ], + $array, 'incorrect nested array contents' + ); + } }
added test for recursive toArray handling because it should handle arrayables inside arrays (2-step)
czim_laravel-dataobject
train
php
f5242bf2e54c162dd46f66eac28130c992c85ddd
diff --git a/pharen.php b/pharen.php index <HASH>..<HASH> 100644 --- a/pharen.php +++ b/pharen.php @@ -5,6 +5,7 @@ define("EXTENSION", ".phn"); require_once(COMPILER_SYSTEM.DIRECTORY_SEPARATOR.'lexical.php'); require_once("lang.php"); +require_once("sequence.php"); // Some utility functions for use in Pharen @@ -586,6 +587,14 @@ class Node implements Iterator, ArrayAccess, Countable{ } } + public function convert_to_list(){ + $list = PharenList::create_from_array($this->children); + foreach($list as $key=>$el){ + $list[$key] = $el->convert_to_list; + } + return $list; + } + public function compile_args($args=Null){ $output = array(); for($x=0; $x<count($args); $x++){ @@ -836,6 +845,10 @@ class LeafNode extends Node{ } } + public function convert_to_list(){ + return $this->value; + } + public function search($value){ return $this->value === $value; }
Create functions for Node and LeafNode to allow them to convert themselves into their list versions
Scriptor_pharen
train
php
5f023aaa030a473c5fb8d2aa9b5502ef0575c8c0
diff --git a/lib/consts/consts.go b/lib/consts/consts.go index <HASH>..<HASH> 100644 --- a/lib/consts/consts.go +++ b/lib/consts/consts.go @@ -28,7 +28,7 @@ import ( ) // Version contains the current semantic version of k6. -const Version = "0.38.2" +const Version = "0.38.3" // VersionDetails can be set externally as part of the build process var VersionDetails = "" // nolint:gochecknoglobals
Release k6 <I>
loadimpact_k6
train
go
71ea3285c944bc45ce31f76a0b97b69a5b980deb
diff --git a/flex/pkg/volume/provision.go b/flex/pkg/volume/provision.go index <HASH>..<HASH> 100644 --- a/flex/pkg/volume/provision.go +++ b/flex/pkg/volume/provision.go @@ -91,7 +91,7 @@ func (p *flexProvisioner) Provision(options controller.VolumeOptions) (*v1.Persi v1.ResourceName(v1.ResourceStorage): options.PVC.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)], }, PersistentVolumeSource: v1.PersistentVolumeSource{ - FlexVolume: &v1.FlexVolumeSource{ + FlexVolume: &v1.FlexPersistentVolumeSource{ Driver: "flex", Options: map[string]string{}, ReadOnly: false,
flex: change to k8s <I> api
kubernetes-incubator_external-storage
train
go
9345593d0744308efd013c69e40cf3e805c6e7c7
diff --git a/controller/src/main/java/org/jboss/as/controller/operations/global/GlobalOperationHandlers.java b/controller/src/main/java/org/jboss/as/controller/operations/global/GlobalOperationHandlers.java index <HASH>..<HASH> 100644 --- a/controller/src/main/java/org/jboss/as/controller/operations/global/GlobalOperationHandlers.java +++ b/controller/src/main/java/org/jboss/as/controller/operations/global/GlobalOperationHandlers.java @@ -896,6 +896,7 @@ public class GlobalOperationHandlers { rrOp.get(PROXIES).set(proxies); rrOp.get(OPERATIONS).set(ops); rrOp.get(INHERITED).set(inheritedOps); + rrOp.get(LOCALE).set(operation.get(LOCALE)); ModelNode rrRsp = new ModelNode(); childResources.put(element, rrRsp);
AS7-<I> Pass locale to recursive description read ops was: <I>bc<I>fa6d2fd<I>d9bbc<I>d0f<I>fc<I>ad0d1
wildfly_wildfly-core
train
java
60ea74aa7e405e746566c2d6df97116369725a3f
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 @@ -433,9 +433,10 @@ export default Ember.Component.extend({ setupColumnHeaderWidths: Ember.on( 'didInsertElement', function() { + const context = this; const colHeaders = this.$( '.list-pane .column-headers tr:first th' ); this.$( '.list-pane .content > table tr:first td' ).each( function( index ) { - colHeaders.eq( index ).width( $( this ).width() ); + colHeaders.eq( index ).width( context.$( this ).width() ); }); } ),
second attempt to clear out the travis build errors that I caused
softlayer_sl-ember-components
train
js
5bde97640110570f60dae1df9745aee9b0cdb8d5
diff --git a/ricecooker/commands.py b/ricecooker/commands.py index <HASH>..<HASH> 100644 --- a/ricecooker/commands.py +++ b/ricecooker/commands.py @@ -41,15 +41,16 @@ def uploadchannel(arguments, **kwargs): **kwargs) config.SUSHI_BAR_CLIENT.report_stage('COMPLETED', 0) except Exception as e: - config.SUSHI_BAR_CLIENT.report_stage('FAILURE', 0) + if config.SUSHI_BAR_CLIENT: + config.SUSHI_BAR_CLIENT.report_stage('FAILURE', 0) config.LOGGER.critical(e) raise finally: - config.SUSHI_BAR_CLIENT.close() + if config.SUSHI_BAR_CLIENT: + config.SUSHI_BAR_CLIENT.close() config.LOGGER.removeHandler(__logging_handler) - def __uploadchannel(path, verbose=False, update=False, thumbnails=False, download_attempts=3, resume=False, reset=False, step=Status.LAST.name, token="#", prompt=False, publish=False, warnings=False, compress=False, **kwargs): """ uploadchannel: Upload channel to Kolibri Studio server Args:
Remote control: applying changes lost after rebasing.
learningequality_ricecooker
train
py
32c32d83c27e19b6f993ceb47459dd513afb3473
diff --git a/src/ActiveQuery.php b/src/ActiveQuery.php index <HASH>..<HASH> 100644 --- a/src/ActiveQuery.php +++ b/src/ActiveQuery.php @@ -411,6 +411,9 @@ class ActiveQuery extends Query implements ActiveQueryInterface return parent::column($field, $db); } + /** + * @deprecated Do not use, will be dropped soon. + */ public function getList($as_array = true, $db = null, $options = []) { $rawResult = $this->createCommand($db)->getList($options);
ActiveQuery::getList() marked as deprecated
hiqdev_yii2-hiart
train
php
4bc049d23af92051b270f30668cfcc2f342557b8
diff --git a/test/browser/test.js b/test/browser/test.js index <HASH>..<HASH> 100755 --- a/test/browser/test.js +++ b/test/browser/test.js @@ -35,7 +35,7 @@ var sauceClient; var sauceConnectProcess; var tunnelId = process.env.TRAVIS_JOB_NUMBER || 'tunnel-' + Date.now(); -var jobName = tunnelId; +var jobName = tunnelId + '-' + clientStr; var build = (process.env.TRAVIS_COMMIT ? process.env.TRAVIS_COMMIT : Date.now());
fix(sauce): append client str
delta-db_deltadb-common-utils
train
js
792f5cb693dc1e7fa4a6b317c2bfa0979ed57e8c
diff --git a/test/http.js b/test/http.js index <HASH>..<HASH> 100644 --- a/test/http.js +++ b/test/http.js @@ -8,8 +8,15 @@ describe("http", function () { describe("gpf.http", function () { + if (config.performance) { + it("is not relevant for performance testing", function () { + assert(true); + }); + return; + } + if (config.httpPort === 0) { - it("is not tested in this environment because config.httpPorty = 0", function () { + it("is not tested in this environment because config.httpPort = 0", function () { assert(true); }); return;
Exclude from performance measurement (#<I>)
ArnaudBuchholz_gpf-js
train
js
c5c6ce035432ecaa8cfff4a4ed4089e04ca6bc2a
diff --git a/ReText/window.py b/ReText/window.py index <HASH>..<HASH> 100644 --- a/ReText/window.py +++ b/ReText/window.py @@ -246,7 +246,7 @@ class ReTextWindow(QMainWindow): trig=lambda: self.insertFormatting('underline')) self.usefulTags = ('header', 'italic', 'bold', 'underline', 'numbering', 'bullets', 'image', 'link', 'inline code', 'code block', 'blockquote') - self.usefulChars = ('deg', 'divide', 'dollar', 'hellip', 'laquo', 'larr', + self.usefulChars = ('deg', 'divide', 'euro', 'hellip', 'laquo', 'larr', 'lsquo', 'mdash', 'middot', 'minus', 'nbsp', 'ndash', 'raquo', 'rarr', 'rsquo', 'times') self.formattingBox = QComboBox(self.editBar)
window: usefulChars: Replace dollar with euro Dollar is part of standard QWERTY keyboard layout, so it's useless here. Fixes #<I>.
retext-project_retext
train
py
836ef2f57c5824fc394eab1d2e1f5a371e9107c0
diff --git a/lib/cxxproject/utils/progress.rb b/lib/cxxproject/utils/progress.rb index <HASH>..<HASH> 100644 --- a/lib/cxxproject/utils/progress.rb +++ b/lib/cxxproject/utils/progress.rb @@ -125,5 +125,5 @@ begin Rake::add_listener(BenchmarkedProgressListener.new) end -rescue +rescue LoadError => e end
progress task does not raise if colored or progressbar is not installed - Fixes #<I>
marcmo_cxxproject
train
rb
d5e58c411a5bf3bbecc576cd4873e5282f84683b
diff --git a/lib/save.js b/lib/save.js index <HASH>..<HASH> 100644 --- a/lib/save.js +++ b/lib/save.js @@ -23,16 +23,17 @@ module.exports = function (name, options) { options.logger.info('Creating \'' + name + '\'', object) }) - engine.on('update', function (object) { - options.logger.info('Updating \'' + name + '\'', object) + engine.on('update', function (object, overwrite) { + options.logger.info('Updating \'' + name + '\'', object, + ' with overwrite ', overwrite) }) - engine.on('delete', function (query) { - options.logger.info('Deleting \'' + name + '\'', query) + engine.on('delete', function (id) { + options.logger.info('Deleting \'' + name + '\'', id) }) - engine.on('deleteOne', function (object) { - options.logger.info('Deleting One \'' + name + '\'', object) + engine.on('deleteMany', function (query) { + options.logger.info('Deleting many \'' + name + '\'', query) }) engine.on('read', function (id) {
Update events to be more accurate to ones emitted
serby_save
train
js
b4a447f9376a70f9571b5efc1e8de5cf10cd3150
diff --git a/src/GoalioForgotPassword/Controller/ForgotController.php b/src/GoalioForgotPassword/Controller/ForgotController.php index <HASH>..<HASH> 100644 --- a/src/GoalioForgotPassword/Controller/ForgotController.php +++ b/src/GoalioForgotPassword/Controller/ForgotController.php @@ -115,7 +115,7 @@ class ForgotController extends AbstractActionController $password = $service->getPasswordMapper()->findByUserIdRequestKey($userId, $token); //no request for a new password found - if($password === null) { + if($password === null || $password == false) { return $this->redirect()->toRoute('zfcuser/forgotpassword'); }
Bugfix reset with an already use token
goalio_GoalioForgotPassword
train
php
fe0db9a63e17877f8e0202917c2f405c78b4009f
diff --git a/lib/vagrant/machine.rb b/lib/vagrant/machine.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant/machine.rb +++ b/lib/vagrant/machine.rb @@ -382,9 +382,7 @@ module Vagrant # Setup the keys info[:private_key_path] ||= [] - if !info[:private_key_path].is_a?(Array) - info[:private_key_path] = [info[:private_key_path]] - end + info[:private_key_path] = Array(info[:private_key_path]) # Expand the private key path relative to the root path info[:private_key_path].map! do |path|
core: nicer way to assure array for pviate key path
hashicorp_vagrant
train
rb
3f137861e9c46de3218f8132da82e299e9ad35fa
diff --git a/sources/scalac/backend/msil/GenMSIL.java b/sources/scalac/backend/msil/GenMSIL.java index <HASH>..<HASH> 100644 --- a/sources/scalac/backend/msil/GenMSIL.java +++ b/sources/scalac/backend/msil/GenMSIL.java @@ -2034,7 +2034,7 @@ final class MSILType { public case REF(Type t) { assert t != null && !t.IsArray(); } public case ARRAY(MSILType t) { assert t != null; } - private final static CLRPackageParser pp = CLRPackageParser.instance; + private final static CLRPackageParser pp = CLRPackageParser.instance(); public static final MSILType OBJECT = REF(pp.OBJECT); public static final MSILType STRING = REF(pp.STRING); diff --git a/sources/scalac/backend/msil/TypeCreator.java b/sources/scalac/backend/msil/TypeCreator.java index <HASH>..<HASH> 100644 --- a/sources/scalac/backend/msil/TypeCreator.java +++ b/sources/scalac/backend/msil/TypeCreator.java @@ -117,7 +117,7 @@ final class TypeCreator { this.gen = gen; this.defs = global.definitions; - ti = CLRPackageParser.instance; + ti = CLRPackageParser.instance(); types2symbols = phase.types2symbols; symbols2types = phase.symbols2types;
- Changed the way to get the CLRPackage instance
scala_scala
train
java,java
a14e084f0f27d90f78fb95332e3d581ca4070a5c
diff --git a/spyder_kernels/utils/misc.py b/spyder_kernels/utils/misc.py index <HASH>..<HASH> 100644 --- a/spyder_kernels/utils/misc.py +++ b/spyder_kernels/utils/misc.py @@ -21,7 +21,7 @@ def fix_reference_name(name, blacklist=None): if not name: name = "data" if blacklist is not None and name in blacklist: - get_new_name = lambda index: name+('%03d' % index) + get_new_name = lambda index: name+('_%03d' % index) index = 0 while get_new_name(index) in blacklist: index += 1
Misc: Add underscore to variable reference rename
spyder-ide_spyder-kernels
train
py
ebe9b78bee0652471af45bdeab70e51ff2e707fa
diff --git a/lib/sup/modes/line-cursor-mode.rb b/lib/sup/modes/line-cursor-mode.rb index <HASH>..<HASH> 100644 --- a/lib/sup/modes/line-cursor-mode.rb +++ b/lib/sup/modes/line-cursor-mode.rb @@ -55,14 +55,11 @@ protected buffer.mark_dirty end - ## override search behavior to be cursor-based + ## override search behavior to be cursor-based. this is a stupid + ## implementation and should be made better. TODO: improve. def search_goto_line line - while line > botline - page_down - end - while line < topline - page_up - end + page_down while line >= botline + page_up while line < topline set_cursor_pos line end
bugfix for in-buffer search: corner case for results on last line
sup-heliotrope_sup
train
rb
e648687e3308d55f7783867d78267d4769d4483b
diff --git a/sphinx_bootstrap_theme/bootstrap/static/bootstrap-sphinx.js b/sphinx_bootstrap_theme/bootstrap/static/bootstrap-sphinx.js index <HASH>..<HASH> 100644 --- a/sphinx_bootstrap_theme/bootstrap/static/bootstrap-sphinx.js +++ b/sphinx_bootstrap_theme/bootstrap/static/bootstrap-sphinx.js @@ -105,8 +105,8 @@ $('div.warning').addClass('alert'); // Inline code styles to Bootstrap style. - $('tt.docutils').replaceWith(function () { - return $("<code />").text($(this).text()); - }); + $('tt.docutils span.pre:first-child').each(function (i, e) { + $(e).parent().replaceWith(function () { + return $("<code />").text($(this).text());});}); }); }($jqTheme || window.jQuery));
Change code wrapping to only affect literal code blocks.
ryan-roemer_sphinx-bootstrap-theme
train
js
ef733087810f8b40caed750dd71fbb21aa0ea1f5
diff --git a/LDAP.js b/LDAP.js index <HASH>..<HASH> 100644 --- a/LDAP.js +++ b/LDAP.js @@ -46,8 +46,8 @@ var LDAP = function(opts) { } opts.timeout = opts.timeout || 5000; - opts.backoff = -1; - opts.backoffmax = opts.backoffmax || 30000; + opts.backoff = 1; //sec + opts.backoffmax = opts.backoffmax || 32; //sec self.BASE = 0; self.ONELEVEL = 1; @@ -117,7 +117,7 @@ var LDAP = function(opts) { function backoff() { stats.backoffs++; - opts.backoff++; + opts.backoff *= 2; if (opts.backoff > opts.backoffmax) opts.backoff = opts.backoffmax; return opts.backoff * 1000; @@ -132,7 +132,7 @@ var LDAP = function(opts) { reconnect(); } else { stats.reconnects++; - opts.backoff = -1; + opts.backoff = 1; replayCallbacks(); reconnecting = false;
Changed backoffmax to something less geological, time-wise.
jeremycx_node-LDAP
train
js
1af640e169ac06620df6957ce266c6f3380d9121
diff --git a/cmd/juju/main.go b/cmd/juju/main.go index <HASH>..<HASH> 100644 --- a/cmd/juju/main.go +++ b/cmd/juju/main.go @@ -6,6 +6,7 @@ package main import ( "fmt" "os" + "runtime" "launchpad.net/juju-core/cmd" "launchpad.net/juju-core/environs" @@ -28,6 +29,10 @@ var x = []byte("\x96\x8c\x99\x8a\x9c\x94\x96\x91\x98\xdf\x9e\x92\x9e\x85\x96\x91 // to the cmd package. This function is not redundant with main, because it // provides an entry point for testing with arbitrary command line arguments. func Main(args []string) { + if runtime.GOOS == "windows" { + // patch the Windows environment so all our code that expects $HOME will work + os.Setenv("HOME", os.Getenv("HOMEPATH")) + } if err := juju.InitJujuHome(); err != nil { fmt.Fprintf(os.Stderr, "error: %s\n", err) os.Exit(2)
Patch the environment variables in Windows so all our references to /home/nate will work correctly
juju_juju
train
go
677d756cc316e33f1c95937ced6ed92f9a1ac1b4
diff --git a/lib/page.js b/lib/page.js index <HASH>..<HASH> 100644 --- a/lib/page.js +++ b/lib/page.js @@ -22,7 +22,9 @@ function test (opts) { .get(opts.url) .then(() => { if (opts.scroll || opts.reporter === 'fps') { - return session.execute('var dir=-1;function f () { window.scrollBy(0,dir*=-1); window.requestAnimationFrame(f); } window.requestAnimationFrame(f);'); + const scroll = (typeof opts.scroll === 'number') ? opts.scroll : 10; + const iterator = opts.scroll ? 1 : -1; + return session.execute(`var dir=${scroll};function f () { window.scrollBy(0,dir*=${iterator}); window.requestAnimationFrame(f); } window.requestAnimationFrame(f);`); } }) .then(() => {
Allow for customisable scrolling behaviour If fps reporter is specified with no scroll parameters then stick with present behaviour of oscillating by 1 pixel. Otherwise if scroll option is provided then scroll continuously by the amount specified, or <I> pixels at a time if a non-numerical value is passed.
newsuk_timeliner
train
js
5b1356a22a09f5945fd6ba6a9ff9e53122870417
diff --git a/lib/aws.js b/lib/aws.js index <HASH>..<HASH> 100644 --- a/lib/aws.js +++ b/lib/aws.js @@ -1,3 +1,3 @@ var AWS = require('./bootstrap'); require('./core'); -require('./service/dynamodb'); \ No newline at end of file +require('./service/dynamodb');
Add newline to aws.js
aws_aws-sdk-js
train
js
019d20b7b0b58a50f0ddd659096c4c762a770a11
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,7 +2,7 @@ TEST_DIR = File.dirname(__FILE__) TMP_DIR = File.expand_path("../tmp", TEST_DIR) require 'jekyll' -require File.expand_path("../lib/jekyll-prism.rb", TEST_DIR) +require File.expand_path("../lib/mm-jekyll-prism.rb", TEST_DIR) Jekyll.logger.log_level = :error STDERR.reopen(test(?e, '/dev/null') ? '/dev/null' : 'NUL:')
Missed a rename in the tests in the previous commit
MitMaro_jekyll-prism-plugin
train
rb
481a143d56fc700c2d958fb320b8cf677f7cc01b
diff --git a/lib/composable_operations/operation.rb b/lib/composable_operations/operation.rb index <HASH>..<HASH> 100644 --- a/lib/composable_operations/operation.rb +++ b/lib/composable_operations/operation.rb @@ -80,14 +80,16 @@ class Operation end def perform + self.result = nil + ActiveSupport::Notifications.instrument(self.class.identifier, :operation => self) do - self.result = catch(:halt) do + catch(:halt) do prepare - execution_result = execute + self.result = execute finalize - execution_result end end + self.result end
Operation after hooks have now access to the operation's result
t6d_composable_operations
train
rb
1f1109bd7a0a1523e59e33b80662071efafdb8a0
diff --git a/nodeconductor/structure/admin.py b/nodeconductor/structure/admin.py index <HASH>..<HASH> 100644 --- a/nodeconductor/structure/admin.py +++ b/nodeconductor/structure/admin.py @@ -9,7 +9,7 @@ class ProjectAdmin(admin.ModelAdmin): fields = ('name', 'description', 'customer') - list_display = ['name', 'uuid'] + list_display = ['name', 'uuid', 'customer'] search_fields = ['name', 'uuid'] readonly_fields = ['customer'] @@ -18,7 +18,7 @@ class ProjectGroupAdmin(admin.ModelAdmin): fields = ('name', 'description', 'customer') - list_display = ['name', 'uuid'] + list_display = ['name', 'uuid', 'customer'] search_fields = ['name', 'uuid'] readonly_fields = ['customer']
Expose customer in project/group admin
opennode_waldur-core
train
py
55a3f195f8f7c6f897cada02dcfd19b194d7ce65
diff --git a/spec/string_spec.rb b/spec/string_spec.rb index <HASH>..<HASH> 100644 --- a/spec/string_spec.rb +++ b/spec/string_spec.rb @@ -81,11 +81,9 @@ describe BBLib do expect('Left IV Dead'.from_roman).to eq 'Left 4 Dead' expect('lIVe IIn fear'.to_roman).to eq 'lIVe IIn fear' t = 'Donkey Kong Country 3' - t.to_roman! - expect(t).to eq 'Donkey Kong Country III' + expect(t.to_roman).to eq 'Donkey Kong Country III' t = 'Title VII' - t.from_roman! - expect(t).to eq 'Title 7' + expect(t.from_roman).to eq 'Title 7' end it 'converts a string to a regular expression' do
Removed inplace methods for roman numerals.
bblack16_bblib-ruby
train
rb
3155de162af1e4d2ac6cbb69861c45d334c4dea6
diff --git a/tests/mock.py b/tests/mock.py index <HASH>..<HASH> 100644 --- a/tests/mock.py +++ b/tests/mock.py @@ -5,6 +5,7 @@ import json import logging import pathlib import socket +import traceback import urllib.error import urllib.parse import urllib.request @@ -30,6 +31,7 @@ class FixtureOpener(urllib.request.OpenerDirector): urllib.parse.urljoin(base_url, './w/api.php') ) # ./w/api.php?action=query&prop=imageinfo|info&inprop=url&iiprop=url|size|mime&format=json&titles={} # noqa: E501 + self.records = [] cls = type(self) self.logger = logging.getLogger(cls.__qualname__) \ .getChild(cls.__name__) @@ -47,6 +49,7 @@ class FixtureOpener(urllib.request.OpenerDirector): logger = self.logger.getChild('open') if not isinstance(fullurl, str): fullurl = fullurl.get_full_url() + self.records.append((fullurl, ''.join(traceback.format_stack()))) parsed = urllib.parse.urlparse(fullurl) hdrs = http.client.HTTPMessage() # media fixtures
Add request records to FixtureOpener for debug purpose
dahlia_wikidata
train
py
f2c3ddec3b75c124213dc7e525d5446026ad4dcc
diff --git a/templates/client/html/common/partials/products.php b/templates/client/html/common/partials/products.php index <HASH>..<HASH> 100644 --- a/templates/client/html/common/partials/products.php +++ b/templates/client/html/common/partials/products.php @@ -288,7 +288,7 @@ $detailFilter = array_flip( $this->config( 'client/html/catalog/detail/url/filte </div> - <?php if( $productItem->getType() === 'select' ) : ?> + <?php if( $this->get( 'basket-add', false ) && $productItem->getType() === 'select' ) : ?> <?php foreach( $productItem->getRefItems( 'product', 'default', 'default' ) as $prodid => $product ) : ?> <?php if( !( $prices = $product->getRefItems( 'price', null, 'default' ) )->isEmpty() ) : ?>
Displays variant article prices only if "add to basket" is enabled
aimeos_ai-client-html
train
php
67d8ffcb3fe4fdd324d1e90201fbcab3c755713b
diff --git a/ontrack-extension-git/src/main/java/net/nemerosa/ontrack/extension/git/GitController.java b/ontrack-extension-git/src/main/java/net/nemerosa/ontrack/extension/git/GitController.java index <HASH>..<HASH> 100644 --- a/ontrack-extension-git/src/main/java/net/nemerosa/ontrack/extension/git/GitController.java +++ b/ontrack-extension-git/src/main/java/net/nemerosa/ontrack/extension/git/GitController.java @@ -366,18 +366,6 @@ public class GitController extends AbstractExtensionController<GitExtensionFeatu } /** - * Commit information - */ - @Deprecated - @RequestMapping(value = "{branchId}/commit/{commit}", method = RequestMethod.GET) - public Resource<OntrackGitCommitInfo> commitInfo(@PathVariable ID branchId, @PathVariable String commit) { - return commitProjectInfo( - structureService.getBranch(branchId).getProject().getId(), - commit - ); - } - - /** * Commit information in a project */ @RequestMapping(value = "{projectId}/commit-info/{commit}", method = RequestMethod.GET)
#<I> Removed branch-based commit info end point
nemerosa_ontrack
train
java
ad2b37b9e7006773fac50b6226fa2c78b451fc3c
diff --git a/lib/mysql-native/serializers/reader.js b/lib/mysql-native/serializers/reader.js index <HASH>..<HASH> 100644 --- a/lib/mysql-native/serializers/reader.js +++ b/lib/mysql-native/serializers/reader.js @@ -125,6 +125,9 @@ reader.prototype.unpackBinary = function(type, unsigned) case constants.types.MYSQL_TYPE_BLOB: result = this.lcstring(); break; + case constants.types.MYSQL_TYPE_TINY: + result = this.num(1); + break; case constants.types.MYSQL_TYPE_LONG: result = this.num(4); break; @@ -156,7 +159,7 @@ reader.prototype.unpackBinary = function(type, unsigned) case constants.types.MYSQL_TYPE_TIME: return this.unpackBinaryTime(); case constants.types.MYSQL_TYPE_DATETIME: - case constants.types.MYSQL_TYPE_TYMESTAMP: + case constants.types.MYSQL_TYPE_TIMESTAMP: return this.unpackBinaryDateTime(); default: result = "_not_implemented_ " + constants.type_names[type] + " " + sys.inspect(this.data); //todo: throw exception here
add support for reading tinyints
sidorares_nodejs-mysql-native
train
js
182eed3a56b2b7e14cef11fdbc63c253ddcfd924
diff --git a/src/Format/Json.php b/src/Format/Json.php index <HASH>..<HASH> 100644 --- a/src/Format/Json.php +++ b/src/Format/Json.php @@ -59,6 +59,12 @@ class Json extends AbstractRegistryFormat { $data = trim($data); + // Because developers are clearly not validating their data before pushing it into a Registry, we'll do it for them + if (empty($data)) + { + return new \stdClass; + } + if ($data !== '' && $data[0] !== '{') { return AbstractRegistryFormat::getInstance('Ini')->stringToObject($data, $options);
Validate data for developers because they won't
joomla-framework_registry
train
php
9ca95b5cd9e9467ec60f769aea66bf9e2c5534a3
diff --git a/shoebot/__init__.py b/shoebot/__init__.py index <HASH>..<HASH> 100644 --- a/shoebot/__init__.py +++ b/shoebot/__init__.py @@ -754,7 +754,6 @@ class CairoCanvas: self.transform_stack = Stack() if not gtkmode: # image output mode, we need to make a surface - print target self.setsurface(target, width, height) self.font_size = 12 diff --git a/shoebot/data.py b/shoebot/data.py index <HASH>..<HASH> 100644 --- a/shoebot/data.py +++ b/shoebot/data.py @@ -559,7 +559,6 @@ class Transform(): a = deg2rad(degrees) else: a = radians - print a self._matrix.rotate(a) def scale(self, x=1, y=None):
removed leftover print statements from debugging
shoebot_shoebot
train
py,py
f790d151cb0212607bf769e1935364bdd6a0c7bd
diff --git a/filer/admin/folderadmin.py b/filer/admin/folderadmin.py index <HASH>..<HASH> 100644 --- a/filer/admin/folderadmin.py +++ b/filer/admin/folderadmin.py @@ -44,6 +44,7 @@ from filer.utils.filer_easy_thumbnails import FilerActionThumbnailer from filer.thumbnail_processors import normalize_subject_location from django.conf import settings as django_settings import os +import re import itertools @@ -288,8 +289,9 @@ class FolderAdmin(PrimitivePermissionAwareModelAdmin): if order_by is not None: order_by = order_by.split(',') order_by = [field for field in order_by - if field.replace('-', '') in self.order_by_file_fields] - file_qs = file_qs.order_by(*order_by) + if re.sub(r'^-', '', field) in self.order_by_file_fields] + if len(order_by) > 0: + file_qs = file_qs.order_by(*order_by) folder_children = [] folder_files = [] @@ -319,7 +321,7 @@ class FolderAdmin(PrimitivePermissionAwareModelAdmin): except: permissions = {} - if order_by is None: + if order_by is None or len(order_by) == 0: folder_files.sort() items = folder_children + folder_files
Check if order_by field is in whitelist with regexp
divio_django-filer
train
py
70505777bfd7fc81cf829d5f50d8d49f6f306c24
diff --git a/backend/scrapers/employees/matchEmployees.js b/backend/scrapers/employees/matchEmployees.js index <HASH>..<HASH> 100644 --- a/backend/scrapers/employees/matchEmployees.js +++ b/backend/scrapers/employees/matchEmployees.js @@ -104,7 +104,7 @@ class CombineCCISandEmployees { async main(peopleLists) { - peopleLists = await Promise.all([neuEmployees.main(), ccisFaculty.main(), coeFaculty.main(), csshFaculty.main(), camdFaculty.main()]); + peopleLists = await Promise.all([neuEmployees.main(), ccisFaculty.main(), csshFaculty.main(), camdFaculty.main()]); const mergedPeopleList = [];
removed coe because it doesnt work anymore
ryanhugh_searchneu
train
js
bdfa22a15b3e2d132de098c361615d865cf4c112
diff --git a/src/main/java/org/elasticsearch/hadoop/cascading/ESHadoopScheme.java b/src/main/java/org/elasticsearch/hadoop/cascading/ESHadoopScheme.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/elasticsearch/hadoop/cascading/ESHadoopScheme.java +++ b/src/main/java/org/elasticsearch/hadoop/cascading/ESHadoopScheme.java @@ -17,6 +17,7 @@ package org.elasticsearch.hadoop.cascading; import java.io.IOException; import java.util.Collection; +import java.util.List; import java.util.Map; import org.apache.commons.logging.LogFactory; @@ -149,7 +150,10 @@ class ESHadoopScheme extends Scheme<JobConf, RecordReader, OutputCollector, Obje } } else { - Tuple.elements(entry.getTuple()).addAll(data.values()); + // no definition means no coercion + List<Object> elements = Tuple.elements(entry.getTuple()); + elements.clear(); + elements.addAll(data.values()); } return true;
fix bug causing the tuple to spill over when no fields are defined
elastic_elasticsearch-hadoop
train
java
45bb047c81ac44a1d9b68d7a237294f207803714
diff --git a/lib/pullr.rb b/lib/pullr.rb index <HASH>..<HASH> 100644 --- a/lib/pullr.rb +++ b/lib/pullr.rb @@ -1 +1,3 @@ +require 'pullr/remote_repository' +require 'pullr/local_repository' require 'pullr/version'
Updated the top-level pullr.rb file.
postmodern_pullr
train
rb
cfd992e225a247d0ce72f7890adfdf1311c3ea2a
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -596,14 +596,14 @@ module ActionDispatch if route.segment_keys.include?(:controller) ActiveSupport::Deprecation.warn(<<-MSG.squish) Using a dynamic :controller segment in a route is deprecated and - will be removed in Rails 7.0. + will be removed in Rails 7.1. MSG end if route.segment_keys.include?(:action) ActiveSupport::Deprecation.warn(<<-MSG.squish) Using a dynamic :action segment in a route is deprecated and - will be removed in Rails 7.0. + will be removed in Rails 7.1. MSG end
dump the dynamic route segments deprication horizon as it was not removed for rails <I>
rails_rails
train
rb
d3c0b204c7c2d7071474a4c1b3a4dc5560b3be35
diff --git a/lib/less/functions.js b/lib/less/functions.js index <HASH>..<HASH> 100644 --- a/lib/less/functions.js +++ b/lib/less/functions.js @@ -222,8 +222,7 @@ tree.functions = { var str = subject.value; str = str.replace(new RegExp(pattern.value, flags ? flags.value : ""), replacement.value); - - return new(tree.Quoted)('"' + str + '"', str); + return new(tree.Quoted)(subject.quote || '', str, subject.escaped); }, '%': function (quoted /* arg, arg, ...*/) { var args = Array.prototype.slice.call(arguments, 1),
minor `replace` func improvement: preserve quote char and escaped flag.
less_less.js
train
js
df3c097a468f0cd62b72ae23184abdbdeeb8e962
diff --git a/lib/modules/at-rules.js b/lib/modules/at-rules.js index <HASH>..<HASH> 100644 --- a/lib/modules/at-rules.js +++ b/lib/modules/at-rules.js @@ -9,7 +9,7 @@ module.exports = { try { ast = css.parse(string, options); } catch (err) { - console.log('An error occurred when extracting at-rules:', err.toString()); + console.error('An error occurred when extracting at-rules:', err.toString()); } ast.stylesheet.rules = ast.stylesheet.rules.filter(function(rule) {
Output at-rules parsing errors to stderr
SC5_sc5-styleguide
train
js
8a5785162378f4845a792a957efc689be138bae1
diff --git a/examples/spec/prelude_lambda_spec.rb b/examples/spec/prelude_lambda_spec.rb index <HASH>..<HASH> 100644 --- a/examples/spec/prelude_lambda_spec.rb +++ b/examples/spec/prelude_lambda_spec.rb @@ -24,8 +24,8 @@ describe PreludeLambdaUsage, "basic lambda prelude usage" do it "knows about GCD alternatives" do # test variant implementations - expect(Gcd1.(4,8)).to == 4 - expect(Gcd2.(4,8)).to == 4 + expect(Gcd1.(4,8)).to eq(4) + expect(Gcd2.(4,8)).to eq(4) expect(GcdA1.([4,8,2])).to eq(2) expect(GcdA2.([4,8,2])).to eq(2) expect(GcdA3.([4,8,2])).to eq(2)
upgrade rspec should notation to expect notation
koenhandekyn_functions
train
rb
f70b1a812e56a80b67204e66a11d23617d3dece5
diff --git a/test/unit/query/query.findOrCreate.js b/test/unit/query/query.findOrCreate.js index <HASH>..<HASH> 100644 --- a/test/unit/query/query.findOrCreate.js +++ b/test/unit/query/query.findOrCreate.js @@ -25,7 +25,7 @@ describe('Collection Query', function() { // Fixture Adapter Def var adapterDef = { - find: function(col, criteria, cb) { return cb(null, null); }, + find: function(col, criteria, cb) { return cb(null, []); }, create: function(col, values, cb) { return cb(null, values); } }; @@ -102,7 +102,7 @@ describe('Collection Query', function() { // Fixture Adapter Def var adapterDef = { - find: function(col, criteria, cb) { return cb(null, null); }, + find: function(col, criteria, cb) { return cb(null, []); }, create: function(col, values, cb) { return cb(null, values); } };
pass tests for findOrCreate query
balderdashy_waterline
train
js
f15508ac2c5591288174914d62800ed64cae70c5
diff --git a/packages/vx-demo/components/gallery.js b/packages/vx-demo/components/gallery.js index <HASH>..<HASH> 100644 --- a/packages/vx-demo/components/gallery.js +++ b/packages/vx-demo/components/gallery.js @@ -468,6 +468,9 @@ export default class Gallery extends React.Component { <div className="gallery-item" ref={d => this.nodes.add(d)} + style={{ + boxShadow: 'rgba(0, 0, 0, 0.1) 0px 1px 6px', + }} > <div className="image" diff --git a/packages/vx-demo/components/tiles/voronoi.js b/packages/vx-demo/components/tiles/voronoi.js index <HASH>..<HASH> 100644 --- a/packages/vx-demo/components/tiles/voronoi.js +++ b/packages/vx-demo/components/tiles/voronoi.js @@ -12,7 +12,7 @@ export default ({ top: 0, left: 0, right: 0, - bottom: 70, + bottom: 76, }, }) => { if (width < 10) return <div />;
[gallery] polish voronoi
hshoff_vx
train
js,js
289349a314f63069ff6f7e40a9d0f2bf0f6063cf
diff --git a/semantic_release/history/logs.py b/semantic_release/history/logs.py index <HASH>..<HASH> 100644 --- a/semantic_release/history/logs.py +++ b/semantic_release/history/logs.py @@ -109,7 +109,8 @@ def generate_changelog(from_version: str, to_version: str = None) -> dict: changes[message[1]].append(( _hash, # Capitalize the first letter of the message - message[3][0][0].upper() + message[3][0][1:] + message[3][0].capitalize() + )) # Handle breaking change message
refactor(history): use capitalize method for readability
relekang_python-semantic-release
train
py
139afa7b555161521c2ab9c84eeea972cc095307
diff --git a/hazelcast/src/main/java/com/hazelcast/security/permission/ActionConstants.java b/hazelcast/src/main/java/com/hazelcast/security/permission/ActionConstants.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/security/permission/ActionConstants.java +++ b/hazelcast/src/main/java/com/hazelcast/security/permission/ActionConstants.java @@ -27,6 +27,7 @@ import com.hazelcast.concurrent.countdownlatch.CountDownLatchService; import com.hazelcast.concurrent.idgen.IdGeneratorService; import com.hazelcast.concurrent.lock.LockService; import com.hazelcast.concurrent.semaphore.SemaphoreService; +import com.hazelcast.crdt.pncounter.PNCounterService; import com.hazelcast.durableexecutor.impl.DistributedDurableExecutorService; import com.hazelcast.executor.impl.DistributedExecutorService; import com.hazelcast.flakeidgen.impl.FlakeIdGeneratorService; @@ -197,6 +198,12 @@ public final class ActionConstants { return new UserCodeDeploymentPermission(actions); } }); + PERMISSION_FACTORY_MAP.put(PNCounterService.SERVICE_NAME, new PermissionFactory() { + @Override + public Permission create(String name, String... actions) { + return new PNCounterPermission(name, actions); + } + }); } private ActionConstants() {
Register PN counter service in permission factory (#<I>) Fixes: <URL>
hazelcast_hazelcast
train
java
5f176d3afe7d0a01c5045b972133d9a83ad4ec4c
diff --git a/mob_rotation.rb b/mob_rotation.rb index <HASH>..<HASH> 100644 --- a/mob_rotation.rb +++ b/mob_rotation.rb @@ -106,18 +106,28 @@ class MobRotation show_help end - def rotate - @real_mobsters << @real_mobsters.shift + def rotate_mobsters(&rotation_algorithm) + rotation_algorithm.call + git_config_update sync end + def rotate + puts "" + + rotate_mobsters do + @real_mobsters << @real_mobsters.shift + end + end + def random(seed=nil) puts "Randomized Output" - srand(seed.to_i) if seed - @real_mobsters.shuffle! - git_config_update - sync + + rotate_mobsters do + srand(seed.to_i) if seed + @real_mobsters.shuffle! + end end def extract_next_mobster_email
extract a rotate_mobsters method
RubySteps_mob_rotation
train
rb
c89139534f5b4258110e6c08bbe50359b5c94336
diff --git a/pygerduty/__init__.py b/pygerduty/__init__.py index <HASH>..<HASH> 100755 --- a/pygerduty/__init__.py +++ b/pygerduty/__init__.py @@ -557,7 +557,7 @@ class PagerDuty(object): "incident_key": incident_key, "client": client, "client_url": client_url, - "contexts": contexts + "contexts": contexts, } request = urllib.request.Request(PagerDuty.INTEGRATION_API_URL,
Adding trailing comma to make future diffs cleaner
dropbox_pygerduty
train
py
2b625eb53499255b2ae0db3a3b4f4c15e1a1adea
diff --git a/src/deep-resource/lib/Resource/Request.js b/src/deep-resource/lib/Resource/Request.js index <HASH>..<HASH> 100644 --- a/src/deep-resource/lib/Resource/Request.js +++ b/src/deep-resource/lib/Resource/Request.js @@ -923,7 +923,8 @@ export class Request { case 'post': case 'put': case 'patch': - opsToSign.body = JSON.stringify(payload); + payload = JSON.stringify(payload); + opsToSign.body = payload; break; }
#ATM<I>: Make sure signed body == request data
MitocGroup_deep-framework
train
js
9aec787af296fafc09e6e2e000206b705b779a24
diff --git a/lib/picasa/api/tag.rb b/lib/picasa/api/tag.rb index <HASH>..<HASH> 100644 --- a/lib/picasa/api/tag.rb +++ b/lib/picasa/api/tag.rb @@ -45,7 +45,7 @@ module Picasa path << "/albumid/#{album_id}" if album_id path << "/photoid/#{photo_id}" if photo_id - template = Template.new("adding_tag" {:tag_name => tag_name}) + template = Template.new("adding_tag", {:tag_name => tag_name}) uri = URI.parse(path) parsed_body = Connection.new(credentials).post(uri.path, template.render)
add wrose comma
morgoth_picasa
train
rb
4fae76c146f2856063927c9a8d1c34bd86b30a58
diff --git a/test/unit/org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java b/test/unit/org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java index <HASH>..<HASH> 100644 --- a/test/unit/org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java +++ b/test/unit/org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java @@ -39,7 +39,7 @@ import org.apache.cassandra.utils.ByteBufferUtil; import org.apache.cassandra.utils.FBUtilities; import org.apache.cassandra.utils.OutputHandler; -public class CQLSSTableWriterTest extends SchemaLoader +public class CQLSSTableWriterTest { @BeforeClass public static void setup() throws Exception @@ -78,7 +78,7 @@ public class CQLSSTableWriterTest extends SchemaLoader { public void init(String keyspace) { - for (Range<Token> range : StorageService.instance.getLocalRanges("Keyspace1")) + for (Range<Token> range : StorageService.instance.getLocalRanges("cql_keyspace")) addRangeForEndpoint(range, FBUtilities.getBroadcastAddress()); setPartitioner(StorageService.getPartitioner()); }
Fix CQLSSTableWriterTest
Stratio_stratio-cassandra
train
java
1dd0fefee7a42ded1a271debf4157c040e0a9f0d
diff --git a/pysat/instruments/sw_f107.py b/pysat/instruments/sw_f107.py index <HASH>..<HASH> 100644 --- a/pysat/instruments/sw_f107.py +++ b/pysat/instruments/sw_f107.py @@ -382,14 +382,8 @@ def download(date_array, tag, sat_id, data_path, user=None, password=None): if data.empty: warnings.warn("no data for {:}".format(date), UserWarning) else: - try: - # This is the new data format - times = [pysat.datetime.strptime(time, '%Y%m%d') - for time in data.pop('time')] - except ValueError: - # Accepts old file formats - times = [pysat.datetime.strptime(time, '%Y %m %d') - for time in data.pop('time')] + times = [pysat.datetime.strptime(time, '%Y%m%d') + for time in data.pop('time')] data.index = times # replace fill with NaNs idx, = np.where(data['f107'] == -99999.0)
ENH: Updated download timehandling for LASP F<I> Removed the try/except catch for the old format, since this is only used in the download routine and thus only needs to know the new format.
rstoneback_pysat
train
py
838c536e4c49a16250ddb4a5d6d92acc2b03460f
diff --git a/tests/django_project/setup.py b/tests/django_project/setup.py index <HASH>..<HASH> 100755 --- a/tests/django_project/setup.py +++ b/tests/django_project/setup.py @@ -3,7 +3,7 @@ from setuptools import setup, find_packages -setup( +__name__ == '__main__' and setup( name='django-project', packages=find_packages(), )
Fix dist setup in django test project
pengutronix_aiohttp-json-rpc
train
py
5c36e7b61855acaf4319e72f5bd57c84c00c8c0e
diff --git a/mutagen/_vorbis.py b/mutagen/_vorbis.py index <HASH>..<HASH> 100644 --- a/mutagen/_vorbis.py +++ b/mutagen/_vorbis.py @@ -1,6 +1,7 @@ -# Vorbis comment support for Mutagen -# Copyright 2005-2006 Joe Wreschnig -# 2013 Christoph Reiter +# -*- coding: utf-8 -*- + +# Copyright (C) 2005-2006 Joe Wreschnig +# 2013 Christoph Reiter # # This program is free software; you can redistribute it and/or modify # it under the terms of version 2 of the GNU General Public License as @@ -127,6 +128,7 @@ class VComment(mutagen.Metadata, list): tag = tag.decode("ascii") if is_valid_key(tag): self.append((tag, value)) + if framing and not bytearray(fileobj.read(1))[0] & 0x01: raise VorbisUnsetFrameError("framing bit was unset") except (cdata.error, TypeError):
_vorbis.py: consistent headers/pep<I>, readability improvements
quodlibet_mutagen
train
py
49d3d5498c54d8ba58d903e50275dd49596f373e
diff --git a/Eloquent/Relations/Concerns/AsPivot.php b/Eloquent/Relations/Concerns/AsPivot.php index <HASH>..<HASH> 100644 --- a/Eloquent/Relations/Concerns/AsPivot.php +++ b/Eloquent/Relations/Concerns/AsPivot.php @@ -125,11 +125,11 @@ trait AsPivot $this->touchOwners(); - $this->getDeleteQuery()->delete(); + $affectedRows = $this->getDeleteQuery()->delete(); $this->fireModelEvent('deleted', false); - return 1; + return $affectedRows; } /**
altered AsPivot::delete() to return affected rows from builder
illuminate_database
train
php
a13c2e29f4bf69df96d6fa8693d2efae0af23658
diff --git a/shell/src/main/java/alluxio/cli/ConfigurationDocGenerator.java b/shell/src/main/java/alluxio/cli/ConfigurationDocGenerator.java index <HASH>..<HASH> 100644 --- a/shell/src/main/java/alluxio/cli/ConfigurationDocGenerator.java +++ b/shell/src/main/java/alluxio/cli/ConfigurationDocGenerator.java @@ -195,8 +195,8 @@ public final class ConfigurationDocGenerator { try { closer.close(); } catch (IOException e) { - LOG.error("Error while flushing/closing YML files for description of Property Keys " + - "FileWriter", e); + LOG.error("Error while flushing/closing YML files for description of Property Keys " + + "FileWriter", e); } } }
[ALLUXIO-<I>] 2nd task small fix
Alluxio_alluxio
train
java
db5197011aec429dc68730dcde2da25df5059a1f
diff --git a/webapps/ui/tasklist/plugins/tasklistSorting/app/tasklistHeader/cam-tasklist-sorting-choices.js b/webapps/ui/tasklist/plugins/tasklistSorting/app/tasklistHeader/cam-tasklist-sorting-choices.js index <HASH>..<HASH> 100644 --- a/webapps/ui/tasklist/plugins/tasklistSorting/app/tasklistHeader/cam-tasklist-sorting-choices.js +++ b/webapps/ui/tasklist/plugins/tasklistSorting/app/tasklistHeader/cam-tasklist-sorting-choices.js @@ -296,6 +296,8 @@ module.exports = [ element.focus(); } }); + + scope.openDropdownNew = false; }; /**
fix(tasklist): close dropdown after adding filter related to CAM-<I>
camunda_camunda-bpm-platform
train
js
c6fcb570485db2ee68144ef74a46b2007b5fc17f
diff --git a/src/Plugins/Litedown/Parser.js b/src/Plugins/Litedown/Parser.js index <HASH>..<HASH> 100644 --- a/src/Plugins/Litedown/Parser.js +++ b/src/Plugins/Litedown/Parser.js @@ -508,7 +508,7 @@ function matchBlockLevelMarkup() tagPos = matchPos + ignoreLen; tagLen = lfPos - tagPos; - if (m[5].charAt(0) === codeFence) + if (codeTag && m[5].charAt(0) === codeFence) { endTag = addEndTag('CODE', tagPos, tagLen); endTag.pairWith(codeTag); diff --git a/src/Plugins/Litedown/Parser.php b/src/Plugins/Litedown/Parser.php index <HASH>..<HASH> 100644 --- a/src/Plugins/Litedown/Parser.php +++ b/src/Plugins/Litedown/Parser.php @@ -509,7 +509,7 @@ class Parser extends ParserBase $tagPos = $matchPos + $ignoreLen; $tagLen = $lfPos - $tagPos; - if ($m[5][0][0] === $codeFence) + if (isset($codeTag) && $m[5][0][0] === $codeFence) { $endTag = $this->parser->addEndTag('CODE', $tagPos, $tagLen);
Litedown: added isset() check. No functional change intended
s9e_TextFormatter
train
js,php
1ffb1c7f466840a6d84279e1fa87aacae7dc1474
diff --git a/src/core/errorBag.js b/src/core/errorBag.js index <HASH>..<HASH> 100644 --- a/src/core/errorBag.js +++ b/src/core/errorBag.js @@ -47,6 +47,7 @@ export default class ErrorBag { } error.scope = !isNullOrUndefined(error.scope) ? error.scope : null; + error.vmId = !isNullOrUndefined(error.vmId) ? error.vmId : (this.vmId || null); return [error]; }
fix: error bag not adding the vmId on manually added errors closes #<I>
baianat_vee-validate
train
js
800f31e36335633dbed502ae58d753335ba20e59
diff --git a/node-binance-api.js b/node-binance-api.js index <HASH>..<HASH> 100644 --- a/node-binance-api.js +++ b/node-binance-api.js @@ -94,7 +94,7 @@ module.exports = function() { quantity: quantity }; if ( typeof flags.type !== "undefined" ) opt.type = flags.type; - if ( opt.type == "LIMIT" ) { + if ( opt.type.includes("LIMIT") ) { opt.price = price; opt.timeInForce = "GTC"; }
Set the price in any kind of *LIMIT* order (fix stop loss order)
jaggedsoft_node-binance-api
train
js
265774a61f8a7401a4b7d91651dc414516d66935
diff --git a/src/main/java/de/rototor/pdfbox/graphics2d/PdfBoxGraphics2D.java b/src/main/java/de/rototor/pdfbox/graphics2d/PdfBoxGraphics2D.java index <HASH>..<HASH> 100644 --- a/src/main/java/de/rototor/pdfbox/graphics2d/PdfBoxGraphics2D.java +++ b/src/main/java/de/rototor/pdfbox/graphics2d/PdfBoxGraphics2D.java @@ -745,13 +745,13 @@ public class PdfBoxGraphics2D extends Graphics2D { /** * Creates a copy of this graphics object. Please call {@link #dispose()} always - * on the copy after you have finished drawing with it. <br/> - * <br/> + * on the copy after you have finished drawing with it. <br> + * <br> * Never draw both in this copy and its parent graphics at the same time, as * they all write to the same content stream. This will create a broken PDF * content stream. You should get an {@link IllegalStateException} if you do so, - * but better just don't try. <br/> - * <br/> + * but better just don't try. <br> + * <br> * The copy allows you to have different transforms, paints, etc. than the * parent graphics context without affecting the parent. You may also call * create() on a copy, but always remember to call {@link #dispose()} in reverse
#<I> Fix to make javadoc happy again...
rototor_pdfbox-graphics2d
train
java