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
4b70b31e3da3b36f7b077a3fe1679569d6f7bcf3
diff --git a/inenv/venv.py b/inenv/venv.py index <HASH>..<HASH> 100644 --- a/inenv/venv.py +++ b/inenv/venv.py @@ -7,6 +7,7 @@ import copy import signal import sys +from atomicwrites import atomic_write from virtualenv import create_environment from virtualenv import path_locations @@ -47,7 +48,7 @@ class VirtualEnv(object): return self.content_path('.inenv.cache') def save_cache_file(self, data): - with open(self.cache_file, 'w+') as cache_file: + with atomic_write(self.cache_file, overwrite=True) as cache_file: json.dump(data, cache_file) def load_cache_file(self): @@ -140,4 +141,3 @@ class VirtualEnv(object): sys.exit(exit_code) self.deactivate() return process - diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -49,8 +49,9 @@ Simple multi virtualenv command runner install_requires=[ # add your dependencies here # remember to use 'package-name>=x.y.z,<x.y+1.0' notation (this way you get bugfixes) + 'atomicwrites>=1.1.5', 'click>=4.0', - 'virtualenv>=13.0.3' + 'virtualenv>=13.0.3', ], extras_require={ 'tests': tests_require,
Fix race on cache file by using POSIX atomic overwrite semantics.
pnegahdar_inenv
train
py,py
38e7135eee67f1a24e25ec524aa471b6e1bac0d4
diff --git a/tests/SlimTest.php b/tests/SlimTest.php index <HASH>..<HASH> 100644 --- a/tests/SlimTest.php +++ b/tests/SlimTest.php @@ -372,10 +372,10 @@ class SlimTest extends PHPUnit_Framework_TestCase { public function testSlimRedirectTemporary() { Slim::init(); Slim::get('/', function () { - Slim::redirect('/foo', 302); + Slim::redirect('/foo', 307); }); Slim::run(); - $this->assertEquals(Slim::response()->status(), 302); + $this->assertEquals(Slim::response()->status(), 307); } /**
Updating Slim redirect unit tests so they use the correct status codes
slimphp_Slim
train
php
f4ddd0eac5850434905f110e58aba16a7a4adaf0
diff --git a/lib/fog/aws/requests/compute/register_image.rb b/lib/fog/aws/requests/compute/register_image.rb index <HASH>..<HASH> 100644 --- a/lib/fog/aws/requests/compute/register_image.rb +++ b/lib/fog/aws/requests/compute/register_image.rb @@ -73,10 +73,10 @@ module Fog 'imageOwnerId' => self.data[:owner_id], 'isPublic' => false, 'productCodes' => [], - 'architecture' => 'i386', + 'architecture' => options['Architecture'] || 'i386', 'imageType' => 'machine', - 'kernelId' => Fog::AWS::Mock.kernel_id, - 'ramdiskId' => Fog::AWS::Mock.ramdisk_id, + 'kernelId' => options['KernelId'] || Fog::AWS::Mock.kernel_id, + 'ramdiskId' => options['RamdiskId'] || Fog::AWS::Mock.ramdisk_id, 'platform' => 'Linux', 'stateReason' => {}, 'imageOwnerAlias' => self.data[:owner_id],
[compute|aws] Respect extra register_image options when mocking.
fog_fog
train
rb
bde39777994422935f755687cf83e5ad86cd5e16
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/i18n.js b/bundles/org.eclipse.orion.client.core/web/orion/i18n.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.core/web/orion/i18n.js +++ b/bundles/org.eclipse.orion.client.core/web/orion/i18n.js @@ -13,6 +13,7 @@ define(function() { return { load: function(name, parentRequire, onLoad, config) { + config = config || {}; // as per requirejs i18n definition ignoring irrelevant matching groups // [0] is complete match @@ -30,6 +31,11 @@ define(function() { onLoad(parentRequire(name)); return; } + + if (config.isBuild) { + onLoad({}); + return; + } var prefix = match[1], locale = match[3] ? match[2] : "",
Bug <I> - Git status page broken in deployed build
eclipse_orion.client
train
js
f62fa053890105aa5c2024bb81812127c05ec90b
diff --git a/src/util/Util.js b/src/util/Util.js index <HASH>..<HASH> 100644 --- a/src/util/Util.js +++ b/src/util/Util.js @@ -76,7 +76,7 @@ class Util { static parseEmoji(text) { if (text.includes('%')) text = decodeURIComponent(text); if (!text.includes(':')) return { animated: false, name: text, id: null }; - const m = text.match(/<?(a)?:(\w{2,32}):(\d{17,19})>?/); + const m = text.match(/<?(a:)?(\w{2,32}):(\d{17,19})>?/); if (!m) return null; return { animated: Boolean(m[1]), name: m[2], id: m[3] }; }
fix(Message#addReaction): incorrect regex (#<I>)
discordjs_discord.js
train
js
1cf7975319b8cdf4a02d8a42a451bd8efe9a39b6
diff --git a/spec/google/api_client/result_spec.rb b/spec/google/api_client/result_spec.rb index <HASH>..<HASH> 100644 --- a/spec/google/api_client/result_spec.rb +++ b/spec/google/api_client/result_spec.rb @@ -103,7 +103,7 @@ describe Google::APIClient::Result do 'https://www.googleapis.com/plus/v1/people/foo/activities/public?' + 'maxResults=20&pageToken=NEXT%2BPAGE%2BTOKEN' @result.data.title.should == 'Plus Public Activity Feed for ' - @result.data.id.should == 123456790 + @result.data.id.should == "123456790" @result.data.items.should be_empty end end @@ -143,7 +143,7 @@ describe Google::APIClient::Result do @result.data.selfLink.should == 'https://www.googleapis.com/plus/v1/people/foo/activities/public?' @result.data.title.should == 'Plus Public Activity Feed for ' - @result.data.id.should == 123456790 + @result.data.id.should == "123456790" @result.data.items.should be_empty end end
G+ API changed schema :(
googleapis_google-api-ruby-client
train
rb
fdc91b78baee29acd4ded83c820fde6b6ee7de45
diff --git a/base/app/assets/javascripts/toolbar.js b/base/app/assets/javascripts/toolbar.js index <HASH>..<HASH> 100644 --- a/base/app/assets/javascripts/toolbar.js +++ b/base/app/assets/javascripts/toolbar.js @@ -1 +1,22 @@ -//= require menu +function initMenu() { + $('.toolbar_menu ul li ul').hide(); + $('.toolbar_menu li a').click( function() { + $(this).next().slideToggle('normal'); + } + ); + //Logo menu for current subject + //Full Caption Sliding (Hidden to Visible) + $('.logo_grid.logo_full').hover( function() { + $(".logo_menu", this).stop().animate({top:'101px'},{queue:false,duration:160}); + }, function() { + $(".logo_menu", this).stop().animate({top:'1119px'},{queue:false,duration:160}); + }); +} + +function expandSubMenu(id) { + $('#' + id + '_menu').next().show(); +} + +$(document).ready(function() { + initMenu(); +}); \ No newline at end of file
Rearrange of toolbar javascript
ging_social_stream
train
js
07059767dfc57dac3726aa520f17ee3a4f405df6
diff --git a/spyderlib/widgets/colors.py b/spyderlib/widgets/colors.py index <HASH>..<HASH> 100644 --- a/spyderlib/widgets/colors.py +++ b/spyderlib/widgets/colors.py @@ -19,10 +19,10 @@ class ColorButton(QPushButton): self._color = QColor() def choose_color(self): - rgba, valid = QColorDialog.getRgba(self._color.rgba(), - self.parentWidget()) - if valid: - color = QColor.fromRgba(rgba) + color = QColorDialog.getColor(self._color, self.parentWidget(), + 'Select Color', + QColorDialog.ShowAlphaChannel) + if color.isValid(): self.set_color(color) def get_color(self):
Fix color selection dialog, which was not shown on PySide, because it was invoked through deprecated QColorDialog.getRgba() function absent there
spyder-ide_spyder
train
py
01d89baa5392fd3a3eddd91e7e216e37f0f5b805
diff --git a/lib/hacker_term.rb b/lib/hacker_term.rb index <HASH>..<HASH> 100644 --- a/lib/hacker_term.rb +++ b/lib/hacker_term.rb @@ -125,9 +125,7 @@ module HackerTerm def sort_on!(mode) case mode when :score - @data = @data.sort do |a, b| - a['score'].to_f <=> b['score'].to_f - end + @data = @data.sort { |a, b| a['score'].to_f <=> b['score'].to_f } else throw "sorting mode #{mode} not supported" end
Added inline block for sorting.
ciaranarcher_hacker_term
train
rb
2b84d3b72626aefb3a9a7b44b7061cd587420af6
diff --git a/src/Network/Request.php b/src/Network/Request.php index <HASH>..<HASH> 100644 --- a/src/Network/Request.php +++ b/src/Network/Request.php @@ -1388,7 +1388,7 @@ class Request implements ArrayAccess * * @param string $name The dot separated path to insert $value at. * @param mixed $value The value to insert into the request data. - * @return self + * @return static */ public function withData($name, $value) { @@ -1406,7 +1406,7 @@ class Request implements ArrayAccess * * @param string $name The dot separated path to insert $value at. * @param mixed $value The value to insert into the the request parameters. - * @return self + * @return static */ public function withParam($name, $value) {
Use static instead of self as IDEs deal with it better.
cakephp_cakephp
train
php
d486a4efab3c0974f2ca9b101c77dbab102cf5d4
diff --git a/ruby/deploy.rb b/ruby/deploy.rb index <HASH>..<HASH> 100644 --- a/ruby/deploy.rb +++ b/ruby/deploy.rb @@ -9,6 +9,18 @@ _cset(:sake_path) { "./framework/sake" } # The migrate task takes care of doing the dev/build namespace :deploy do + task :pre_checks do + # Abort the deployment if we discover the current site is not using symlinks where it should. + if exists?(:shared_children) + begin + shared_children.each { |child| run "[ -h '#{current_path}/#{child}' ] || ! [ -e '#{current_path}/#{child}' ]" } + rescue Exception => e + logger.debug "Aborting: one of the shared_children exists and is not a symlink!" + raise e + end + end + end + task :migrate do # Run custom pre-migration script. if exists?(:pre_migrate_script) @@ -41,4 +53,6 @@ namespace :deploy do end end +before "deploy", "deploy:pre_checks" + after "deploy:finalize_update", "deploy:migrate", "deploy:cleanup"
Add a sanity check to deployments.
silverstripe-archive_deploynaut
train
rb
1c6f36a9a8cb0fdef380bf9d7399524ee0c7da2f
diff --git a/backup/restorelib.php b/backup/restorelib.php index <HASH>..<HASH> 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -4411,6 +4411,18 @@ define('RESTORE_GROUPS_GROUPINGS', 3); } else { $status = false; } + // MDL-14326 remove empty course modules instance's (credit goes to John T. Macklin from Remote Learner) + $course_modules_inst_zero = get_records_sql("SELECT id, course, instance + FROM {$CFG->prefix}course_modules + WHERE id = '$cm_module->new_id' AND + instance = '0'"); + + if($course_modules_inst_zero){ // Clean up the invalid instances + foreach($course_modules_inst_zero as $course_modules_inst){ + delete_records('course_modules', 'id',$course_modules_inst->id); + } + } + } /// Finally, calculate modinfo cache. rebuild_course_cache($restore->course_id);
MDL-<I> Remove all course_modules that remained empty (i.e. with instance==0) after the particular restore process. Merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
7343cac64738ffb3e56412d0070218e2051422a0
diff --git a/src/lib/Pagination/Pagerfanta/URLSearchAdapter.php b/src/lib/Pagination/Pagerfanta/URLSearchAdapter.php index <HASH>..<HASH> 100644 --- a/src/lib/Pagination/Pagerfanta/URLSearchAdapter.php +++ b/src/lib/Pagination/Pagerfanta/URLSearchAdapter.php @@ -56,6 +56,7 @@ class URLSearchAdapter implements AdapterInterface $query = clone $this->query; $query->offset = $offset; $query->limit = $length; + $query->performCount = false; return $this->urlService->findUrls($query)->items; }
Prevented multiple count operations when attempting to paginate URL tab (#<I>)
ezsystems_ezplatform-admin-ui
train
php
a9fe389db8fc1d09549f8ea878408bedf705acee
diff --git a/archive-commons/src/main/java/org/archive/url/URLParser.java b/archive-commons/src/main/java/org/archive/url/URLParser.java index <HASH>..<HASH> 100644 --- a/archive-commons/src/main/java/org/archive/url/URLParser.java +++ b/archive-commons/src/main/java/org/archive/url/URLParser.java @@ -83,7 +83,7 @@ public class URLParser { public static final String COMMERCIAL_AT = "@"; public static final char PERCENT_SIGN = '%'; public static final char COLON = ':'; - public static final String STRAY_SPACING = "[\n\r\t]+"; + public static final String STRAY_SPACING = "[\n\r\t\\p{Zl}\\p{Zp}\u0085]+"; /** * Pattern that looks for case of three or more slashes after the * scheme. If found, we replace them with two only as mozilla does.
add other unicode line terminators to STRAY_SPACING regex
iipc_webarchive-commons
train
java
bd9baaed6ca832fcb5e04a8d5c32c182314c9cd5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup, find_packages setup( name="django-extra-tools", - version='0.1.0b2', + version='0.2.0b1', author='Tomasz Jakub Rup', author_email='tomasz.rup@gmail.com', url='https://github.com/tomi77/django_extra_tools',
New version <I>b1
tomi77_django-extra-tools
train
py
a48cd7cb1d1c16583fc140004b6d875edd429b27
diff --git a/lib/command.js b/lib/command.js index <HASH>..<HASH> 100644 --- a/lib/command.js +++ b/lib/command.js @@ -1,8 +1,7 @@ (function() { - var BANNER, CoffeeScript, EventEmitter, SWITCHES, compileJoin, compileOptions, compileScript, compileScripts, compileStdio, contents, exec, forkNode, fs, helpers, lint, loadRequires, optionParser, optparse, opts, parseOptions, path, printLine, printTokens, printWarn, sources, spawn, usage, util, version, watch, writeJs, _ref; + var BANNER, CoffeeScript, EventEmitter, SWITCHES, compileJoin, compileOptions, compileScript, compileScripts, compileStdio, contents, exec, forkNode, fs, helpers, lint, loadRequires, optionParser, optparse, opts, parseOptions, path, printLine, printTokens, printWarn, sources, spawn, usage, version, watch, writeJs, _ref; fs = require('fs'); path = require('path'); - util = require('util'); helpers = require('./helpers'); optparse = require('./optparse'); CoffeeScript = require('./coffee-script'); @@ -197,7 +196,7 @@ if (err) { return printLine(err.message); } else if (opts.compile && opts.watch) { - return util.log("compiled " + source); + return console.log("compiled " + source); } }); };
Removed dependency on util to extend support to node <I>
jashkenas_coffeescript
train
js
864f40bf6f5d7ece1aa663f8419a50c7ee31b3af
diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -418,6 +418,23 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab } /** + * Fill the model with an array of attributes. Force mass assignment. + * + * @param array $attributes + * @return $this + */ + public function forceFill(array $attributes) + { + static::unguard(); + + $this->fill($attributes); + + static::reguard(); + + return $this; + } + + /** * Get the fillable attributes of a given array. * * @param array $attributes @@ -531,6 +548,23 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab } /** + * Save a new model and return the instance. Allow mass-assignment. + * + * @param array $attributes + * @return static + */ + public static function forceCreate(array $attributes) + { + static::unguard(); + + $model = static::create($attributes); + + static::reguard(); + + return $model; + } + + /** * Get the first record matching the attributes or create it. * * @param array $attributes
Added forceFill and forceCreate methods.
laravel_framework
train
php
5958143c99376682723846dcc297f90316b5003a
diff --git a/lib/jquery.jcarousel.js b/lib/jquery.jcarousel.js index <HASH>..<HASH> 100644 --- a/lib/jquery.jcarousel.js +++ b/lib/jquery.jcarousel.js @@ -1,4 +1,4 @@ -/** +/*! * jCarousel - Riding carousels with jQuery * http://sorgalla.com/jcarousel/ *
C-Style comment to be preserved with compressors like YUI Compressor etc.
jsor_jcarousel
train
js
494c6e0e0d388ec8a5b6749eaf1bd76fd7072e67
diff --git a/qiime_tools/test/test_util.py b/qiime_tools/test/test_util.py index <HASH>..<HASH> 100644 --- a/qiime_tools/test/test_util.py +++ b/qiime_tools/test/test_util.py @@ -1,7 +1,7 @@ import unittest from qiime_tools import util as qtu -class SplitPhylogenyTest(unittest.TestCase): +class split_phylogeny_Test(unittest.TestCase): def test_split_phylogeny(self): """ Testing split_phylogeny() function in util.py.
Updated test_util.py Changed test class name to conform with function name.
smdabdoub_phylotoast
train
py
9fdd291512e7e4cfcb7dde0a05d713f989238aab
diff --git a/indra/tests/test_pybel_api.py b/indra/tests/test_pybel_api.py index <HASH>..<HASH> 100644 --- a/indra/tests/test_pybel_api.py +++ b/indra/tests/test_pybel_api.py @@ -1,5 +1,6 @@ import os from urllib import request + from nose.plugins.attrib import attr from pybel import BELGraph from pybel.dsl import * @@ -209,7 +210,7 @@ def test_get_agent_mirna(): m = MicroRna(namespace='MIRBASE', name='hsa-let-7a-1') agent = pb.get_agent(m, {}) assert isinstance(agent, Agent) - assert agent.name == 'hsa-let-7a-1' + assert agent.name == 'MIRLET7A1' assert agent.db_refs.get('MIRBASE') == 'MI0000060' assert agent.db_refs.get('HGNC') == '31476'
Update mirna test with new expected behavior
sorgerlab_indra
train
py
c27ca1eadea6d5d295d130deed5948b35a98b964
diff --git a/vodka/app.py b/vodka/app.py index <HASH>..<HASH> 100644 --- a/vodka/app.py +++ b/vodka/app.py @@ -53,12 +53,10 @@ def load(name, cfg): if cfg.get("module"): mod = importlib.import_module("%s.application" % cfg.get("module")) - print "MOD", mod cfg["home"] = os.path.dirname(inspect.getfile(mod)) elif cfg.get("home"): if cfg.get("home") not in loaded_paths: - imphook = vodka.util.SearchPathImporter(name, cfg["home"], True) - sys.meta_path.append(imphook) + sys.path.append(os.path.split(cfg.get("home").rstrip("/"))[0]) mod = importlib.import_module("%s.application" % name) loaded_paths.append(cfg.get("home")) else:
when loading applications from a source directory, append to sys path instead of doing import hooks
20c_vodka
train
py
4ac00e1bad087e8be7e054a3c3ef264ac9735ad9
diff --git a/eZ/Publish/MVC/View/Manager.php b/eZ/Publish/MVC/View/Manager.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/MVC/View/Manager.php +++ b/eZ/Publish/MVC/View/Manager.php @@ -68,7 +68,7 @@ class Manager public function getAllViewProviders() { if ( empty( $this->sortedViewProviders ) ) - $this->sortedViewProviders = $this->sortedViewProviders; + $this->sortedViewProviders = $this->sortViewProviders(); return $this->sortedViewProviders; } @@ -82,7 +82,7 @@ class Manager protected function sortViewProviders() { $sortedViewProviders = array(); - krsort( $this->routers ); + krsort( $this->viewProviders ); foreach ( $this->viewProviders as $viewProviders ) {
Fixed wrong naming/calls in ViewManager
ezsystems_ezpublish-kernel
train
php
561c4f6efee21ba7fd01f4fa62874997d325181d
diff --git a/src/rinoh/frontend/__init__.py b/src/rinoh/frontend/__init__.py index <HASH>..<HASH> 100644 --- a/src/rinoh/frontend/__init__.py +++ b/src/rinoh/frontend/__init__.py @@ -26,8 +26,10 @@ class TreeNode(object): try: return cls._mapping[node_name.replace('-', '_')](node) except KeyError: - raise NotImplementedError("The '{}' node is not yet supported ({})" - .format(node_name, cls.__module__)) + filename, line, node_name = cls.node_location(node) + raise NotImplementedError("{}:{} the '{}' node is not yet supported " + "({})" .format(filename, line, node_name, + cls.__module__)) def __init__(self, doctree_node): self.node = doctree_node
Report location of unmapped node in the source file
brechtm_rinohtype
train
py
b3857bd69038f2cbb652858345d4dbd7618eb3eb
diff --git a/lib/Connection.js b/lib/Connection.js index <HASH>..<HASH> 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -201,6 +201,7 @@ class Session extends EventEmitter { } async dispose() { + console.assert(!!this._connection, 'Protocol error: Connection closed. Most likely the page has been closed.'); await this._connection.send('Target.closeTarget', {targetId: this._targetId}); }
fix(page): page.close() assert that connection is not closed (#<I>)
GoogleChrome_puppeteer
train
js
6f2cd9df7fdae1f0ae55604452c2afd38af9bccf
diff --git a/test/www/jxcore/CITestMode.js b/test/www/jxcore/CITestMode.js index <HASH>..<HASH> 100644 --- a/test/www/jxcore/CITestMode.js +++ b/test/www/jxcore/CITestMode.js @@ -76,16 +76,21 @@ function copyCINodeTestClass() { function emptyAlliOSTestFilesButOne() { try { const path = '../../../lib/ios/ThaliCore/ThaliCoreTests'; - let currentFilePath, i, filesArray = fs.readdirSync(path); + let currentFilePath, i, filesArray = fs.readdirSync(path), simpleTestCaseFound = false; for (i = 0; i < filesArray.length; i++) { if (filesArray[i].indexOf('SimpleTestCase') == -1) { currentFilePath = path + '/' + filesArray[i].toString(); if (!fs.lstatSync(currentFilePath).isDirectory()) { + simpleTestCaseFound = true; fs.writeFileSync(currentFilePath, ''); } } } + + if (!simpleTestCaseFound) { + throw new Error('SimpleTestCase test file was not found!'); + } } catch (e) { console.log(e); }
Throw error when SimpleTestCase doesn't exists
thaliproject_Thali_CordovaPlugin
train
js
7f5850982e78b46a0db4d23778698e1889e24d67
diff --git a/examples/hash-mode/app.js b/examples/hash-mode/app.js index <HASH>..<HASH> 100644 --- a/examples/hash-mode/app.js +++ b/examples/hash-mode/app.js @@ -32,7 +32,7 @@ new Vue({ router, template: ` <div id="app"> - <h1>Basic</h1> + <h1>Mode: 'hash'</h1> <ul> <li><router-link to="/">/</router-link></li> <li><router-link to="/foo">/foo</router-link></li> diff --git a/examples/lazy-loading/app.js b/examples/lazy-loading/app.js index <HASH>..<HASH> 100644 --- a/examples/lazy-loading/app.js +++ b/examples/lazy-loading/app.js @@ -69,7 +69,7 @@ new Vue({ router, template: ` <div id="app"> - <h1>Basic</h1> + <h1>Lazy Loading</h1> <ul> <li><router-link to="/">/</router-link></li> <li><router-link to="/foo">/foo</router-link></li>
test: fix examples h1 text (#<I>)
vuejs_vue-router
train
js,js
4b1896882fa8c368e75a110e6d39a59e1399ef50
diff --git a/src/Whoops/Util/TemplateHelper.php b/src/Whoops/Util/TemplateHelper.php index <HASH>..<HASH> 100644 --- a/src/Whoops/Util/TemplateHelper.php +++ b/src/Whoops/Util/TemplateHelper.php @@ -120,14 +120,14 @@ class TemplateHelper // re-use the same DumpOutput instance, so it won't re-render the global styles/scripts on each dump. // exclude verbose information (e.g. exception stack traces) if (class_exists('Symfony\Component\VarDumper\Caster\Caster')) { - $cloner = $this->getCloner()->cloneVar($value, Caster::EXCLUDE_VERBOSE); + $cloneVar = $this->getCloner()->cloneVar($value, Caster::EXCLUDE_VERBOSE); // Symfony VarDumper 2.6 Caster class dont exist. } else { - $cloner = $this->getCloner()->cloneVar($value); + $cloneVar = $this->getCloner()->cloneVar($value); } $dumper->dump( - $cloner, + $cloneVar, $this->htmlDumperOutput );
changed var cloner to cloneVar
filp_whoops
train
php
4d2983a466c01a9793963e1ae74585dff4993932
diff --git a/python/dllib/src/bigdl/dllib/optim/optimizer.py b/python/dllib/src/bigdl/dllib/optim/optimizer.py index <HASH>..<HASH> 100644 --- a/python/dllib/src/bigdl/dllib/optim/optimizer.py +++ b/python/dllib/src/bigdl/dllib/optim/optimizer.py @@ -522,8 +522,6 @@ class Optimizer(JavaValue): :param val_rdd: validation dataset :param trigger: validation interval :param val_method: the ValidationMethod to use,e.g. "Top1Accuracy", "Top5Accuracy", "Loss" - :param criterion: used criterion - :param embedded_cri: embedded criterion """ if val_method is None: val_method = [Top1Accuracy()]
add rnn example in local_integration test
intel-analytics_BigDL
train
py
7b57b0b8d39b4cf64936cf42ca1c37bfe2b432cf
diff --git a/state/allwatcher.go b/state/allwatcher.go index <HASH>..<HASH> 100644 --- a/state/allwatcher.go +++ b/state/allwatcher.go @@ -1087,7 +1087,6 @@ func newAllWatcherStateBacking(st *State) Backing { machinesC, unitsC, applicationsC, - remoteApplicationsC, relationsC, annotationsC, statusesC,
Remove remoteApplication collection from watcher
juju_juju
train
go
3a9f5c35005301874923a960e11e29210f00913d
diff --git a/lib/utils.js b/lib/utils.js index <HASH>..<HASH> 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -103,6 +103,10 @@ function normalizeQueryConfig (config, values, callback) { } module.exports = { - prepareValue: prepareValue, + prepareValue: function prepareValueWrapper (value) { + //this ensures that extra arguments do not get passed into prepareValue + //by accident, eg: from calling values.map(utils.prepareValue) + return prepareValue(value); + }, normalizeQueryConfig: normalizeQueryConfig };
wrap entry point to prepareValue to only accept 1 arg
brianc_node-postgres
train
js
b24546607fcceb63e024c0dabc32e8830861c038
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 @@ -10,6 +10,9 @@ import StringIO # import third party libs import jinja2 +# Import Salt libs +import salt.utils + # Set up logging log = logging.getLogger(__name__)
fix for network state handling on RH-based machines this is in response to issue #<I> (and thanks to the suggested fix from UtahDave!)
saltstack_salt
train
py
4d400c82bf2aad8438038422ecbdc6cc2a8bfd4f
diff --git a/library/Admin/UI/BackEnd.php b/library/Admin/UI/BackEnd.php index <HASH>..<HASH> 100644 --- a/library/Admin/UI/BackEnd.php +++ b/library/Admin/UI/BackEnd.php @@ -8,6 +8,30 @@ class BackEnd { add_action('admin_footer', array($this, 'hostingEnviroment')); add_action('admin_title', array($this, 'adminTitle')); + add_action('wp_title', array($this, 'frontEndTitle')); + } + + public function frontEndTitle($title) + { + if (!$this->isLocal() && !$this->isTest() && !$this->isBeta()) { + return $title; + } + + $prefix = null; + + if ($this->isLocal()) { + $prefix = __('Local', 'municipio'); + } + + if ($this->isTest()) { + $prefix = __('Test', 'municipio'); + } + + if ($this->isBeta()) { + $prefix = __('Beta', 'municipio'); + } + + return '(' . $prefix . ') ' . $title; } public function adminTitle($title)
Prefix frontend title with test/beta/local
helsingborg-stad_Municipio
train
php
d574405094ce0e1fc0b6f12fb58664bd5f1e83ed
diff --git a/hazelcast/src/test/java/com/hazelcast/map/mapstore/MapStoreEvictionTest.java b/hazelcast/src/test/java/com/hazelcast/map/mapstore/MapStoreEvictionTest.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/test/java/com/hazelcast/map/mapstore/MapStoreEvictionTest.java +++ b/hazelcast/src/test/java/com/hazelcast/map/mapstore/MapStoreEvictionTest.java @@ -52,7 +52,7 @@ public class MapStoreEvictionTest extends HazelcastTestSupport { IMap<Object, Object> map = getMap(mapName, cfg); - assertSizeEventually(MAP_STORE_ENTRY_COUNT, map); + assertEquals(MAP_STORE_ENTRY_COUNT, map.size()); assertEquals(MAP_STORE_ENTRY_COUNT, loadedValueCount.get()); }
reverted back previous `assertSizeEventually` commit since it seems to cause timeout failures and normally we should not need it because map load mode is EAGER.
hazelcast_hazelcast
train
java
cbc9749a15664460667752563e1d8a19c4833f2c
diff --git a/tests/ci.js b/tests/ci.js index <HASH>..<HASH> 100755 --- a/tests/ci.js +++ b/tests/ci.js @@ -4,7 +4,7 @@ var fs = require('fs-extra'); var path = require('path'); var filename = __filename.replace(__dirname + '/', ''); -var elmTest = path.join(__dirname, '..', 'bin', 'elm-test'); +var elmTest = "elm-test"; function run(testFile) { if (!testFile) {
Use the npm link-ed version in ci.js
rtfeldman_node-test-runner
train
js
320cc5713be0b83df7f0f5009726a4f13f7e3050
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -63,7 +63,13 @@ func NewClient(id string, addrs []string, config *ClientConfig) (*Client, error) // do an initial fetch of all cluster metadata by specifing an empty list of topics err := client.RefreshAllMetadata() - if err != nil { + switch err { + case nil: + break + case LeaderNotAvailable: + // indicates that maybe part of the cluster is down, but is not fatal to creating the client + Logger.Println(err) + default: client.Close() return nil, err }
Don't fail to create the client on LeaderNotAvailable It indicates that part of the cluster is probably down, but it shouldn't be fatal.
Shopify_sarama
train
go
62d11c147b5827d6b44352c4f9acd891526a7ee2
diff --git a/public/app/plugins/datasource/cloudwatch/query_parameter_ctrl.js b/public/app/plugins/datasource/cloudwatch/query_parameter_ctrl.js index <HASH>..<HASH> 100644 --- a/public/app/plugins/datasource/cloudwatch/query_parameter_ctrl.js +++ b/public/app/plugins/datasource/cloudwatch/query_parameter_ctrl.js @@ -104,7 +104,7 @@ function (angular, _) { query = $scope.datasource.getDimensionKeys($scope.target.namespace, $scope.target.region); } else if (segment.type === 'value') { var dimensionKey = $scope.dimSegments[$index-2].value; - query = $scope.datasource.getDimensionValues(target.region, target.namespace, target.metricName, dimensionKey, {}); + query = $scope.datasource.getDimensionValues(target.region, target.namespace, target.metricName, dimensionKey, target.dimensions); } return query.then($scope.transformToSegments(true)).then(function(results) {
(cloudwatch) fix dimension value find query (#<I>)
grafana_grafana
train
js
31244686fe4e6fc613de04b85497b2b0285610df
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -222,7 +222,11 @@ class Tab extends EventEmitter { tabGroup.viewContainer.removeChild(this.webview); TabGroupPrivate.removeTab.bind(tabGroup)(this, true); this.emit("close", this); - TabGroupPrivate.activateRecentTab.bind(tabGroup)(); + + let activeTab = this.tabGroup.getActiveTab(); + if (activeTab.id === this.id) { + TabGroupPrivate.activateRecentTab.bind(tabGroup)(); + } } }
Don't change active tab if closed tab wasn't active
brrd_electron-tabs
train
js
8767862da3c313ed7a968311760b1b455527a643
diff --git a/src/conbo/collections/RemoteList.js b/src/conbo/collections/RemoteList.js index <HASH>..<HASH> 100644 --- a/src/conbo/collections/RemoteList.js +++ b/src/conbo/collections/RemoteList.js @@ -14,7 +14,7 @@ conbo.RemoteList = conbo.List.extend */ constructor: function(source, options) { - options || (options = {}); + options = conbo.defaults({}, options, this.options); this.bindAll('_resultHandler'); diff --git a/src/conbo/data/RemoteHash.js b/src/conbo/data/RemoteHash.js index <HASH>..<HASH> 100644 --- a/src/conbo/data/RemoteHash.js +++ b/src/conbo/data/RemoteHash.js @@ -12,7 +12,7 @@ conbo.RemoteHash = conbo.Hash.extend */ constructor: function(source, options) { - options || (options = {}); + options = conbo.defaults({}, options, this.options); this.bindAll('_resultHandler');
Added support for default options in RemoteHash and RemoteList
mesmotronic_conbo
train
js,js
683f91f5e7126146fafbaf5dddf86b67e44249eb
diff --git a/integration/networking/ip_test.go b/integration/networking/ip_test.go index <HASH>..<HASH> 100644 --- a/integration/networking/ip_test.go +++ b/integration/networking/ip_test.go @@ -69,26 +69,4 @@ var _ = Describe("IP settings", func() { }) }) - Describe("the internet", func() { - It("is reachable from inside the container", func() { - stdout := gbytes.NewBuffer() - stderr := gbytes.NewBuffer() - - process, err := container.Run(api.ProcessSpec{ - Path: "/bin/ping", - Args: []string{"-c", "2", "8.8.8.8"}, - }, api.ProcessIO{ - Stdout: stdout, - Stderr: stderr, - }) - Ω(err).ShouldNot(HaveOccurred()) - - rc, err := process.Wait() - Ω(err).ShouldNot(HaveOccurred()) - Ω(rc).Should(Equal(0)) - - Ω(stdout.Contents()).Should(ContainSubstring("0% packet loss")) - }) - }) - })
Remove the container -> <I> ping test. [network-tests-#<I>]
cloudfoundry-attic_garden-linux
train
go
f78e7ef26e1ce68b48abfe7d807bcfb377f3fc86
diff --git a/spec/mongoid/criteria_spec.rb b/spec/mongoid/criteria_spec.rb index <HASH>..<HASH> 100644 --- a/spec/mongoid/criteria_spec.rb +++ b/spec/mongoid/criteria_spec.rb @@ -4898,6 +4898,31 @@ describe Mongoid::Criteria do end end + describe "#text_search" do + + let(:criteria) do + Word.all + end + + before do + Word.with(database: "admin").mongo_session.command(setParameter: 1, textSearchEnabled: true) + Word.create_indexes + Word.with(safe: true).create!(name: "phase", origin: "latin") + end + + after(:all) do + Word.remove_indexes + end + + let(:search) do + criteria.text_search("phase") + end + + it "returns all fields" do + expect(search.first.origin).to eq("latin") + end + end + describe "#to_criteria" do let(:criteria) do
Hook text search into criteria. [ #<I> ]
mongodb_mongoid
train
rb
08ad3dd4b7ca4bcdc51d13f32e5475b5843c1515
diff --git a/qubits/__version__.py b/qubits/__version__.py index <HASH>..<HASH> 100644 --- a/qubits/__version__.py +++ b/qubits/__version__.py @@ -1 +1 @@ -__version__ = '0.3.3' +__version__ = '0.3.4'
added volume and discovery rate reporting to results file
thespacedoctor_qubits
train
py
46bb19d4f4cae1d567204cd44ff14d1acb4a3865
diff --git a/src/test/java/org/jfree/svg/TestSVGGraphics2D.java b/src/test/java/org/jfree/svg/TestSVGGraphics2D.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/jfree/svg/TestSVGGraphics2D.java +++ b/src/test/java/org/jfree/svg/TestSVGGraphics2D.java @@ -379,16 +379,15 @@ public class TestSVGGraphics2D { * Clipping with a line makes no sense, but the API allows it so we should * not fail. In fact, running with a JDK Graphics2D (from a BufferedImage) * it seems that the bounding rectangle of the line is used for clipping... - * does that make sense? Switching off the test for now. + * does that make sense? Matching the behaviour for now. */ @Test - @Disabled public void checkClipWithLine2D() { Rectangle2D r = new Rectangle2D.Double(1.0, 1.0, 3.0, 3.0); this.g2.setClip(r); this.g2.clip(new Line2D.Double(1.0, 2.0, 3.0, 4.0)); - //assertEquals(new Rectangle2D.Double(1.0, 2.0, 2.0, 2.0), - // this.g2.getClip().getBounds2D()); + assertEquals(new Rectangle2D.Double(1.0, 2.0, 2.0, 2.0), + this.g2.getClip().getBounds2D()); //assertTrue(this.g2.getClip().getBounds2D().isEmpty()); }
Enable clip with line test - behaviour is strange but JFreeSVG is matching what is observed in the JDK
jfree_jfreesvg
train
java
f4cbf4eeccdcf204652c96b0502c8572cf8282cf
diff --git a/aioblescan/aioblescan.py b/aioblescan/aioblescan.py index <HASH>..<HASH> 100644 --- a/aioblescan/aioblescan.py +++ b/aioblescan/aioblescan.py @@ -999,7 +999,7 @@ class HCI_LE_Meta_Event(Packet): data=x.decode(data) code=self.payload[0] if code.val==b"\x02": - ev=RepeatedField("Adv Report", HCI_LEM_Adv_Report) + ev=RepeatedField("Reports", HCI_LEM_Adv_Report) data=ev.decode(data) self.payload.append(ev) else:
HCI_LE_Meta_Event: use Reports for RepeatedField name Field names are also used as search key. As the inner data field HCI_LEM_Adv_Report is already using "Adv Report", it would be better the encapsulating parent container use another name to avoid more chaos.
frawau_aioblescan
train
py
33b43103c92f185b0ab66c291579dcd242627949
diff --git a/lxd/network/acl/driver_common.go b/lxd/network/acl/driver_common.go index <HASH>..<HASH> 100644 --- a/lxd/network/acl/driver_common.go +++ b/lxd/network/acl/driver_common.go @@ -525,11 +525,17 @@ func (d *common) Update(config *api.NetworkACLPut) error { return errors.Wrapf(err, "Failed getting network ACL IDs for security ACL update") } + // Request that the ACL and any referenced ACLs in the ruleset are created in OVN. r, err := OVNEnsureACLs(d.state, d.logger, client, d.projectName, aclNameIDs, []string{d.info.Name}, true) if err != nil { return errors.Wrapf(err, "Failed ensuring ACL is configured in OVN") } revert.Add(r.Fail) + + err = OVNPortGroupDeleteIfUnused(d.state, d.logger, client, d.projectName, nil, "", d.info.Name) + if err != nil { + return errors.Wrapf(err, "Failed removing unused OVN port groups") + } } revert.Success()
lxd/network/acl/driver/common: Calls OVNPortGroupDeleteIfUnused during Update
lxc_lxd
train
go
eeda97ab7deec397f0f6ee8f19b17051edea190f
diff --git a/src/sqlline/SqlLine.java b/src/sqlline/SqlLine.java index <HASH>..<HASH> 100644 --- a/src/sqlline/SqlLine.java +++ b/src/sqlline/SqlLine.java @@ -3888,6 +3888,10 @@ public class SqlLine private void setCompletions (boolean skipmeta) throws SQLException, IOException { + final String extraNameCharacters = + meta.getExtraNameCharacters () == null ? "" + : meta.getExtraNameCharacters (); + // setup the completor for the database sqlLineSQLCompletor = new ArgumentCompletor ( new SQLLineSQLCompletor (skipmeta), @@ -3895,13 +3899,14 @@ public class SqlLine { // deleimiters for SQL statements are any // non-letter-or-number characters, except - // underscore and dollar. + // underscore and characters that are specified + // by the database to be valid name identifiers. public boolean isDelimiterChar (String buf, int pos) { char c = buf.charAt (pos); return !(Character.isLetterOrDigit (c)) && c != '_' - && c != '$'; + && extraNameCharacters.indexOf (c) == -1; } });
Use the database metadata to determine if a character is a valid name identifier, and if so, do not break tab-completion on those characters.
julianhyde_sqlline
train
java
93759946145ad12afa44847d96ba4600f6a0097f
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 @@ -314,7 +314,7 @@ class ServiceSettingsAdmin(ChangeReadonlyMixin, admin.ModelAdmin): # filter out certain fields from the creation form form = super(ServiceSettingsAdmin, self).get_form(request, obj, **kwargs) if 'shared' in form.base_fields: - form.base_fields['shared'].initial = True if self.model is models.SharedServiceSettings else False + form.base_fields['shared'].initial = True if self.model is SharedServiceSettings else False form.base_fields['shared'].widget.attrs['disabled'] = True return form
Fix SharedServiceSettings reference [WAL-<I>]
opennode_waldur-core
train
py
420a70a9e9157ba60e9c85e2884f06e90b651dfe
diff --git a/test/Select-test.js b/test/Select-test.js index <HASH>..<HASH> 100644 --- a/test/Select-test.js +++ b/test/Select-test.js @@ -1808,10 +1808,11 @@ describe('Select', () => { beforeEach(() => { - var instance = createControl({ + var wrapper = createControlWithWrapper({ clearable: true, options: defaultOptions, - value: 'three' + value: 'three', + wireUpOnChangeToValue: true }); expect(ReactDOM.findDOMNode(instance), 'queried for', DISPLAYED_SELECTION_SELECTOR, @@ -1826,14 +1827,14 @@ describe('Select', () => { pressEscape(); }); - it('calls onChange with empty', () => { + it('calls onChange with null', () => { - expect(onChange, 'was called with', ''); + expect(onChange, 'was called with', null); }); it('resets the display value', () => { - expect(ReactDOM.findDOMNode(instance), 'queried for', DISPLAYED_SELECTION_SELECTOR, + expect(ReactDOM.findDOMNode(instance), 'queried for', PLACEHOLDER_SELECTOR, 'to have items satisfying', 'to have text', 'Select...'); });
When selection is empty, onChange now called with null
HubSpot_react-select-plus
train
js
23dd79b91faaf91d7682ee43a97a745f1213ae23
diff --git a/tests/test_customers.py b/tests/test_customers.py index <HASH>..<HASH> 100644 --- a/tests/test_customers.py +++ b/tests/test_customers.py @@ -48,20 +48,23 @@ def test_customers_all(client, response): response.get('https://api.mollie.com/v2/customers', 'customer_multiple') customers = client.customers.all() + assert isinstance(customers, List) assert customers.count == 3 iterated = 0 + iterated_customer_ids = [] for customer in customers: + assert isinstance(customer, Customer) iterated += 1 assert customer.id is not None - assert customer.mode is not None - assert customer.resource is not None - assert customer.name is not None - assert customer.email is not None - assert customer.locale is not None - assert customer.created_at is not None - assert iterated == 3 + iterated_customer_ids.append(customer.id) + assert iterated == customer.count, 'Unexpected amount of customer retrieved' + assert len(set(iterated_customer_ids)) == customers.count, 'Unexpected amount of unique customer ids retrieved' +def test_customer_get(client, response): + """Retrieve a single customer.""" + pass + def test_customer_get_related_mandates(client, response): """Retrieve related mandates for a customer.""" response.get('https://api.mollie.com/v2/customers/%s' % CUSTOMER_ID, 'customer_updated')
Make test_customers_all() the same as all similar tests
mollie_mollie-api-python
train
py
f02f59d5797f83883f4a4961c1c6377e2e865a58
diff --git a/plugins/shared/cmd/launcher/command/device.go b/plugins/shared/cmd/launcher/command/device.go index <HASH>..<HASH> 100644 --- a/plugins/shared/cmd/launcher/command/device.go +++ b/plugins/shared/cmd/launcher/command/device.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/nomad/plugins/device" "github.com/kr/pretty" "github.com/mitchellh/cli" + "github.com/zclconf/go-cty/cty/msgpack" ) func DeviceCommandFactory(meta Meta) cli.CommandFactory { @@ -190,11 +191,16 @@ func (c *Device) setConfig(spec hcldec.Spec, apiVersion string, config []byte, n return err } - _, diag, diagErrs := hclutils.ParseHclInterface(configVal, spec, nil) + val, diag, diagErrs := hclutils.ParseHclInterface(configVal, spec, nil) if diag.HasErrors() { return multierror.Append(errors.New("failed to parse config: "), diagErrs...) } + cdata, err := msgpack.Marshal(val, val.Type()) + if err != nil { + return err + } + req := &base.Config{ PluginConfig: cdata, AgentConfig: nmdCfg,
fix plugin launcher SetConfig msgpack params (#<I>) * fix plugin launcher SetConfig msgpack params The plugin launcher tool was passing the wrong byte array into `SetConfig`, resulting in msgpack decoding errors. This was fixed in a<I> (#<I>) but accidentally reverted in 6aff<I>d (#<I>).
hashicorp_nomad
train
go
2f8349aee835f4fa3f0128c946f06be0f5fb58c7
diff --git a/spillway/forms/fields.py b/spillway/forms/fields.py index <HASH>..<HASH> 100644 --- a/spillway/forms/fields.py +++ b/spillway/forms/fields.py @@ -99,6 +99,8 @@ class OGRGeometryField(forms.GeometryField): # Handle a comma delimited extent. elif list(value).count(',') == 3: value = Envelope(value.split(',')).polygon.ExportToWkt() + elif isinstance(value, dict): + value = json.dumps(value) try: geom = gdal.OGRGeometry(value) except (gdal.OGRException, TypeError, ValueError): diff --git a/tests/test_fields.py b/tests/test_fields.py index <HASH>..<HASH> 100644 --- a/tests/test_fields.py +++ b/tests/test_fields.py @@ -15,6 +15,10 @@ class OGRGeometryFieldTestCase(SimpleTestCase): def setUp(self): self.field = OGRGeometryField() + def test_dict(self): + geom = self.field.to_python(_geom) + self.assertEqual(json.loads(geom.geojson), _geom) + def test_feature(self): feature = Feature(geometry=_geom) geojson = str(feature)
Handle dict in OGRGeometryField
bkg_django-spillway
train
py,py
95683ab3f85b6676a5e3e689b10eb84c6f389938
diff --git a/src/middleware/auth/AbstractAuthMethod.php b/src/middleware/auth/AbstractAuthMethod.php index <HASH>..<HASH> 100644 --- a/src/middleware/auth/AbstractAuthMethod.php +++ b/src/middleware/auth/AbstractAuthMethod.php @@ -29,7 +29,7 @@ abstract class AbstractAuthMethod return password_verify($password, $storedPassword); } ); - if ($passwordCrypt($password, $result->{$passwordField}) && $result->blocked != '1') { + if ($result && $passwordCrypt($password, $result->{$passwordField}) && $result->blocked != '1') { Session::set("logged_in", true); Session::set("username", $username); Session::set("user_id", $result["id"]);
Fixing authmiddle ware to respect new return policy for ORMs
ntentan_ntentan
train
php
a43d8072976d4cfe1c5962bef43ca1b336303034
diff --git a/Kwf/View/Helper/Image.php b/Kwf/View/Helper/Image.php index <HASH>..<HASH> 100644 --- a/Kwf/View/Helper/Image.php +++ b/Kwf/View/Helper/Image.php @@ -59,13 +59,13 @@ class Kwf_View_Helper_Image extends Kwf_Component_View_Helper_Abstract if ($class != '') { $attributes['class'] = $class; } $size = $this->_getImageSize($image); - if (!isset($attributes['widht'])) $attributes['widht'] = $size['width']; + if (!isset($attributes['width'])) $attributes['width'] = $size['width']; if (!isset($attributes['height'])) $attributes['height'] = $size['height']; $attr = ''; foreach ($attributes as $k=>$i) { $attr .= ' '.$k.'="'.$i.'"'; } - return "<img src=\"$url\" alt=\"$alt\"$attr />"; + return "<img src=\"$url\"$attr alt=\"$alt\" />"; } }
fix image helper typo and change back order of attributes many test rely on this order
koala-framework_koala-framework
train
php
b419afdf5644e489068742f5476dbf7a429dd24e
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/projectCommands.js b/bundles/org.eclipse.orion.client.ui/web/orion/projectCommands.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.ui/web/orion/projectCommands.js +++ b/bundles/org.eclipse.orion.client.ui/web/orion/projectCommands.js @@ -363,7 +363,7 @@ define(['i18n!orion/navigate/nls/messages', 'orion/webui/littlelib', 'orion/comm callback: function(data) { var item = forceSingleItem(data.items); - data.oldParams = item.params; + data.oldParams = item.Params; var func = arguments.callee; var params = handleParamsInCommand(func, data, start? "Start application" : "Stop application");
Bug <I> - Launch conf properties are lost on retry
eclipse_orion.client
train
js
6724f68fe2b3b7927a4f77f71331c5848d8d3023
diff --git a/tests/bootstrap.php b/tests/bootstrap.php index <HASH>..<HASH> 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1 +1,5 @@ <?php declare(strict_types = 1); + +use Keboola\Component\BaseComponent; + +BaseComponent::setEnvironment();
Call setEnvironment in tests bootstrap
keboola_php-component
train
php
bb64ac9d4dad503cf3d3a5617d158d259397a322
diff --git a/pandas/io/data.py b/pandas/io/data.py index <HASH>..<HASH> 100644 --- a/pandas/io/data.py +++ b/pandas/io/data.py @@ -95,9 +95,11 @@ def get_quote_yahoo(symbols): for line in lines: fields = line.strip().split(',') - #print fields for i,field in enumerate(fields): - if field[0] == '"': + # assumes change_pct is in the 5th index + if i == 5: + data[header[i]].append(float(field.strip('"%'))) + elif field[0] == '"': data[header[i]].append( field.strip('"')) else: try:
parse change_pct as a float instead of a string
pandas-dev_pandas
train
py
8f33f33c3ea11df792ce10bab0eaec088835f6af
diff --git a/structr-core/src/main/java/org/structr/schema/export/StructrPropertyDefinition.java b/structr-core/src/main/java/org/structr/schema/export/StructrPropertyDefinition.java index <HASH>..<HASH> 100644 --- a/structr-core/src/main/java/org/structr/schema/export/StructrPropertyDefinition.java +++ b/structr-core/src/main/java/org/structr/schema/export/StructrPropertyDefinition.java @@ -389,7 +389,7 @@ public abstract class StructrPropertyDefinition implements JsonProperty, Structr return doubleProperty; case Date: - final StructrStringProperty date = new StructrStringProperty(parent, name); + final StructrDateProperty date = new StructrDateProperty(parent, name); date.deserialize(property); date.setFormat(JsonSchema.FORMAT_DATE_TIME); return date;
Fixed bug that prevented the date pattern to be included in JSON schema export.
structr_structr
train
java
13015d2e7ebef9d7b9b8b5acb84a35b8dfde5502
diff --git a/ts/blueprints/ember-cli-typescript/index.js b/ts/blueprints/ember-cli-typescript/index.js index <HASH>..<HASH> 100644 --- a/ts/blueprints/ember-cli-typescript/index.js +++ b/ts/blueprints/ember-cli-typescript/index.js @@ -125,7 +125,7 @@ module.exports = { } let packages = [ - { name: 'ember-cli-typescript-blueprints', target: '^2.0.0-beta.1' }, + { name: 'ember-cli-typescript-blueprints', target: 'latest' }, { name: 'typescript', target: 'latest' }, { name: '@types/ember', target: 'latest' }, { name: '@types/rsvp', target: 'latest' },
chore: install the latest stable ember-cli-typescript-blueprints in our host
typed-ember_ember-cli-typescript
train
js
21d06ad9a616a2dbee87410fb84cb51ae40d5986
diff --git a/ElectronClient/app/ElectronAppWrapper.js b/ElectronClient/app/ElectronAppWrapper.js index <HASH>..<HASH> 100644 --- a/ElectronClient/app/ElectronAppWrapper.js +++ b/ElectronClient/app/ElectronAppWrapper.js @@ -82,7 +82,7 @@ class ElectronAppWrapper { })); // Uncomment this to view errors if the application does not start - if (this.env_ === 'dev') this.win_.webContents.openDevTools(); + // if (this.env_ === 'dev') this.win_.webContents.openDevTools(); this.win_.on('close', (event) => { // If it's on macOS, the app is completely closed only if the user chooses to close the app (willQuitApp_ will be true)
Tools: Optional open dev tools in Developer Mode (#<I>) * Require --open-dev-tools along with --env dev in command line options to make opening of Dev Tools optional when in Developer mode. * Restore original lines then comment out the call to openDevTools
laurent22_joplin
train
js
9a9dc20dd7acaaeab94beef631557f97ca7f7e7a
diff --git a/tests/test_cmd.py b/tests/test_cmd.py index <HASH>..<HASH> 100644 --- a/tests/test_cmd.py +++ b/tests/test_cmd.py @@ -8,10 +8,10 @@ import os import subprocess os.chdir(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')) +outfile = 'tests/output.txt' def setup_function(function): try: - outfile = 'tests/output.txt' os.remove(outfile) except: pass
Update test_cmd.py Moved definition of outfile to module level.
aburrell_apexpy
train
py
40f125c46f6b12e4f08e9803861e97acf8ebad6d
diff --git a/org.jrebirth.af/modular/src/main/java/org/jrebirth/af/modular/ModuleConfigFileParser.java b/org.jrebirth.af/modular/src/main/java/org/jrebirth/af/modular/ModuleConfigFileParser.java index <HASH>..<HASH> 100644 --- a/org.jrebirth.af/modular/src/main/java/org/jrebirth/af/modular/ModuleConfigFileParser.java +++ b/org.jrebirth.af/modular/src/main/java/org/jrebirth/af/modular/ModuleConfigFileParser.java @@ -191,7 +191,7 @@ public final class ModuleConfigFileParser { final List<Class<?>> warmUpList = new ArrayList<Class<?>>(); - if (module != null && module.getClass() != null) { + if (module != null && module.getWarmUp() != null) { // Iterate over Component to load during WarmUp for (final Component component : module.getWarmUp().getComponent()) {
Fix an issue when no warmup classes are defined
JRebirth_JRebirth
train
java
0b01fb42e0d99a2a6572a925913d36de2208034d
diff --git a/test/dynobject-test.js b/test/dynobject-test.js index <HASH>..<HASH> 100644 --- a/test/dynobject-test.js +++ b/test/dynobject-test.js @@ -48,21 +48,21 @@ describe('DynObject', function() { }); describe('with specific change handler', function() { - var changeHandler; + var specificChangeHandler; beforeEach(function () { - changeHandler = sinon.spy(); - dynObject.on('change:property', changeHandler); + specificChangeHandler = sinon.spy(); + dynObject.on('change:property', specificChangeHandler); }); describe('and property is set', function() { beforeEach(function() { dynObject.set('property', 'propertyValue'); }); it('should emit change event', function () { - expect(changeHandler.callCount).to.equal(1); + expect(specificChangeHandler.callCount).to.equal(1); }); it('should provide value of property', function () { - expect(changeHandler.calledWith('propertyValue')).to.be.true; + expect(specificChangeHandler.calledWith('propertyValue')).to.be.true; }); }); });
Completed first batch of tests for DynObject
VDSFoundry_dynel-core
train
js
5afe766e637827ede728ec7a9fefcfea691dfa35
diff --git a/scripts/build-native.js b/scripts/build-native.js index <HASH>..<HASH> 100644 --- a/scripts/build-native.js +++ b/scripts/build-native.js @@ -34,9 +34,8 @@ async function build() { shell: true, }); - yarn.on('error', reject); - yarn.on('close', resolve); - }); + yarn.on('close', code => (code === 0 ? resolve() : reject())); + }).catch(() => process.exit(1)); } }
Fail when unable to build a native package (#<I>)
parcel-bundler_parcel
train
js
80aa54100fb15de1ea858bab524792ce51495128
diff --git a/modules/social_features/social_comment/src/SocialCommentLazyRenderer.php b/modules/social_features/social_comment/src/SocialCommentLazyRenderer.php index <HASH>..<HASH> 100644 --- a/modules/social_features/social_comment/src/SocialCommentLazyRenderer.php +++ b/modules/social_features/social_comment/src/SocialCommentLazyRenderer.php @@ -2,6 +2,7 @@ namespace Drupal\social_comment; +use Drupal\ajax_comments\Utility; use Drupal\Core\Entity\EntityTypeManagerInterface; /** @@ -60,7 +61,14 @@ class SocialCommentLazyRenderer { return []; } - return $this->entityTypeManager->getViewBuilder('comment')->viewMultiple($comments); + $build_comments = $this->entityTypeManager->getViewBuilder('comment')->viewMultiple($comments); + // Since we are rendering it as lazy builder, make sure we attach classes + // required by ajax_comments. In order to render reply forms etc. + if (!empty($build_comments) && \Drupal::moduleHandler()->moduleExists('ajax_comments')) { + Utility::addCommentClasses($build_comments); + } + + return $build_comments; } }
Issue #<I> by ronaldtebrake: Now comments are lazy rendered, we need to make sure the renderer also adds classes required by ajax comments, since the render array only contains a lazy_builder reference we cant process these untill we actually have the rendered output
goalgorilla_open_social
train
php
84155d2a88d01b3a1ad1f940943c8e6e22f9c892
diff --git a/tests/test_generator.py b/tests/test_generator.py index <HASH>..<HASH> 100644 --- a/tests/test_generator.py +++ b/tests/test_generator.py @@ -52,7 +52,7 @@ def test__template_generator__global_context_passed_to_tasks(): side_effect=lambda **kwargs: kwargs) def test__template_generator__global_context_constructed(mock_create_global_context): MyTemplateGenerator() - mock_create_global_context.assert_called_once() + assert mock_create_global_context.call_count == 1 @mock.patch.object(Task, 'ensure_folder')
fixed python <I> compatibility and typo
moltob_pymultigen
train
py
bbe1661be21bd7e1b32a650aea3e4d72eccd2347
diff --git a/quickstart-archetype/quickstart-webdriver-testng/src/main/resources/archetype-resources/src/test/java/WebDriverWithHelperTest.java b/quickstart-archetype/quickstart-webdriver-testng/src/main/resources/archetype-resources/src/test/java/WebDriverWithHelperTest.java index <HASH>..<HASH> 100644 --- a/quickstart-archetype/quickstart-webdriver-testng/src/main/resources/archetype-resources/src/test/java/WebDriverWithHelperTest.java +++ b/quickstart-archetype/quickstart-webdriver-testng/src/main/resources/archetype-resources/src/test/java/WebDriverWithHelperTest.java @@ -51,7 +51,7 @@ public class WebDriverWithHelperTest implements SauceOnDemandSessionIdProvider, if (StringUtils.isNotEmpty(username) && StringUtils.isNotEmpty(key)) { authentication = new SauceOnDemandAuthentication(username, key); } else { - authentication = new SauceOnDemandAuthentication(); + authentication = new SauceOnDemandAuthentication("${sauceUserName}", "${sauceAccessKey}"); } DesiredCapabilities capabilities = new DesiredCapabilities();
Include username/password in construction of SauceOnDemandAuthentication
saucelabs_sauce-java
train
java
f3253aa5a71fb1d7b16d0bf37dcb25a66b387ae2
diff --git a/test/formatter.spec.js b/test/formatter.spec.js index <HASH>..<HASH> 100644 --- a/test/formatter.spec.js +++ b/test/formatter.spec.js @@ -121,6 +121,22 @@ describe('Formatter', function () { ); }); + it('should handle a "like" document', function () { + delete baseMicroformatData.properties.name; + delete baseMicroformatData.properties.content; + baseMicroformatData.properties.slug = []; + baseMicroformatData.properties['like-of'] = ['http://example.com/liked/page']; + + return formatter.format(baseMicroformatData).should.eventually.equal( + '---\n' + + 'layout: micropubpost\n' + + 'date: \'2015-06-30T14:34:01.000Z\'\n' + + 'mf-like-of:\n' + + ' - \'http://example.com/liked/page\'\n' + + '---\n' + ); + }); + }); describe('_formatSlug', function () {
tests(main): explicitly test "like-of" formatting
voxpelli_node-format-microformat
train
js
ae1da73551b1a3af5c1a67519634174a06bd8186
diff --git a/app/routines/openstax/utilities/search_relation.rb b/app/routines/openstax/utilities/search_relation.rb index <HASH>..<HASH> 100644 --- a/app/routines/openstax/utilities/search_relation.rb +++ b/app/routines/openstax/utilities/search_relation.rb @@ -53,8 +53,13 @@ module OpenStax # Scoping - ::KeywordSearch.search(query.to_s) do |with| - instance_exec(with, &search_proc) + begin + ::KeywordSearch.search(query.to_s) do |with| + instance_exec(with, &search_proc) + end + rescue KeywordSearch::ParseError + fatal_error(code: :invalid_query, + message: 'The search query string provided is invalid') end outputs[:items] = @items
Catch KeywordSearch::ParseError and convert to search routine error
openstax_openstax_utilities
train
rb
53b207c4dacea266c3a62196fda2a578c0f3b1db
diff --git a/tests/pytests/unit/modules/test_schedule.py b/tests/pytests/unit/modules/test_schedule.py index <HASH>..<HASH> 100644 --- a/tests/pytests/unit/modules/test_schedule.py +++ b/tests/pytests/unit/modules/test_schedule.py @@ -698,9 +698,23 @@ def test_modify(sock_dir, job1, schedule_config_file): with patch.object( schedule, "list_", MagicMock(return_value=_schedule_data) ): - assert schedule.modify( - "job1", function="test.version", offline="True" - ) == {"comment": comm, "changes": changes, "result": True} + ret = schedule.modify("job1", function="test.version", offline="True") + assert ret["comment"] == comm + assert ret["result"] + assert all( + [ + True + for k, v in ret["changes"]["job1"]["old"].items() + if v == changes["job1"]["old"][k] + ] + ) + assert all( + [ + True + for k, v in ret["changes"]["job1"]["new"].items() + if v == changes["job1"]["new"][k] + ] + ) _call = call( b"schedule:\n job1: {enabled: true, function: test.version, jid_include: true, maxrunning: 1,\n name: job1}\n"
Fixing failing test. Order of OrderedDict not guaranteed on older Python versions.
saltstack_salt
train
py
65dd9355741988f2edba13bd1e0d95a9bdbf219e
diff --git a/tests/test-timber-helper.php b/tests/test-timber-helper.php index <HASH>..<HASH> 100644 --- a/tests/test-timber-helper.php +++ b/tests/test-timber-helper.php @@ -20,8 +20,7 @@ remove_all_filters('wp_title'); $post_id = $this->factory->post->create(array('post_title' => 'My New Post')); $post = get_post($post_id); - global $wp_query; - $wp_query = new WP_Query('p='.$post_id); + $this->go_to( site_url( '?p='.$post_id ) ); $this->assertEquals('My New Post', TimberHelper::get_wp_title()); } }
Changed wp_title test to match proper WP_UnitTestCase methods for setting current page
timber_timber
train
php
8bfdae4760d8911931cb8a9070006ec57fa8aa38
diff --git a/base-sync.js b/base-sync.js index <HASH>..<HASH> 100644 --- a/base-sync.js +++ b/base-sync.js @@ -418,10 +418,7 @@ BaseSync.prototype = { var ms = this.options.timeout var sync = this var timeout = setTimeout(function () { - if (sync.connected) { - sync.sendError(new SyncError(sync, 'timeout', ms)) - sync.connection.disconnect() - } + if (sync.connected) sync.connection.disconnect() sync.error('timeout', ms) }, ms) @@ -440,7 +437,7 @@ BaseSync.prototype = { var sync = this this.pingTimeout = setTimeout(function () { - sync.sendPing() + if (sync.connected) sync.sendPing() }, this.options.ping) }, diff --git a/test/ping.test.js b/test/ping.test.js index <HASH>..<HASH> 100644 --- a/test/ping.test.js +++ b/test/ping.test.js @@ -77,8 +77,7 @@ it('sends ping on idle connection', function () { expect(test.sent).toEqual([ ['test'], ['ping', 1], - ['ping', 1], - ['error', 'timeout', 100] + ['ping', 1] ]) }) })
Do not send timeout to timeouted client
logux_core
train
js,js
1ec38f207c164241d3fae627e87987c981c90a86
diff --git a/lib/virtualbox/com/interface/progress.rb b/lib/virtualbox/com/interface/progress.rb index <HASH>..<HASH> 100644 --- a/lib/virtualbox/com/interface/progress.rb +++ b/lib/virtualbox/com/interface/progress.rb @@ -29,7 +29,7 @@ module VirtualBox # This method blocks the execution while the operations represented # by this {Progress} object execute, but yields a block every `x` # percent (interval given in parameters). - def wait(interval_percent=1, sleep_time=0.5) + def wait(interval_percent=1) # If no block is given we just wait until completion, not worrying # about tracking percentages. if !block_given? @@ -37,18 +37,19 @@ module VirtualBox return end - last_reported = 0 + # Initial value forces the 0% yield + last_reported = -100 - while last_reported < 100 - last_reported = percent - yield last_reported + while true + break if completed || canceled - delta = 0 - while delta < interval_percent - sleep sleep_time - break if percent >= 100 - delta = percent - last_reported - end + delta = percent - last_reported + last_reported += delta + yield last_reported if delta >= interval_percent + + # This either sleeps for half a second or returns on + # completion + wait_for_completion(500) end end end
Progress#wait method now exits properly on complete, rather than <I>%
mitchellh_virtualbox
train
rb
12882f02e16fd3915ab252c12357f987a4856a64
diff --git a/cloudaux/__about__.py b/cloudaux/__about__.py index <HASH>..<HASH> 100644 --- a/cloudaux/__about__.py +++ b/cloudaux/__about__.py @@ -13,7 +13,7 @@ __title__ = 'cloudaux' __summary__ = 'Cloud Auxiliary is a python wrapper and orchestration module for interacting with cloud providers' __uri__ = 'https://github.com/Netflix-Skunkworks/cloudaux' -__version__ = '1.8.3' +__version__ = '1.8.4' __author__ = 'The Cloudaux Developers' __email__ = 'oss@netflix.com'
Upped the version number to <I>
Netflix-Skunkworks_cloudaux
train
py
97f98956fdfa97d6fd13c318ed82363ac1a02b02
diff --git a/src/nazarpc/BananaHTML.php b/src/nazarpc/BananaHTML.php index <HASH>..<HASH> 100644 --- a/src/nazarpc/BananaHTML.php +++ b/src/nazarpc/BananaHTML.php @@ -749,12 +749,13 @@ class BananaHTML { */ protected static function __callStatic_fast_render ($selector, $data) { if ( + is_array($data) && + isset($data[0]) && + count($data) == 1 && strpos($selector, ' ') === false && strpos($selector, '[') === false && strpos($selector, '.') === false && strpos($selector, '#') === false && - !isset($data[1]) && - count($data) == 1 && ( ($data_0_scalar = is_scalar($data[0])) || (
Small fix, check re-ordering
nazar-pc_BananaHTML
train
php
e85b60877eb35ee31913150af93d2757b415b942
diff --git a/windpowerlib/wind_turbine.py b/windpowerlib/wind_turbine.py index <HASH>..<HASH> 100644 --- a/windpowerlib/wind_turbine.py +++ b/windpowerlib/wind_turbine.py @@ -191,9 +191,8 @@ def read_turbine_data(**kwargs): if 'filename' not in kwargs: kwargs['filename'] = 'cp_values.csv' - file = os.path.join(kwargs['datapath'], kwargs['filename']) - - df = pd.read_csv(file, index_col=0) + df = pd.read_csv(os.path.join(kwargs['datapath'], kwargs['filename']), + index_col=0) return df
Join lines in read_turbine_data
wind-python_windpowerlib
train
py
597d50f378aa966034feb6e28c064e390b92f879
diff --git a/src/EntitySpecificationRepositoryTrait.php b/src/EntitySpecificationRepositoryTrait.php index <HASH>..<HASH> 100644 --- a/src/EntitySpecificationRepositoryTrait.php +++ b/src/EntitySpecificationRepositoryTrait.php @@ -13,6 +13,13 @@ trait EntitySpecificationRepositoryTrait private $alias = 'e'; /** + * @param $alias + * + * @return \Doctrine\ORM\QueryBuilder + */ + abstract public function createQueryBuilder($alias); + + /** * Get result when you match with a Specification * * @param Specification $specification @@ -23,7 +30,6 @@ trait EntitySpecificationRepositoryTrait public function match(Specification $specification, Result\ResultModifier $modifier = null) { $alias = $this->alias; - /** @var \Doctrine\ORM\QueryBuilder $qb */ $qb = $this->createQueryBuilder($alias); $specification->modify($qb, $alias);
Added createQueryBuilder as abstract method in the trait
Happyr_Doctrine-Specification
train
php
1e767556cb6934243199ad0d2b923fa00f9ceb55
diff --git a/cordova-lib/src/plugman/prepare-browserify.js b/cordova-lib/src/plugman/prepare-browserify.js index <HASH>..<HASH> 100644 --- a/cordova-lib/src/plugman/prepare-browserify.js +++ b/cordova-lib/src/plugman/prepare-browserify.js @@ -193,7 +193,10 @@ module.exports = function handlePrepare(project_dir, platform, plugins_dir, www_ var fsPath = path.join.apply(path, pathParts); var scriptPath = path.join(pluginDir, fsPath); - requireTr.addModule({symbol: moduleName, path: scriptPath}); + + if(requireTr.hasModule(moduleName) === false) { + requireTr.addModule({symbol: moduleName, path: scriptPath}); + } module.getchildren().forEach(function(child) { if (child.tag.toLowerCase() == 'clobbers') {
CB-<I> added hasModule check to browserify code
apache_cordova-lib
train
js
2da7021083d5535691fda3161da4521c744faa4f
diff --git a/src/vue-ckeditor.js b/src/vue-ckeditor.js index <HASH>..<HASH> 100644 --- a/src/vue-ckeditor.js +++ b/src/vue-ckeditor.js @@ -92,7 +92,7 @@ export default { computed: { emptyValueProvided () { - return this.$options.propsData.hasOwnProperty('emptyValue') + return Object.prototype.hasOwnProperty.call(this.$options.propsData, 'emptyValue') }, isEmpty () { const document = this.instance.model.document @@ -107,7 +107,7 @@ export default { const editors = this.$VueCkeditorEditors || this.editors if (!Object.keys(editors).length) { - throw new Error(`There are no CKEditor 5 implementations.`) + throw new Error('There are no CKEditor 5 implementations.') } const editor = editors[type]
src : Disallow use of Object.prototypes builtins directly (no-prototype-builtins)
igorxut_vue-ckeditor5
train
js
21fda116ac02291303373e86f7d06c2689780779
diff --git a/django_toolkit/fallbacks/circuit_breaker.py b/django_toolkit/fallbacks/circuit_breaker.py index <HASH>..<HASH> 100644 --- a/django_toolkit/fallbacks/circuit_breaker.py +++ b/django_toolkit/fallbacks/circuit_breaker.py @@ -34,6 +34,8 @@ class CircuitBreaker: return self.cache.get(self.failure_cache_key) or 0 def open_circuit(self): + self.cache.set(self.circuit_cache_key, True, self.circuit_timeout) + logger.critical( 'Open circuit for {failure_cache_key} {cicuit_cache_key}'.format( failure_cache_key=self.failure_cache_key, @@ -41,8 +43,6 @@ class CircuitBreaker: ) ) - self.cache.set(self.circuit_cache_key, True, self.circuit_timeout) - def __enter__(self): if self.is_circuit_open: raise self.max_failure_exception
Set circuit breaker cache key before logging
luizalabs_django-toolkit
train
py
cb1ccf98a972037c464afc42244eeb4ffa99720e
diff --git a/spec/LdapTools/Bundle/LdapToolsBundle/DataCollector/LdapToolsDataCollectorSpec.php b/spec/LdapTools/Bundle/LdapToolsBundle/DataCollector/LdapToolsDataCollectorSpec.php index <HASH>..<HASH> 100644 --- a/spec/LdapTools/Bundle/LdapToolsBundle/DataCollector/LdapToolsDataCollectorSpec.php +++ b/spec/LdapTools/Bundle/LdapToolsBundle/DataCollector/LdapToolsDataCollectorSpec.php @@ -160,7 +160,7 @@ class LdapToolsDataCollectorSpec extends ObjectBehavior 'DN' => null, 'Attributes' => print_r([ 'username' => 'foo', - 'unicodePwd' => LdapUtilities::MASK_PASSWORD, + 'unicodePwd' => '******', ], true), 'Server' => null, "Controls" => "array (\n)",
Fix the spec....again.
ldaptools_ldaptools-bundle
train
php
7484893d60e9d3f93ca00bd08ff8a0746a685da5
diff --git a/docs/examples/example.php b/docs/examples/example.php index <HASH>..<HASH> 100644 --- a/docs/examples/example.php +++ b/docs/examples/example.php @@ -30,12 +30,12 @@ if (!session_id()) { require_once 'IDS/Init.php'; try { - - /* + + /* * It's pretty easy to get the PHPIDS running - * 1. Define what to scan - */ - $request = array_merge($_GET, $_POST); + * 1. Define what to scan + */ + $request = array('_GET' => $_GET, '_POST' => $_POST, '_SESSION' => $_SESSION); $init = IDS_Init::init(dirname(__FILE__) . '/../../lib/IDS/Config/Config.ini'); /**
array_merge() is a problematic example, because if $_POST and $_GET both have a key 'foo', it is overwrited. This is a serious security problem, as someone could bypass the IDS
PHPIDS_PHPIDS
train
php
9f3ac7a9e879694194d73cd3a48bdae1654e8a31
diff --git a/src/Validator.php b/src/Validator.php index <HASH>..<HASH> 100644 --- a/src/Validator.php +++ b/src/Validator.php @@ -42,7 +42,7 @@ class Validator $pattern = '[0-9]+(\.[0-9]+)?'; if ($signed) { - $pattern = '\-' . $pattern; + $pattern = '\-?' . $pattern; } return preg_match('/^' . $pattern . '$/', $amount) ? true : false;
validate amounts for BcMath
furqansiddiqui_ethereum-rpc
train
php
2c2bdf43f2840ae1926732e5f77e0bc2c36c167f
diff --git a/lib/mobility/plugin.rb b/lib/mobility/plugin.rb index <HASH>..<HASH> 100644 --- a/lib/mobility/plugin.rb +++ b/lib/mobility/plugin.rb @@ -54,6 +54,7 @@ method calls on +Mobility::Attributes+ instance. end def depends_on(plugin) + require "mobility/plugins/#{plugin}" dependencies << plugin end
Require plugin when declaring a dependency on it
shioyama_mobility
train
rb
6eb7eccddc96fb7b0a3fe6e26be0481724105e29
diff --git a/lib/updateMemberInfo.js b/lib/updateMemberInfo.js index <HASH>..<HASH> 100644 --- a/lib/updateMemberInfo.js +++ b/lib/updateMemberInfo.js @@ -21,16 +21,16 @@ UpdateMemberInfo.prototype = { logger.win("Config updated.") return Promise.resolve(); } - , error = function(reason) { - logger.error("Failed to update Config file! == "+reason) - return Promise.resolve(reason); + , catchAndExit = function(reason) { + reason && logger.error("Failed to update Config file! == "+reason) + process.exit(1); }; return new Promise( (resolve,reject) => { fs.writeFile(path.join(__dirname, '/../config.json'), json, err => err ? reject(err) : resolve() ); }) .then(success) - .catch(error); + .catch(catchAndExit); }, setMemberReserveAddress: function(address) {
catch and exit if persistant storage fails
OpenSTFoundation_openst-platform
train
js
5e15b1edd654498c4a288c9581aa9382a5c2d9ab
diff --git a/rocketbelt/components/images/rocketbelt.images-lazyload.js b/rocketbelt/components/images/rocketbelt.images-lazyload.js index <HASH>..<HASH> 100644 --- a/rocketbelt/components/images/rocketbelt.images-lazyload.js +++ b/rocketbelt/components/images/rocketbelt.images-lazyload.js @@ -4,7 +4,7 @@ $(document).ready(function () { $('.lazyload-wrapper').each(function () { var wrapper = this, - small = wrapper.querySelector('.lazyload-small'); + small = wrapper.querySelector('.lazyload-small'); var img = new Image(); img.src = small.src; @@ -22,9 +22,11 @@ }) .on('enter', function () { var wrapper = this.triggerElement().parentElement; + var alt = this.triggerElement().getAttribute('alt'); var imgLarge = new Image(); imgLarge.src = wrapper.dataset.srcLg; + imgLarge.alt = alt; imgLarge.onload = function () { imgLarge.classList.add('loaded'); };
feat(Lazyload): Append alt to large image from small image.
Pier1_rocketbelt
train
js
f515add0475086c194ae69940832f3086b8e2372
diff --git a/src/ansiblecmdb/parser.py b/src/ansiblecmdb/parser.py index <HASH>..<HASH> 100644 --- a/src/ansiblecmdb/parser.py +++ b/src/ansiblecmdb/parser.py @@ -248,6 +248,11 @@ class HostsParser(object): """ for entry in section['entries']: for hostname in self.expand_hostdef(entry['name']): + if hostname not in hosts: + # Expanded host or child host or something else refers to a + # host that isn't actually defined. Ansible skips this, so + # we will too. + continue host = hosts[hostname] for var_key, var_val in entry['hostvars'].items(): host['hostvars'][var_key] = var_val
Ignore hosts that don't actually exists when applying section vars.
fboender_ansible-cmdb
train
py
6d51ab21fb854a5352e4f38d673897e0e79c5c44
diff --git a/config/rafwell-simplegrid.php b/config/rafwell-simplegrid.php index <HASH>..<HASH> 100644 --- a/config/rafwell-simplegrid.php +++ b/config/rafwell-simplegrid.php @@ -4,7 +4,7 @@ return [ 'export'=>[ 'pdf'=>[ 'enabled'=>false, - 'bootstrapCss'=>'', + 'bootstrapCss'=>'assets/bootstrap/css/bootstrap.min.css', 'snappy'=>[ 'orientation'=>'landscape' ] diff --git a/resources/views/export/pdf/body.blade.php b/resources/views/export/pdf/body.blade.php index <HASH>..<HASH> 100644 --- a/resources/views/export/pdf/body.blade.php +++ b/resources/views/export/pdf/body.blade.php @@ -1,6 +1,6 @@ <!DOCTYPE html> <head> - <link href="{{$bootstrapCss}}" rel="stylesheet" /> + <link href="{!!asset($bootstrapCss)!!}" rel="stylesheet" /> <link href="{!!asset('vendor/rafwell/simple-grid/css/simplegrid.css')!!}" rel="stylesheet" /> <meta charset="utf-8" /> </head>
Ajust initial config for pdf export
rafwell_laravel-simplegrid
train
php,php
16835fe7e64968ad28462115380af6d9a85574b3
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -5,6 +5,7 @@ module.exports = function(grunt) { src: [ 'lib/events.js', 'lib/tox.js', + 'lib/toxencryptsave.js', 'lib/toxoptions.js', 'lib/tox_old.js' ],
Include lib/toxencryptsave.js when building docs
saneki-discontinued_node-toxcore
train
js
6e3ac6d6ffd3354005b79cd200bfbacf4771c0a8
diff --git a/src/main/java/com/hp/autonomy/frontend/view/hod/HodViewService.java b/src/main/java/com/hp/autonomy/frontend/view/hod/HodViewService.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/hp/autonomy/frontend/view/hod/HodViewService.java +++ b/src/main/java/com/hp/autonomy/frontend/view/hod/HodViewService.java @@ -21,5 +21,14 @@ public interface HodViewService { */ void viewDocument(String reference, ResourceIdentifier index, OutputStream outputStream) throws IOException, HodErrorException; + /** + * View a static content promotion, writing the output to the given output stream. + * @param documentReference The reference of the search result created by the promotion + * @param queryManipulationIndex The domain and name of the query manipulation index + * @param outputStream The output stream to write the viewed document to + * @throws IOException + * @throws HodErrorException + */ void viewStaticContentPromotion(String documentReference, ResourceIdentifier queryManipulationIndex, OutputStream outputStream) throws IOException, HodErrorException; + }
Added JavaDoc to view service interface. [rev: none]
microfocus-idol_haven-search-components
train
java
a7ef57d4da4903f1bebd25ba3024bff1b584614e
diff --git a/blocks/section_links/block_section_links.php b/blocks/section_links/block_section_links.php index <HASH>..<HASH> 100644 --- a/blocks/section_links/block_section_links.php +++ b/blocks/section_links/block_section_links.php @@ -68,7 +68,7 @@ class block_section_links extends block_base { if (!empty($display)) { $link = $CFG->wwwroot.'/course/view.php?id='.$this->instance->pageid.'&amp;'.$sectionname.'='; } else { - $link = '#'; + $link = '#section-'; } $text = ''; for ($i = $inc; $i <= $course->numsections; $i += $inc) {
Making section links point to #section-NNN instead of #NNN
moodle_moodle
train
php
7e996cf4a21cfabbcc26d04dba6ff3b0fbc2f45a
diff --git a/client/task_runner.go b/client/task_runner.go index <HASH>..<HASH> 100644 --- a/client/task_runner.go +++ b/client/task_runner.go @@ -181,6 +181,7 @@ func (r *TaskRunner) Run() { } // Monitoring the Driver + defer r.DestroyState() err = r.monitorDriver(r.handle.WaitCh(), r.updateCh, r.destroyCh) for err != nil { r.logger.Printf("[ERR] client: failed to complete task '%s' for alloc '%s': %v", @@ -189,7 +190,7 @@ func (r *TaskRunner) Run() { if !shouldRestart { r.logger.Printf("[INFO] client: Not restarting task: %v for alloc: %v ", r.task.Name, r.allocID) r.setStatus(structs.AllocClientStatusDead, fmt.Sprintf("task failed with: %v", err)) - break + return } r.logger.Printf("[INFO] client: Restarting Task: %v", r.task.Name) @@ -215,8 +216,6 @@ func (r *TaskRunner) Run() { // Cleanup after ourselves r.logger.Printf("[INFO] client: completed task '%s' for alloc '%s'", r.task.Name, r.allocID) r.setStatus(structs.AllocClientStatusDead, "task completed") - - r.DestroyState() } // This functions listens to messages from the driver and blocks until the
Don't set the alloc status twice when not restarting
hashicorp_nomad
train
go
406f2ee01f5cf8e5c9430f76c723dc6251c6959c
diff --git a/bench/util/benchwarmer.js b/bench/util/benchwarmer.js index <HASH>..<HASH> 100644 --- a/bench/util/benchwarmer.js +++ b/bench/util/benchwarmer.js @@ -11,7 +11,7 @@ function BenchWarmer() { this.errors = {}; } -var print = require('sys').print; +var print = require('util').print; BenchWarmer.prototype = { winners: function(benches) {
require('sys') is deprecated, using 'util' instead (node:<I>) DeprecationWarning: sys is deprecated. Use util instead. (cherry picked from commit 9a<I> by @travnels)
wycats_handlebars.js
train
js
23dca5edfd2f152fcc2f638553ecee4ebb3a5d41
diff --git a/txstore/tx.go b/txstore/tx.go index <HASH>..<HASH> 100644 --- a/txstore/tx.go +++ b/txstore/tx.go @@ -1322,10 +1322,10 @@ func (s *Store) Records() (records []*TxRecord) { // Unconfirmed records are saved unsorted, and must be sorted by // received date on the fly. - unconfirmed := make([]*TxRecord, len(s.unconfirmed.txs)) + unconfirmed := make([]*TxRecord, 0, len(s.unconfirmed.txs)) for _, r := range s.unconfirmed.txs { key := BlockTxKey{BlockHeight: -1} - unconfirmed = append(records, &TxRecord{key, r, s}) + unconfirmed = append(unconfirmed, &TxRecord{key, r, s}) } sort.Sort(byReceiveDate(unconfirmed)) records = append(records, unconfirmed...)
Fix bug returning unconfirmed txstore records. The incorrect slice was being appended to, causing some unconfirmedg records to be dropped from the return result.
btcsuite_btcwallet
train
go
405ac7d295343c796f23b95a94a9f1f3b434c7c5
diff --git a/emitter.go b/emitter.go index <HASH>..<HASH> 100644 --- a/emitter.go +++ b/emitter.go @@ -16,7 +16,9 @@ type Event struct { Peripheral Peripheral } -type EventHandlerFunc func(Event) +// The event handler function. +// Return true to terminate +type EventHandlerFunc func(Event) bool // Emitter is an object to emit and handle Event(s) type Emitter struct { @@ -35,13 +37,19 @@ func (e *Emitter) Init() { ev := <-e.event if fn, ok := e.handlers[ev.Name]; ok { - fn(ev) + if fn(ev) { + break + } } else if fn, ok := e.handlers[ALL]; ok { - fn(ev) + if fn(ev) { + break + } } else { log.Println("unhandled Emit", ev) } } + + close(e.event) }() }
handlers now return a boolean to stop the processor (true: close the channel and terminate the goroutine)
raff_goble
train
go
a547730615e710c22a1acf8d7bcd6ab20d5ddb3f
diff --git a/properties/task.py b/properties/task.py index <HASH>..<HASH> 100644 --- a/properties/task.py +++ b/properties/task.py @@ -4,7 +4,7 @@ from properties.base import HasProperties from properties.basic import String, Bool -class Result(HasProperties): +class BaseResult(HasProperties): """The result of a computation""" success = Bool( @@ -21,7 +21,7 @@ class Task(HasProperties): """Computational task""" _REGISTRY = dict() - Result = Result + Result = BaseResult def wrap_call(self): """Carry out common tasks before and after execution"""
Rename Result to BaseResult.
seequent_properties
train
py
76d6681f68f198f7a37661b0dec77f54ff4b2089
diff --git a/lib/Predis/Connection/PhpiredisStreamConnection.php b/lib/Predis/Connection/PhpiredisStreamConnection.php index <HASH>..<HASH> 100644 --- a/lib/Predis/Connection/PhpiredisStreamConnection.php +++ b/lib/Predis/Connection/PhpiredisStreamConnection.php @@ -61,6 +61,16 @@ class PhpiredisStreamConnection extends StreamConnection } /** + * {@inheritdoc} + */ + public function __destruct() + { + phpiredis_reader_destroy($this->reader); + + parent::__destruct(); + } + + /** * Checks if the phpiredis extension is loaded in PHP. */ protected function checkExtensions() @@ -172,9 +182,15 @@ class PhpiredisStreamConnection extends StreamConnection */ public function __sleep() { + return array_diff(parent::__sleep(), array('mbiterable')); + } + + /** + * {@inheritdoc} + */ + public function __wakeup() + { $this->checkExtensions(); $this->initializeReader(); - - return array_diff(parent::__sleep(), array('mbiterable')); } }
Fix unserialization of Predis/Connection/PhpiredisStreamConnection.
imcj_predis
train
php
cc2902ab205180fabcba613eae6028d75ba1df3b
diff --git a/components/Composition.php b/components/Composition.php index <HASH>..<HASH> 100644 --- a/components/Composition.php +++ b/components/Composition.php @@ -2,6 +2,8 @@ namespace admin\components; +use \luya\helpers\Url; + class Composition extends \yii\base\Component { private $_composition = []; @@ -35,7 +37,7 @@ class Composition extends \yii\base\Component return; } - return \luya\helpers\Url::trailing(implode('/', $this->_composition)); + return Url::trailing(implode('/', $this->_composition)); } public function getLocale()
added links full_url, added preview button to cms admin
luyadev_luya-module-admin
train
php
894dbd0420c9c09d3763d3bfaf4184b1a88fc291
diff --git a/mod/scorm/db/upgrade.php b/mod/scorm/db/upgrade.php index <HASH>..<HASH> 100644 --- a/mod/scorm/db/upgrade.php +++ b/mod/scorm/db/upgrade.php @@ -552,7 +552,7 @@ function xmldb_scorm_upgrade($oldversion) { $table = new xmldb_table('scorm_seq_objective'); $field = new xmldb_field('objectiveid', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, 'primaryobj'); $dbman->change_field_type($table, $field); - upgrade_main_savepoint(true, 2011073100, 'scorm'); + upgrade_mod_savepoint(true, 2011073100, 'scorm'); } return true;
MDL-<I> - fix version in upgrade - thanks Andrew
moodle_moodle
train
php
7d3899dba93e83aefe28daae35c60432aa89d30c
diff --git a/lib/transforms/cloneForEachLocale.js b/lib/transforms/cloneForEachLocale.js index <HASH>..<HASH> 100644 --- a/lib/transforms/cloneForEachLocale.js +++ b/lib/transforms/cloneForEachLocale.js @@ -39,8 +39,10 @@ function assetNeedsLocalization(asset, assetGraph) { } } else if (asset.isHtml || asset.isSvg) { i18nTools.eachI18nTagInHtmlDocument(asset.parseTree, function () { - needsLocalization = true; - return false; + if (options.key !== null) { + needsLocalization = true; + return false; + } }); } else if (asset.type === 'Css') { asset.eachRuleInParseTree(function (cssRule, parentRuleOrStylesheet) {
cloneForEachLocale: Don't consider an data-i<I>n attribute with a value of "" sufficient for the asset to require localization.
assetgraph_assetgraph-builder
train
js
1fe66f26de7d1350faad40e111ff9c635df84447
diff --git a/mailer/models.py b/mailer/models.py index <HASH>..<HASH> 100644 --- a/mailer/models.py +++ b/mailer/models.py @@ -122,6 +122,15 @@ class Message(models.Model): verbose_name = _("message") verbose_name_plural = _("messages") + def __str__(self): + try: + email = self.email + return "On {0}, \"{1}\" to {2}".format(self.when_attempted, + email.subject, + ", ".join(email.to)) + except Exception: + return "<Message repr unavailable>" + def defer(self): self.priority = PRIORITY_DEFERRED self.save() @@ -283,6 +292,15 @@ class MessageLog(models.Model): verbose_name = _("message log") verbose_name_plural = _("message logs") + def __str__(self): + try: + email = self.email + return "On {0}, \"{1}\" to {2}".format(self.when_added, + email.subject, + ", ".join(email.to)) + except Exception: + return "<MessageLog repr unavailable>" + @property def email(self): return db_to_email(self.message_data)
More helpful `__str__ for Message and MessageLog
pinax_django-mailer
train
py
902b7dd0bd51062f0f1ce4c3c9c6e4789e077ba3
diff --git a/app/models/marty/script.rb b/app/models/marty/script.rb index <HASH>..<HASH> 100644 --- a/app/models/marty/script.rb +++ b/app/models/marty/script.rb @@ -141,8 +141,10 @@ class Marty::Script < Marty::Base engine = Marty::ScriptSet.new(tag).get_engine(script) # IMPORTANT: engine evals (e.g. eval_to_hash) modify the - # params. So, need to clone it. - engine.evaluate(node, attr, params.clone) + # params, but it is possible that we may be passing in + # a frozen hash. To avoid performance impacts, we should first check if + # params is frozen to decide whether to dup (frozen) or clone (not frozen). + engine.evaluate(node, attr, params.frozen? ? params.dup : params.clone) end delorean_fn :pretty_print, sig: 1 do diff --git a/lib/marty/version.rb b/lib/marty/version.rb index <HASH>..<HASH> 100644 --- a/lib/marty/version.rb +++ b/lib/marty/version.rb @@ -1,3 +1,3 @@ module Marty - VERSION = "1.2.4" + VERSION = "1.2.5" end
allow script calls with frozen params
arman000_marty
train
rb,rb