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
ac4bcc2468260e10d79da73bc26bc1cdebc3f991
diff --git a/src/Ouzo/Core/Bootstrap.php b/src/Ouzo/Core/Bootstrap.php index <HASH>..<HASH> 100644 --- a/src/Ouzo/Core/Bootstrap.php +++ b/src/Ouzo/Core/Bootstrap.php @@ -33,7 +33,8 @@ class Bootstrap public function __construct(EnvironmentSetter $environmentSetter = null) { error_reporting(E_ALL); - ($environmentSetter ?: new EnvironmentSetter('prod'))->set(); + $environmentSetter = $environmentSetter ?: new EnvironmentSetter('prod'); + $environmentSetter->set(); } /**
[Core] Support for middleware in controller and extract a request execution - fixed for php <I>.
letsdrink_ouzo
train
php
9c32fb42ec6b8a3c8dccc0ac8dc099bd750cce5d
diff --git a/man_docs.go b/man_docs.go index <HASH>..<HASH> 100644 --- a/man_docs.go +++ b/man_docs.go @@ -47,8 +47,14 @@ func (cmd *Command) GenManTree(header *GenManHeader, dir string) { } out := new(bytes.Buffer) + needToResetTitle := header.Title == "" + cmd.GenMan(header, out) + if needToResetTitle { + header.Title = "" + } + filename := cmd.CommandPath() filename = dir + strings.Replace(filename, " ", "-", -1) + ".1" outFile, err := os.Create(filename)
Reset man page title when necessary in GenManTree If the user did not define header.Title when calling GenManTree(), reset it after each call to GenMan(), otherwise the entire man page tree would be stuck with the full command name that was calculated for the first man page, leaving all subsequent man pages with an identical but incorrect title.
spf13_cobra
train
go
17ec278f56b931b500bdb3734a913f3be3ee7b7f
diff --git a/lib/lexer/generic.js b/lib/lexer/generic.js index <HASH>..<HASH> 100644 --- a/lib/lexer/generic.js +++ b/lib/lexer/generic.js @@ -396,7 +396,6 @@ function anyValue(token, getNextToken) { function dimension(type) { return function(token, getNextToken, opts) { - debugger; if (token === null || token.type !== TYPE.Dimension) { return 0; }
remove missed debugger (fixes #<I>)
csstree_csstree
train
js
ce5a18fc5cc250b509da763ced38faf4c27d7a75
diff --git a/share_post/share_post.py b/share_post/share_post.py index <HASH>..<HASH> 100644 --- a/share_post/share_post.py +++ b/share_post/share_post.py @@ -43,6 +43,10 @@ def share_post(content): facebook_link = 'http://www.facebook.com/sharer/sharer.php?s=100&amp;p%%5Burl%%5D=%s' % url gplus_link = 'https://plus.google.com/share?url=%s' % url twitter_link = 'http://twitter.com/home?status=%s' % tweet + linkedin_link = 'https://www.linkedin.com/shareArticle?mini=true&url=%s&title=%s&summary=%s&source=%s' % ( + url, title, summary, url + ) + mail_link = 'mailto:?subject=%s&amp;body=%s' % (title, url) share_links = { @@ -50,6 +54,7 @@ def share_post(content): 'twitter': twitter_link, 'facebook': facebook_link, 'google-plus': gplus_link, + 'linkedin': linkedin_link, 'email': mail_link } content.share_post = share_links @@ -57,3 +62,5 @@ def share_post(content): def register(): signals.content_object_init.connect(share_post) + +
add share-to-linkedin support
getpelican_pelican-plugins
train
py
2a10d6660502a0ef6b61efbd583d89ecf8a71eb2
diff --git a/lib/ruby_edit/grep.rb b/lib/ruby_edit/grep.rb index <HASH>..<HASH> 100644 --- a/lib/ruby_edit/grep.rb +++ b/lib/ruby_edit/grep.rb @@ -9,6 +9,7 @@ module RubyEdit def initialize(options) @path = options[:path] || '*' @expression = options[:expression] + @config = RubyEdit.config end def search(output: $stdout, errors: $stderr) @@ -16,7 +17,7 @@ module RubyEdit output.puts 'No expression given' return false end - @result = run "grep -irn #{@path} -e '#{@expression}'" do |out, err| + @result = run "grep -#{@config.grep_options} #{@path} -e '#{@expression}'" do |out, err| errors << err if err end rescue TTY::Command::ExitError => error
Use the users grep_options configuration for the grepping functionality. Why? - This allows the user to set and use their own default options, improving their experience. How? - Interpolate the configuration into the grep command.
finn-francis_ruby-edit
train
rb
4677f22c80e9092fd7f6bf92945040c63dde6287
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -50,4 +50,5 @@ setup( packages=find_packages(exclude=['docs']), include_package_data=True, zip_safe=False, + python_requires='>=3.5', )
Add python_requires to setup.py (#<I>)
django-crispy-forms_django-crispy-forms
train
py
bd2567a3a927569f39fa57f3bcfd4cd9c09ae499
diff --git a/django_stormpath/models.py b/django_stormpath/models.py index <HASH>..<HASH> 100644 --- a/django_stormpath/models.py +++ b/django_stormpath/models.py @@ -109,6 +109,10 @@ class StormpathBaseUser(AbstractBaseUser, PermissionsMixin): for field in self.STORMPATH_BASE_FIELDS: if field != 'password': self.__setattr__(field, account[field]) + for key in account.custom_data.keys(): + self.__setattr__(key, account.custom_data[key]) + + self.is_active = True if account.status == account.STATUS_ENABLED else False def _create_stormpath_user(self, data, raw_password): data['password'] = raw_password
make sure to mirror custom_data onto db
stormpath_stormpath-django
train
py
51ee6739f581e4edb1e0a3754d0472a0c13f968c
diff --git a/bin/redis-commander.js b/bin/redis-commander.js index <HASH>..<HASH> 100755 --- a/bin/redis-commander.js +++ b/bin/redis-commander.js @@ -22,7 +22,8 @@ var args = optimist }) .options('redis-db', { string: true, - describe: 'The redis database.' + describe: 'The redis database.', + default: 0 }) .options('http-auth-username', { alias: "http-u",
Sets default database selection to 0
joeferner_redis-commander
train
js
6bb976970dc1c0df0c1020642a19d4fa72926377
diff --git a/seed_control_interface/__init__.py b/seed_control_interface/__init__.py index <HASH>..<HASH> 100644 --- a/seed_control_interface/__init__.py +++ b/seed_control_interface/__init__.py @@ -1,2 +1,2 @@ -__version__ = '0.9.6' +__version__ = '0.9.7' VERSION = __version__
Bumped version to <I>
praekeltfoundation_seed-control-interface
train
py
297df458d5086f985c11dc3348764759630b1927
diff --git a/Library/Stubs/Generator.php b/Library/Stubs/Generator.php index <HASH>..<HASH> 100644 --- a/Library/Stubs/Generator.php +++ b/Library/Stubs/Generator.php @@ -157,6 +157,10 @@ EOF; $source .= PHP_EOL; foreach ($class->getMethods() as $method) { + if ($method->isInternal()) { + continue; + } + $source .= $this->buildMethod($method, $class->getType() === 'interface', $indent) . "\n\n"; }
Stubs - hide internal method(s)
phalcon_zephir
train
php
0249070d135d7928f0631b8a0f33fed4df5bf50d
diff --git a/lib/ShortPixel.php b/lib/ShortPixel.php index <HASH>..<HASH> 100644 --- a/lib/ShortPixel.php +++ b/lib/ShortPixel.php @@ -4,7 +4,7 @@ namespace ShortPixel; class ShortPixel { const LIBRARY_CODE = "sp-sdk"; - const VERSION = "1.8.0"; + const VERSION = "1.8.1"; const DEBUG_LOG = false; const MAX_ALLOWED_FILES_PER_CALL = 10; diff --git a/lib/ShortPixel/Client.php b/lib/ShortPixel/Client.php index <HASH>..<HASH> 100644 --- a/lib/ShortPixel/Client.php +++ b/lib/ShortPixel/Client.php @@ -318,6 +318,8 @@ class Client { // aici folosim ceva de genul: parse_url si apoi pe partea de path: str_replace('%2F', '/', rawurlencode($this->filePath) // $body["urllist"] = array_map('rawurlencode', $body["urllist"]); // } + if(isset($body["buffers"])) unset($body['buffers']); + $body = json_encode($body); array_push($header, "Content-Type: application/json");
Fix fromBuffer when larger file that is not optimized in the first API call.
short-pixel-optimizer_shortpixel-php
train
php,php
9990a4e512bfe3adcfde85a6a883567421031f41
diff --git a/cli/route.go b/cli/route.go index <HASH>..<HASH> 100644 --- a/cli/route.go +++ b/cli/route.go @@ -37,7 +37,7 @@ Options: -p, --port=<port> port to accept traffic on --no-drain-backends don't wait for in-flight requests to complete before stopping backends --disable-keep-alives disable keep-alives between the router and backends for the given route - --enable-keep-alives enable keep-alives between the router and backends for the given route + --enable-keep-alives enable keep-alives between the router and backends for the given route (default for new routes) Commands: With no arguments, shows a list of routes.
cli: Update comment for '--enable-keep-alives'
flynn_flynn
train
go
c5f20716ca93a1a6a16d59ed842c01723e53233d
diff --git a/fault/pytest_utils.py b/fault/pytest_utils.py index <HASH>..<HASH> 100644 --- a/fault/pytest_utils.py +++ b/fault/pytest_utils.py @@ -6,7 +6,7 @@ def pytest_sim_params(metafunc, *args): sims_by_arg = {'system-verilog': ['vcs', 'ncsim', 'iverilog'], 'verilog-ams': ['ncsim'], 'verilator': [None], - 'spice': ['ngspice']} + 'spice': ['ngspice', 'spectre']} # only parameterize if we can actually specify the target type # and simulator to use for this particular test
added spectre to the list of spice targets
leonardt_fault
train
py
e1d235c53aa92f227d13e70f24257f31ec8ff49f
diff --git a/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/annotation/ComponentAnnotationLoader.java b/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/annotation/ComponentAnnotationLoader.java index <HASH>..<HASH> 100644 --- a/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/annotation/ComponentAnnotationLoader.java +++ b/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/annotation/ComponentAnnotationLoader.java @@ -461,7 +461,7 @@ public class ComponentAnnotationLoader * @param location the name of the resources to look for * @return the list of component implementation class names * @throws IOException in case of an error loading the component list resource - * @since 3.3M1 + * @since 12.1RC1 */ public List<ComponentDeclaration> getDeclaredComponents(ClassLoader classLoader, String location) throws IOException
XCOMMONS-<I>: Add ability to specify excludes when using the @AllComponents annotation * Update since the method is now public
xwiki_xwiki-commons
train
java
eccc5278b9955f1c8a53faa5cf9e24659ad1cf3c
diff --git a/const.go b/const.go index <HASH>..<HASH> 100644 --- a/const.go +++ b/const.go @@ -1,7 +1,3 @@ -// Copyright 2012 The Oneslang Authors. All rights reserved. -// Use of this source code is governed by a MIT-style -// license that can be found in the LICENSE file. - package log // Priority used for identifying the severity of an event.
removing copyright notice from const
llimllib_loglevel
train
go
063242b365c1182b0f8db141edc6be8fb5cc9c05
diff --git a/lib/svtplay_dl/service/svtplay.py b/lib/svtplay_dl/service/svtplay.py index <HASH>..<HASH> 100644 --- a/lib/svtplay_dl/service/svtplay.py +++ b/lib/svtplay_dl/service/svtplay.py @@ -54,14 +54,6 @@ class Svtplay(Service, OpenGraphThumbMixin): else: options.live = False - if data["video"]["subtitleReferences"]: - try: - suburl = data["video"]["subtitleReferences"][0]["url"] - except KeyError: - pass - if suburl and len(suburl) > 0: - yield subtitle(copy.copy(options), "wrst", suburl) - if options.output_auto: directory = os.path.dirname(options.output) options.service = "svtplay" @@ -77,6 +69,14 @@ class Svtplay(Service, OpenGraphThumbMixin): else: options.output = title + if data["video"]["subtitleReferences"]: + try: + suburl = data["video"]["subtitleReferences"][0]["url"] + except KeyError: + pass + if suburl and len(suburl) > 0: + yield subtitle(copy.copy(options), "wrst", suburl) + if options.force_subtitle: return
svtplay: subtitles didn’t get the right filename
spaam_svtplay-dl
train
py
bc0f906de687a5e0a4521943f9922838a91bab6a
diff --git a/lib/octocatalog-diff/catalog/computed.rb b/lib/octocatalog-diff/catalog/computed.rb index <HASH>..<HASH> 100644 --- a/lib/octocatalog-diff/catalog/computed.rb +++ b/lib/octocatalog-diff/catalog/computed.rb @@ -80,7 +80,7 @@ module OctocatalogDiff # Environment used to compile catalog def environment - @options.fetch(:environment, 'production') + @opts.fetch(:environment, 'production') end private
Use a Variable that Actually Exists
github_octocatalog-diff
train
rb
b8f218012cf0e10bfc100bb1e509970cb2c548d3
diff --git a/django_cas_ng/backends.py b/django_cas_ng/backends.py index <HASH>..<HASH> 100644 --- a/django_cas_ng/backends.py +++ b/django_cas_ng/backends.py @@ -44,7 +44,7 @@ class CASBackend(ModelBackend): user.save() created = True - if not self.check_additional_permissions(user): + if not self.user_can_authenticate(user): return None if pgtiou and settings.CAS_PROXY_CALLBACK: @@ -61,7 +61,7 @@ class CASBackend(ModelBackend): ) return user - def check_additional_permissions(self, user): + def user_can_authenticate(self, user): return True def get_user(self, user_id):
Update backends.py The ModelBackend from django.contrib.auth have a public user_can_authenticate method, so rename this method to be consistent with django.
mingchen_django-cas-ng
train
py
e564bb252bb530c1fd5b561f9b52f7c003a0caa9
diff --git a/salt/modules/config.py b/salt/modules/config.py index <HASH>..<HASH> 100644 --- a/salt/modules/config.py +++ b/salt/modules/config.py @@ -10,6 +10,7 @@ import urllib2 # Import salt libs import salt.utils +import salt._compat import salt.syspaths as syspaths __proxyenabled__ = ['*'] @@ -79,8 +80,13 @@ def manage_mode(mode): ''' if mode is None: return None - ret = str(mode).lstrip('0').zfill(4) + if not isinstance(mode, salt._compat.string_types): + # Make it a string in case it's not + mode = str(mode) + # Strip any quotes and initial 0, though zero-pad it up to 4 + ret = mode.strip('"').strip('\'').lstrip('0').zfill(4) if ret[0] != '0': + # Always include a leading zero return '0{0}'.format(ret) return ret
Improve mode management. Specifically, unquote it.
saltstack_salt
train
py
464e72cb76ab0a820747b18bc20bbb4cfc5bbefd
diff --git a/ReText/htmldialog.py b/ReText/htmldialog.py index <HASH>..<HASH> 100644 --- a/ReText/htmldialog.py +++ b/ReText/htmldialog.py @@ -4,7 +4,7 @@ from ReText.highlighter import ReTextHighlighter class HtmlDialog(QDialog): def __init__(self, parent=None): QDialog.__init__(self, parent) - self.resize(600, 500) + self.resize(700, 600) self.verticalLayout = QVBoxLayout(self) self.textEdit = QTextEdit(self) self.textEdit.setReadOnly(True)
HtmlDialog: make it a bit larger by default
retext-project_retext
train
py
e30900231795c197ac759d3c54dcf0b86dfb7d2e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -5,12 +5,12 @@ with open('requirements.txt') as f: setup( name='ssbio', - version='0.9.6', + version='0.9.7', author='Nathan Mih', author_email='nmih@ucsd.edu', license='MIT', url='http://github.com/SBRG/ssbio', - download_url = 'https://github.com/SBRG/ssbio/archive/v0.9.6.tar.gz', + download_url = 'https://github.com/SBRG/ssbio/archive/v0.9.7.tar.gz', description='Tools to enable structural systems biology', packages=find_packages(), package_dir={'ssbio': 'ssbio'},
Improvements to I-TASSER preparation scripts for Torque and Slurm runtypes
SBRG_ssbio
train
py
81a306866dabdaefae546e56ff58ced6b5600fa1
diff --git a/src/Charcoal/Admin/Config.php b/src/Charcoal/Admin/Config.php index <HASH>..<HASH> 100644 --- a/src/Charcoal/Admin/Config.php +++ b/src/Charcoal/Admin/Config.php @@ -43,13 +43,16 @@ class Config extends AbstractConfig 'Path must be a string' ); } + // Can not be empty if ($path == '') { throw new InvalidArgumentException( 'Path can not be empty' ); } + $this->basePath = $path; + return $this; } @@ -60,4 +63,27 @@ class Config extends AbstractConfig { return $this->basePath; } + + /** + * @param string $path The admin module base path. + * @throws InvalidArgumentException + * @return Config Chainable + */ + public function setRoutes($routes) + { + if (!isset($this->routes)) { + $this->routes = []; + } + + $toIterate = [ 'templates', 'actions', 'scripts' ]; + foreach ($routes as $key => $val) { + if (in_array($key, $toIterate) && isset($this->routes[$key])) { + $this->routes[$key] = array_merge($this->routes[$key], $val); + } else { + $this->routes[$key] = $val; + } + } + + return $this; + } }
Admin\Config merges routes Instead of overwritting the entire "routes" object, the config will now merge "templates", "actions", and "scripts".
locomotivemtl_charcoal-admin
train
php
78788ee8c0e3da1145ab7e96ace2e93b274bbcb1
diff --git a/admin/views/Utilities/index.php b/admin/views/Utilities/index.php index <HASH>..<HASH> 100644 --- a/admin/views/Utilities/index.php +++ b/admin/views/Utilities/index.php @@ -76,7 +76,7 @@ echo form_field_textarea([ 'key' => '', 'label' => 'Whitelist', - 'default' => json_encode(\Nails\Config::get('EMAIL_WHITELIST')), + 'default' => implode(PHP_EOL, (array) \Nails\Config::get('EMAIL_WHITELIST') ?: []), 'info' => 'If defined, email is only released if the "to" address is whitelisted', 'readonly' => true, ]);
Rendering email whitelsit as one per line
nails_module-email
train
php
0d230a08d6f7fdfdd52e736a87e5586c68aa6245
diff --git a/tests/Api/CampaignsTest.php b/tests/Api/CampaignsTest.php index <HASH>..<HASH> 100644 --- a/tests/Api/CampaignsTest.php +++ b/tests/Api/CampaignsTest.php @@ -51,7 +51,7 @@ class CampaignsTest extends MauticApiTestCase ) ); - protected $skipPayloadAssertion = array('events', 'forms', 'lists', 'canvasSettings'); + protected $skipPayloadAssertion = array('events', 'forms', 'lists', 'canvasSettings', 'dateModified', 'dateAdded'); public function setUp() { $this->testPayload = array( @@ -260,6 +260,7 @@ class CampaignsTest extends MauticApiTestCase public function testEditPut() { + $this->setUpPayloadClass(); $apiContext = $this->getContext($this->context); $response = $apiContext->edit(1000000, $this->testPayload, true); $this->assertPayload($response); @@ -311,6 +312,8 @@ class CampaignsTest extends MauticApiTestCase public function testAddAndRemove() { + $this->setUpPayloadClass(); + // Create contact $contactsContext = $this->getContext('contacts'); $response = $contactsContext->create(array('firstname' => 'API campagin test'));
Fixed failed tests if segment with ID 1 doesn't exist
mautic_api-library
train
php
15c93d2a865422a1f8aee9ee162973253148bb68
diff --git a/h2o-perf/bench/py/h2oPerf/H2O.py b/h2o-perf/bench/py/h2oPerf/H2O.py index <HASH>..<HASH> 100644 --- a/h2o-perf/bench/py/h2oPerf/H2O.py +++ b/h2o-perf/bench/py/h2oPerf/H2O.py @@ -417,6 +417,12 @@ class H2OCloudNode: pass except OSError: pass + try: + requests.get("http://" + self.ip + ":" + self.port + "/Shutdown.html", timeout=5) + except Exception, e: + print "Got Exception trying to shutdown H2O:" + print e + pass print "Successfully shutdown h2o!" self.pid = -1
More logging and tries around H2O shutdown
h2oai_h2o-2
train
py
862ff8a9eb0a68b02feac8ac8ec4f2082ea8cff1
diff --git a/src/java/com/threerings/jme/JmeApp.java b/src/java/com/threerings/jme/JmeApp.java index <HASH>..<HASH> 100644 --- a/src/java/com/threerings/jme/JmeApp.java +++ b/src/java/com/threerings/jme/JmeApp.java @@ -136,8 +136,8 @@ public class JmeApp return true; - } catch (Exception e) { - reportInitFailure(e); + } catch (Throwable t) { + reportInitFailure(t); return false; } } @@ -342,9 +342,9 @@ public class JmeApp * Called when initialization fails to give the application a chance * to report the failure to the user. */ - protected void reportInitFailure (Exception e) + protected void reportInitFailure (Throwable t) { - Log.logStackTrace(e); + Log.logStackTrace(t); } /**
Catch Throwable because LWJGL kindly throws errors during initialization in addition to exceptions. Yay! git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1
threerings_narya
train
java
5eceb9d29345a650753261e68644eb809d07706b
diff --git a/src/toil_lib/tools/aligners.py b/src/toil_lib/tools/aligners.py index <HASH>..<HASH> 100644 --- a/src/toil_lib/tools/aligners.py +++ b/src/toil_lib/tools/aligners.py @@ -59,11 +59,12 @@ def run_star(job, r1_id, r2_id, star_index_url, wiggle=False): # Write to fileStore transcriptome_id = job.fileStore.writeGlobalFile(os.path.join(work_dir, 'rnaAligned.toTranscriptome.out.bam')) sorted_id = job.fileStore.writeGlobalFile(os.path.join(work_dir, 'rnaAligned.sortedByCoord.out.bam')) + log_id = job.fileStore.writeGlobalFile(os.path.join(work_dir, 'rnaLog.final.out')) if wiggle: wiggle_id = job.fileStore.writeGlobalFile(os.path.join(work_dir, 'rnaSignal.UniqueMultiple.str1.out.bg')) - return transcriptome_id, sorted_id, wiggle_id + return transcriptome_id, sorted_id, wiggle_id, log_id else: - return transcriptome_id, sorted_id + return transcriptome_id, sorted_id, log_id def run_bwakit(job, config, sort=True, trim=False):
Return log.final.out from STAR (resolves #<I>) Needed by CKCC for QC. This breaks backwards compatability but only toil-rnaseq uses this function as of now.
BD2KGenomics_toil-lib
train
py
61ba91bb147f56aa0270bba840eb55c6179e3e94
diff --git a/lib/frankmayer/ArangoDbPhpCore/Autoloader.php b/lib/frankmayer/ArangoDbPhpCore/Autoloader.php index <HASH>..<HASH> 100644 --- a/lib/frankmayer/ArangoDbPhpCore/Autoloader.php +++ b/lib/frankmayer/ArangoDbPhpCore/Autoloader.php @@ -56,6 +56,8 @@ class Autoloader * @param string $className - The name of class to be loaded * * @return void + * + * @codeCoverageIgnore */ public static function load($className) { diff --git a/lib/frankmayer/ArangoDbPhpCore/Protocols/Http/HttpRequest.php b/lib/frankmayer/ArangoDbPhpCore/Protocols/Http/HttpRequest.php index <HASH>..<HASH> 100644 --- a/lib/frankmayer/ArangoDbPhpCore/Protocols/Http/HttpRequest.php +++ b/lib/frankmayer/ArangoDbPhpCore/Protocols/Http/HttpRequest.php @@ -73,6 +73,8 @@ class HttpRequest extends AbstractHttpRequest * @param string $boundary * * @return HttpResponseInterface + * + * @codeCoverageIgnore There is no unit-test for this ATM. However, the functionality is tested by integration tests from higher level clients like Core-Guzzle */ public function sendBatch(array $batchParts = [], $boundary = 'XXXbXXX') {
Mark some methods to be ignored by code coverage
frankmayer_ArangoDB-PHP-Core
train
php,php
dba5268beda37d9eebe1fe11cbcf9f0f0f6db16d
diff --git a/android/sprockets/src/main/java/net/sf/sprockets/content/Intents.java b/android/sprockets/src/main/java/net/sf/sprockets/content/Intents.java index <HASH>..<HASH> 100644 --- a/android/sprockets/src/main/java/net/sf/sprockets/content/Intents.java +++ b/android/sprockets/src/main/java/net/sf/sprockets/content/Intents.java @@ -33,7 +33,6 @@ public class Intents { * True if the Intent can be resolved to an Activity. */ public static boolean hasActivity(Context context, Intent intent) { - return context.getPackageManager() - .queryIntentActivities(intent, MATCH_DEFAULT_ONLY).size() > 0; + return context.getPackageManager().resolveActivity(intent, MATCH_DEFAULT_ONLY) != null; } }
check resolveActivity != null rather than queryIntentActivities.size, should be faster
pushbit_sprockets
train
java
392c48278507ef5ac43dd450725ce0ffb6b4d4ce
diff --git a/lib/active_job/queue_adapters/resque_adapter.rb b/lib/active_job/queue_adapters/resque_adapter.rb index <HASH>..<HASH> 100644 --- a/lib/active_job/queue_adapters/resque_adapter.rb +++ b/lib/active_job/queue_adapters/resque_adapter.rb @@ -1,7 +1,11 @@ require 'resque' require 'active_support/core_ext/enumerable' require 'active_support/core_ext/array/access' -require 'resque-scheduler' +begin + require 'resque-scheduler' +rescue LoadError + require 'resque_scheduler' +end module ActiveJob module QueueAdapters
require both variant of resque-scheduler
rails_rails
train
rb
41813578346d6b7c4d30836f3d3d563975265eb6
diff --git a/tests/tween_test.py b/tests/tween_test.py index <HASH>..<HASH> 100644 --- a/tests/tween_test.py +++ b/tests/tween_test.py @@ -341,14 +341,11 @@ def test_get_swagger12_objects_if_both_present_but_route_not_in_prefer20( def test_request_properties(): - root_request = Request( - {}, - body='{"myKey": 42}', - headers={"X-Some-Special-Header": "foobar"}) - # this assert is intended to force the pyramid.request.Request to initialize its - # internal data structures correctly: without it, the json_body read will sometimes - # (but apparently not always) fail - assert '{"myKey": 42}' == root_request.body + root_request = Request({}, headers={"X-Some-Special-Header": "foobar"}) + # this is a slightly baroque mechanism to make sure that the request is + # internally consistent for all test environments + root_request.body = '{"myKey": 42}'.encode() + assert '{"myKey": 42}' == root_request.text request = PyramidSwaggerRequest(root_request, {}) assert {"myKey": 42} == request.body assert "foobar" == request.headers["X-Some-Special-Header"]
Better tweak of the unit tests for PyramidSwaggerRequest. Relying somewhat less on black magic (though only somewhat), we can set up the request in a way that appears to be consistent across all test setups (though the previous mechanism also appeared to work until kicked vigorously).
striglia_pyramid_swagger
train
py
8d11442dc5ac58fa62996b2b390ceb9e4e7987f4
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -60,30 +60,29 @@ function gulpRubySass (source, options) { // directory, source and options var intermediateDir = uniqueIntermediateDirectory(options.tempDir, source); var base; - var compileMapping; + var dest; // directory source if (path.extname(source) === '') { base = path.join(cwd, source); - compileMapping = source + ':' + intermediateDir; + dest = intermediateDir; } // single file source else { base = path.join(cwd, path.dirname(source)); - - var dest = path.join( + dest = path.join( intermediateDir, gutil.replaceExtension(path.basename(source), '.css') ); - compileMapping = [ source, dest ]; - // sass's single file compilation doesn't create a destination directory, so // we have to ourselves mkdirp(intermediateDir); } + var compileMapping = source + ':' + dest; + // TODO: implement glob file source var args = dargs(options, [
Standardize compile mapping code We can use the same syntax now for file and directory sources. Dry some things up and increase readability too.
sindresorhus_gulp-ruby-sass
train
js
252aee8c34986d2fab5ae3ea28c1e7e7c47048b0
diff --git a/multiqc/modules/custom_content/custom_content.py b/multiqc/modules/custom_content/custom_content.py index <HASH>..<HASH> 100644 --- a/multiqc/modules/custom_content/custom_content.py +++ b/multiqc/modules/custom_content/custom_content.py @@ -108,7 +108,7 @@ def custom_module_classes(): s_name = m_config.get('sample_name') else: c_id = k - m_config = cust_mods[c_id]['config'] + m_config = dict(cust_mods[c_id]['config']) # Guess sample name if not given if s_name is None:
Custom Content: Fixed newly introduced dict immutibility bug
ewels_MultiQC
train
py
480fa50af58726b7092378913ce646ae9eddebfa
diff --git a/dependency-check-cli/src/main/java/org/owasp/dependencycheck/App.java b/dependency-check-cli/src/main/java/org/owasp/dependencycheck/App.java index <HASH>..<HASH> 100644 --- a/dependency-check-cli/src/main/java/org/owasp/dependencycheck/App.java +++ b/dependency-check-cli/src/main/java/org/owasp/dependencycheck/App.java @@ -416,7 +416,7 @@ public class App { } /** - * Takes a path and resolves it to be a canonical & absolute path. The caveats are that this method will take an Ant style + * Takes a path and resolves it to be a canonical &amp; absolute path. The caveats are that this method will take an Ant style * file selector path (../someDir/**\/*.jar) and convert it to an absolute/canonical path (at least to the left of the first * * or ?). *
Corrected Javadoc to eliminate warning.
jeremylong_DependencyCheck
train
java
93d3bfdee0f771f50c535ff54e28e033d4adf0ad
diff --git a/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java b/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java +++ b/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java @@ -2404,10 +2404,11 @@ public class StaticTypeCheckingVisitor extends ClassCodeVisitorSupport { } } - if (candidates.isEmpty()) { + int candidateCnt = candidates.size(); + if (0 == candidateCnt) { candidates = extension.handleMissingMethod( getType(expression.getExpression()), nameText, null, null, null); - } else if (candidates.size() > 1) { + } else if (candidateCnt > 1) { candidates = extension.handleAmbiguousMethods(candidates, expression); }
Trivial refactoring: extract common variable
apache_groovy
train
java
758b1855c245e1a0bbcbe1b311bd208c17e27d5f
diff --git a/Capsule/Manager.php b/Capsule/Manager.php index <HASH>..<HASH> 100755 --- a/Capsule/Manager.php +++ b/Capsule/Manager.php @@ -19,6 +19,13 @@ class Manager { protected static $instance; /** + * The database manager instance. + * + * @var \Illuminate\Database\DatabaseManager + */ + protected $manager; + + /** * Create a new database capsule manager. * * @param \Illuminate\Container\Container $container @@ -176,6 +183,16 @@ class Manager { } /** + * Get the database manager instance. + * + * @return \Illuminate\Database\Manager + */ + public function getDatabaseManager() + { + return $this->manager; + } + + /** * Get the current event dispatcher instance. * * @return \Illuminate\Events\Dispatcher
Added getDatabaseManager method to capsule.
illuminate_database
train
php
4b8329a1c4f804c672491e77e84a882785bb7941
diff --git a/core/src/main/java/hudson/tasks/test/TestResult.java b/core/src/main/java/hudson/tasks/test/TestResult.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/tasks/test/TestResult.java +++ b/core/src/main/java/hudson/tasks/test/TestResult.java @@ -246,7 +246,7 @@ public abstract class TestResult extends TestObject { sb.append("Total Count: ").append(this.getTotalCount()).append(", "); sb.append("Fail: ").append(this.getFailCount()).append(", "); sb.append("Skipt: ").append(this.getSkipCount()).append(", "); - sb.append("Pass: ").append(this.getSkipCount()).append(",\n"); + sb.append("Pass: ").append(this.getPassCount()).append(",\n"); sb.append("Test Result Class: " ).append(this.getClass().getName()).append(" }\n"); return sb.toString(); }
Fixed reporting correct pass count by TestResult.toPrettyString() method.
jenkinsci_jenkins
train
java
7b9a1869c3f52ee2f516e68aa537db4563e8423b
diff --git a/Swat/SwatButton.php b/Swat/SwatButton.php index <HASH>..<HASH> 100644 --- a/Swat/SwatButton.php +++ b/Swat/SwatButton.php @@ -94,6 +94,7 @@ class SwatButton extends SwatControl $input_tag = new SwatHtmlTag('input'); $input_tag->type = 'submit'; $input_tag->name = $this->id; + $input_tag->id = $this->id; $input_tag->value = $this->title; if ($primary)
Output ID defined in SwatML - PHP needs a "name" attribute on the input tag, so the SwatML ID is used for the name - As of this commit, the SwatML ID is outputted as the "id" attribute in the HTML as well as the name - this makes it identifyable via JavaScript and CSS, and consistent with other Swat widgets. Word. svn commit r<I>
silverorange_swat
train
php
17717b2b5084f9961fe8fd28acadaa7a886aa73c
diff --git a/tests/Vies/ViesTest.php b/tests/Vies/ViesTest.php index <HASH>..<HASH> 100644 --- a/tests/Vies/ViesTest.php +++ b/tests/Vies/ViesTest.php @@ -179,6 +179,9 @@ class ViestTest extends \PHPUnit_Framework_TestCase */ public function testSettingSoapOptions() { + if (0 <= strpos(phpversion(), 'HipHop')) { + $this->markTestSkipped('This test does not work for HipHop VM'); + } $options = array ( 'soap_version' => SOAP_1_2, );
Fixing an issue for HHVM
DragonBe_vies
train
php
c7d251ac2d32f1df494c2c1553bb6c8766fb3fcd
diff --git a/rdopkg/actionmods/rpmfactory.py b/rdopkg/actionmods/rpmfactory.py index <HASH>..<HASH> 100644 --- a/rdopkg/actionmods/rpmfactory.py +++ b/rdopkg/actionmods/rpmfactory.py @@ -47,7 +47,7 @@ def review_patch(branch): branch = guess.current_branch() if not branch.endswith('patches'): branch = '%s-patches' % branch - git("review", "-i", "-y", "-r", "review-patches", branch, direct=True) + git("review", "-y", "-r", "review-patches", branch, direct=True) def fetch_patches_branch(local_patches_branch, gerrit_patches_chain=None, @@ -82,4 +82,4 @@ def review_spec(branch): # it assumes a commit was done and ready to be committed if not branch: branch = guess.current_branch() - git("review", "-i", "-r", "review-origin", branch, direct=True) + git("review", "-r", "review-origin", branch, direct=True)
review-spec, review-patch: don't use -i/--newchangeid Change-Id: Ie1c<I>a<I>e<I>c0dec<I>a<I>a<I>de<I>
softwarefactory-project_rdopkg
train
py
f7f0a24ae26b02352c95b76d0238394a6e63be99
diff --git a/internal/hcs/system.go b/internal/hcs/system.go index <HASH>..<HASH> 100644 --- a/internal/hcs/system.go +++ b/internal/hcs/system.go @@ -497,7 +497,7 @@ func (computeSystem *System) PropertiesV2(ctx context.Context, types ...hcsschem if err == nil && len(fallbackTypes) == 0 { return properties, nil } else if err != nil { - logEntry.WithError(fmt.Errorf("failed to query compute system properties in-proc: %w", err)) + logEntry = logEntry.WithError(fmt.Errorf("failed to query compute system properties in-proc: %w", err)) fallbackTypes = types }
Properly assign logEntry for fallback queries I didn't reassign the logEntry that contained the error reason if querying for stats in the shim failed
Microsoft_hcsshim
train
go
4fc3fb2f07908abe66444d12b1beba89d315e3af
diff --git a/lib/chef/provider/powershell_script.rb b/lib/chef/provider/powershell_script.rb index <HASH>..<HASH> 100644 --- a/lib/chef/provider/powershell_script.rb +++ b/lib/chef/provider/powershell_script.rb @@ -37,7 +37,7 @@ class Chef # executed, otherwise 0 or 1 based on whether $? is set to true # (success, where we return 0) or false (where we return 1). def NormalizeScriptExitStatus( code ) - @code = EXIT_STATUS_RESET_SCRIPT + code + EXIT_STATUS_NORMALIZATION_SCRIPT + @code = (! code.nil?) ? ( EXIT_STATUS_RESET_SCRIPT + code + EXIT_STATUS_NORMALIZATION_SCRIPT ) : nil end public diff --git a/spec/unit/provider/powershell_spec.rb b/spec/unit/provider/powershell_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/provider/powershell_spec.rb +++ b/spec/unit/provider/powershell_spec.rb @@ -31,8 +31,8 @@ describe Chef::Provider::PowershellScript, "action_run" do @provider = Chef::Provider::PowershellScript.new(@new_resource, @run_context) end - it "should set the -command flag as the last flag" do - @provider.flags.split(' ').pop.should == "-Command" + it "should set the -File flag as the last flag" do + @provider.flags.split(' ').pop.should == "-File" end end
Fix invalid assumption of non-nil code attribute and handle change to use -File instead of -Command with powershell.exe
chef_chef
train
rb,rb
510faafac6b142b6f6678077cb10b41b10e7ef46
diff --git a/djangocms_helper/__init__.py b/djangocms_helper/__init__.py index <HASH>..<HASH> 100644 --- a/djangocms_helper/__init__.py +++ b/djangocms_helper/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals -__version__ = '1.2.4' +__version__ = '1.2.5.dev1' __author__ = 'Iacopo Spalletti <i.spalletti@nephila.it>' __all__ = ['runner']
Bump develop version [ci skip]
nephila_djangocms-helper
train
py
628094166977799d15e0d21ac6b47eb9862006d1
diff --git a/src/ol/PluggableMap.js b/src/ol/PluggableMap.js index <HASH>..<HASH> 100644 --- a/src/ol/PluggableMap.js +++ b/src/ol/PluggableMap.js @@ -507,7 +507,7 @@ PluggableMap.prototype.disposeInternal = function() { unlisten(this.viewport_, EventType.MOUSEWHEEL, this.handleBrowserEvent, this); if (this.handleResize_ !== undefined) { - window.removeEventListener(EventType.RESIZE, + removeEventListener(EventType.RESIZE, this.handleResize_, false); this.handleResize_ = undefined; } @@ -1012,7 +1012,7 @@ PluggableMap.prototype.handleTargetChanged_ = function() { this.renderer_.removeLayerRenderers(); removeNode(this.viewport_); if (this.handleResize_ !== undefined) { - window.removeEventListener(EventType.RESIZE, + removeEventListener(EventType.RESIZE, this.handleResize_, false); this.handleResize_ = undefined; } @@ -1030,7 +1030,7 @@ PluggableMap.prototype.handleTargetChanged_ = function() { if (!this.handleResize_) { this.handleResize_ = this.updateSize.bind(this); - window.addEventListener(EventType.RESIZE, + addEventListener(EventType.RESIZE, this.handleResize_, false); } }
Remove window prefix from event listener functions
openlayers_openlayers
train
js
2bb26d6389fccdf069a261a2671645b9d86f3472
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -21,7 +21,8 @@ from setuptools import find_packages, setup try: from telethon import TelegramClient -except ImportError: +except Exception as e: + print('Failed to import TelegramClient due to', e) TelegramClient = None
Modify setup.py to work even if generated code was wrong
LonamiWebs_Telethon
train
py
8ee377e6fa2c2275be12e218b2c697c5c17b7839
diff --git a/my-unhosted-website/www/oauth2/auth/index.php b/my-unhosted-website/www/oauth2/auth/index.php index <HASH>..<HASH> 100644 --- a/my-unhosted-website/www/oauth2/auth/index.php +++ b/my-unhosted-website/www/oauth2/auth/index.php @@ -80,6 +80,6 @@ if(count($_POST)) { </div> </body> </html> -<? +<?php } ?>
this was breaking for some newer php versions
remotestorage_remotestorage.js
train
php
802b783b8c8ad23b59c5615be63be11b383a37f1
diff --git a/tests/test_sync.py b/tests/test_sync.py index <HASH>..<HASH> 100644 --- a/tests/test_sync.py +++ b/tests/test_sync.py @@ -12,6 +12,11 @@ from django.test import TestCase import django_peeringdb.models from django_peeringdb import settings +# set this to 0 to fetch all objects during sync test (takes forever) +# setting this to anything > 0 will trigger missing object validation errors +# causing the test to also test the fallback solution for that scenario +FETCH_LIMIT = 3 + def sync_test(f): """ @@ -64,6 +69,8 @@ class SyncTests(TestCase): def test_sync_all(self): kwargs = getattr(self, 'sync_args', {}) + if "limit" not in kwargs: + kwargs["limit"] = FETCH_LIMIT print("syncing kwargs {}".format(kwargs)) self.cmd.handle(**kwargs) # self.cmd.sync(self.cmd.get_class_list()) @@ -89,5 +96,5 @@ class SyncTests(TestCase): print(cls.objects.all().count()) def test_sync_call_command(self): - call_command('pdb_sync', interactive=False) + call_command('pdb_sync', interactive=False, limit=FETCH_LIMIT)
limit how many objects are fetched during sync tests to speed up testing and to cause triggering of missing object issue
peeringdb_django-peeringdb
train
py
098e36258c21bf3c9cf08198bc0b967ec49370a7
diff --git a/pkg/mount/mount.go b/pkg/mount/mount.go index <HASH>..<HASH> 100644 --- a/pkg/mount/mount.go +++ b/pkg/mount/mount.go @@ -1,3 +1,5 @@ +// +build linux + package mount import ( @@ -20,6 +22,8 @@ type Ops interface { Load(devPrefix string) error // Inspect mount table for specified device. ErrEnoent may be returned. Inspect(device string) (Info, error) + // HasMounts determines returns the number of mounts for the device. + HasMounts(devPath string) // Exists returns true if the device is mounted at specified path. // returned if the device does not exists. Exists(device, path string) (bool, error) @@ -75,6 +79,18 @@ func New(devPrefix string) (*Matrix, error) { return m, nil } +// HasMounts determines returns the number of mounts for the device. +func (m *Matrix) HasMounts(devPath string) int { + m.Lock() + defer m.Unlock() + + v, ok := m.mounts[devPath] + if !ok { + return 0 + } + return len(v.Mountpoint) +} + // Exists scans mountpaths for specified device and returns true if path is one of the // mountpaths. ErrEnoent may be retuned if the device is not found func (m *Matrix) Exists(devPath string, path string) (bool, error) {
add function to determine runtime device mounts
libopenstorage_openstorage
train
go
9d321591253e764d895b96173aef24dbeb449bf7
diff --git a/src/main/java/com/github/steveice10/opennbt/NBTIO.java b/src/main/java/com/github/steveice10/opennbt/NBTIO.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/steveice10/opennbt/NBTIO.java +++ b/src/main/java/com/github/steveice10/opennbt/NBTIO.java @@ -225,9 +225,13 @@ public class NBTIO { * @throws java.io.IOException If an I/O error occurs. */ public static void writeTag(DataOutput out, Tag tag) throws IOException { - out.writeByte(TagRegistry.getIdFor(tag.getClass())); - out.writeUTF(tag.getName()); - tag.write(out); + if(tag != null) { + out.writeByte(TagRegistry.getIdFor(tag.getClass())); + out.writeUTF(tag.getName()); + tag.write(out); + } else { + out.writeByte(0); + } } private static class LittleEndianDataInputStream extends FilterInputStream implements DataInput {
Treat null as end tag in writeTag to match readTag.
Steveice10_OpenNBT
train
java
8e82745aeddeade05bb857d54972e7b0190c1266
diff --git a/lib/accesslib.php b/lib/accesslib.php index <HASH>..<HASH> 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -1035,6 +1035,8 @@ function load_all_capabilities() { return; } + unset($USER->mycourses); // Reset a cache used by get_my_courses + load_user_capability(); // Load basic capabilities assigned to this user if ($USER->username == 'guest') { diff --git a/lib/datalib.php b/lib/datalib.php index <HASH>..<HASH> 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -683,6 +683,14 @@ function get_courses_page($categoryid="all", $sort="c.sortorder ASC", $fields="c */ function get_my_courses($userid, $sort='visible DESC,sortorder ASC', $fields='*', $doanything=false,$limit=0) { + global $USER; + + if (!empty($USER->id) && ($USER->id == $userid)) { + if (!empty($USER->mycourses)) { + return $USER->mycourses; // Just return the cached version + } + } + $mycourses = array(); // Fix fields to refer to the course table c
A little bit of caching for get_my_courses, related to MDL-<I> Resetting it in load_all_capabilities() means it gets flushed everytime role_assign() or role_unassign() is called on the current user, which should be enough. The cache is not reset when others assign/unassign roles, but Moodle has always had this problem.
moodle_moodle
train
php,php
81a1e92cee0a305100a9cf61bcfe14ab0f8d655c
diff --git a/src/PhpGitHooks/Command/QualityCodeTool.php b/src/PhpGitHooks/Command/QualityCodeTool.php index <HASH>..<HASH> 100644 --- a/src/PhpGitHooks/Command/QualityCodeTool.php +++ b/src/PhpGitHooks/Command/QualityCodeTool.php @@ -31,8 +31,6 @@ class QualityCodeTool extends Application private $files; /** @var Container */ private $container; -// /** @var array */ -// private $configData; /** @var OutputTitleHandler */ private $outputTitleHandler; /** @var PreCommitConfig */ @@ -57,8 +55,6 @@ class QualityCodeTool extends Application $this->output = $output; $this->output->writeln('<fg=white;options=bold;bg=red>Pre-commit tool</fg=white;options=bold;bg=red>'); - -// $this->setconfigData(); $this->extractCommitedFiles(); if ($this->isProcessingAnyPhpFile()) { @@ -91,11 +87,6 @@ class QualityCodeTool extends Application $this->output->writeln($this->outputTitleHandler->getSuccessfulStepMessage($result)); } -// private function setconfigData() -// { -// $this->configData = $this->container->get('config.file')->getPreCommitConfiguration(); -// } - /** * @return bool */
Delete configData and setConfigData
bruli_php-git-hooks
train
php
3504c1adb48937e0419befe01bea905ff30d0de5
diff --git a/sports/subseason.js b/sports/subseason.js index <HASH>..<HASH> 100644 --- a/sports/subseason.js +++ b/sports/subseason.js @@ -46,6 +46,11 @@ module.exports = function(ngin) { standingsPreference: function(callback) { return ngin.StandingsPreference.create({subseason_id: this.id}).fetch(callback) + }, + + teams: function(callback) { + var url = this.urlRoot() + '/' + this.id + '/teams' + return ngin.TeamInstance.list({url:url}, callback) } })
added teams method to subseason that fetches team instances
sportngin_ngin_client_node
train
js
ac76a40a6156603fa436f1fe173835cff5fb0c3d
diff --git a/packages/embark-ui/src/components/ContractOverview.js b/packages/embark-ui/src/components/ContractOverview.js index <HASH>..<HASH> 100644 --- a/packages/embark-ui/src/components/ContractOverview.js +++ b/packages/embark-ui/src/components/ContractOverview.js @@ -133,6 +133,17 @@ class ContractFunction extends Component { ); } + formatResult(result) { + result = JSON.stringify(result); + if (result.startsWith('"')) { + result = result.slice(1); + } + if (result.endsWith('"')) { + result = result.slice(0, -1); + } + return result; + } + render() { if (ContractFunction.isEvent(this.props.method)) { return <React.Fragment/>; @@ -244,7 +255,7 @@ class ContractFunction extends Component { Result: &nbsp; <strong> <span className="contract-function-result"> - {JSON.stringify(contractFunction.result).slice(1, -1)} + {this.formatResult(contractFunction.result)} </span> </strong> </ListGroupItem>
fix(@cockpit/explorer): slice contract function result string only if starts/ends with double-quote Closes #<I>.
embark-framework_embark
train
js
9e7c8b66f44fc32c25ca7c80b45e744d9e3c1bac
diff --git a/packages/cozy-konnector-libs/src/libs/saveFiles.js b/packages/cozy-konnector-libs/src/libs/saveFiles.js index <HASH>..<HASH> 100644 --- a/packages/cozy-konnector-libs/src/libs/saveFiles.js +++ b/packages/cozy-konnector-libs/src/libs/saveFiles.js @@ -205,9 +205,8 @@ module.exports = async (entries, fields, options = {}) => { if (err.message !== 'TIMEOUT') throw err }) .then(entries => { - const logType = savedFiles ? 'info' : 'warn' log( - logType, + 'info', `saveFiles created ${savedFiles} files for ${entries.length} entries` ) return entries
fix (saveFiles): no more warning when no file is downloaded Now the real number of downloaded file is displayed
konnectors_libs
train
js
4e6cb05d4cbeda98198572eb6877766df945178b
diff --git a/conu/backend/origin/backend.py b/conu/backend/origin/backend.py index <HASH>..<HASH> 100644 --- a/conu/backend/origin/backend.py +++ b/conu/backend/origin/backend.py @@ -108,7 +108,7 @@ class OpenshiftBackend(K8sBackend): # app name is generated randomly random_string = ''.join( random.choice(string.ascii_lowercase + string.digits) for _ in range(4)) - name = 'app-{image}-{random_string}'.format(image=image.name, random_string=random_string) + name = 'app-{random_string}'.format(image=image.name, random_string=random_string) oc_new_app_args = oc_new_app_args or [] @@ -138,7 +138,7 @@ class OpenshiftBackend(K8sBackend): if os.path.isdir(source): c = self._oc_command(["start-build"] + [name] + ["--from-dir=%s" % source]) - logger.info("Build application from local source in project %s" % project) + logger.info("Build application from local source in project %s", project) try: o = run_cmd(c, return_output=True)
change app name back bacause of unsupported chars
user-cont_conu
train
py
a025db2a16f94955cf5c1dd5cf874eb8b0099f1d
diff --git a/vendor/plugins/pages/app/controllers/pages_controller.rb b/vendor/plugins/pages/app/controllers/pages_controller.rb index <HASH>..<HASH> 100644 --- a/vendor/plugins/pages/app/controllers/pages_controller.rb +++ b/vendor/plugins/pages/app/controllers/pages_controller.rb @@ -29,7 +29,9 @@ class PagesController < ApplicationController Page.find(params[:id], :include => [:parts, :slugs]) end - if @page.try(:live?) or (logged_in? and current_user.authorized_plugins.include?("Pages")) + if @page.try(:live?) or + (refinery_user? and + current_user.authorized_plugins.include?("refinery_pages")) # if the admin wants this to be a "placeholder" page which goes to its first child, go to that instead. if @page.skip_to_first_child first_live_child = @page.children.find_by_draft(false, :order => "position ASC")
Plugin's name is now refinery_pages
refinery_refinerycms
train
rb
76c5f6b0b801f96ab952dc5134cc2d101cea7995
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ license: GNU-GPL2 from setuptools import setup setup(name='consoleprinter', - version='41', + version='42', description='Console printer with linenumbers, stacktraces, logging, conversions and coloring..', url='https://github.com/erikdejonge/consoleprinter', author='Erik de Jonge',
pip Monday <I> April <I> (week:<I> day:<I>), <I>:<I>:<I>
erikdejonge_consoleprinter
train
py
cd388a96704a4842b5bae1c67ceef703b7dda8c3
diff --git a/convertbng/util.py b/convertbng/util.py index <HASH>..<HASH> 100644 --- a/convertbng/util.py +++ b/convertbng/util.py @@ -34,6 +34,7 @@ from sys import platform from array import array import numpy as np import os +from subprocess import check_output if platform == "darwin": prefix = 'lib' @@ -51,7 +52,12 @@ __version__ = "0.4.24" file_path = os.path.dirname(__file__) prefix = {'win32': ''}.get(platform, 'lib') extension = {'darwin': '.dylib', 'win32': '.dll'}.get(platform, '.so') -lib = cdll.LoadLibrary(os.path.join(file_path, prefix + "lonlat_bng" + extension)) +try: + lib = cdll.LoadLibrary(os.path.join(file_path, prefix + "lonlat_bng" + extension)) +except OSError: + # the Rust lib's been grafted by manylinux1 + fname = check_output(["ls", ".libs"]).split()[0] + lib = cdll.LoadLibrary(os.path.join(file_path, ".libs", fname)) class _FFIArray(Structure):
Account for manylinux1 moving and renaming .so
urschrei_convertbng
train
py
4d51e866ed637966ac6e34013892d623c9479e21
diff --git a/examples/simple_reader_cellpy.py b/examples/simple_reader_cellpy.py index <HASH>..<HASH> 100644 --- a/examples/simple_reader_cellpy.py +++ b/examples/simple_reader_cellpy.py @@ -9,7 +9,12 @@ import sys import matplotlib.pyplot as plt -from cellpy import cellreader, prmreader +from cellpy import cellreader + +# from cellpy import prmreader, log + +# log.setup_logging(default_level="DEBUG") +# prmreader.info() print("still alive so I guess all the needed modules are installed") @@ -33,7 +38,11 @@ rawfiles = [os.path.join(rawdir, f) for f in files] print("\n", "your files".center(80, "-")) for f in rawfiles: - print(f) + exists = "OK" + if not os.path.isfile(f): + exists = "NOT FOUND" + print(f"{f} {exists}") + print(80*"-") d = cellreader.CellpyData().from_raw(rawfiles)
add a bit of printing in the simple example script
jepegit_cellpy
train
py
0f45f28838683f37ee8505652b8080e650780fca
diff --git a/core/src/main/java/com/graphhopper/util/Constants.java b/core/src/main/java/com/graphhopper/util/Constants.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/graphhopper/util/Constants.java +++ b/core/src/main/java/com/graphhopper/util/Constants.java @@ -51,7 +51,7 @@ public class Constants public static final String OS_VERSION = System.getProperty("os.version"); public static final String JAVA_VENDOR = System.getProperty("java.vendor"); public static final int VERSION_NODE = 3; - public static final int VERSION_EDGE = 9; + public static final int VERSION_EDGE = 10; public static final int VERSION_GEOMETRY = 3; public static final int VERSION_LOCATION_IDX = 2; public static final int VERSION_NAME_IDX = 2;
necessary edge counter increase as shortcuts have different weight value, #<I>
graphhopper_graphhopper
train
java
99668eabe2f69c24ec294aa86a5a2270edf9e657
diff --git a/lib/responsys_api.rb b/lib/responsys_api.rb index <HASH>..<HASH> 100644 --- a/lib/responsys_api.rb +++ b/lib/responsys_api.rb @@ -1,6 +1,6 @@ require "i18n" -I18n.load_path = ["lib/responsys/i18n/en.yml"] +I18n.load_path = ["#{File.dirname(__FILE__)}/responsys/i18n/en.yml"] I18n.locale = :en I18n.enforce_available_locales = false
[BUG] Fixed the i<I>n load path to be compatible with a Rails env
dandemeyere_responsys-api
train
rb
7277d32e29daaee3863c8b884ab25c2c30212927
diff --git a/lib/endpoints/class-wp-rest-posts-controller.php b/lib/endpoints/class-wp-rest-posts-controller.php index <HASH>..<HASH> 100755 --- a/lib/endpoints/class-wp-rest-posts-controller.php +++ b/lib/endpoints/class-wp-rest-posts-controller.php @@ -53,6 +53,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { 'args' => array( 'force' => array( 'default' => false, + 'description' => __( 'Whether to bypass trash and force deletion.' ) ), ), ),
Add a helpful description for force deleting posts
WP-API_WP-API
train
php
088e15f34985a40b4e495c517d62231beb3721e3
diff --git a/core/src/main/java/org/testcontainers/containers/DockerComposeContainer.java b/core/src/main/java/org/testcontainers/containers/DockerComposeContainer.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/testcontainers/containers/DockerComposeContainer.java +++ b/core/src/main/java/org/testcontainers/containers/DockerComposeContainer.java @@ -270,7 +270,7 @@ public class DockerComposeContainer<SELF extends DockerComposeContainer<SELF>> e class DockerCompose extends GenericContainer<DockerCompose> { public DockerCompose(File composeFile, String identifier) { - super("dduportal/docker-compose:1.7.1"); + super("docker/compose:1.8.0"); addEnv("COMPOSE_PROJECT_NAME", identifier); // Map the docker compose file into the container addEnv("COMPOSE_FILE", "/compose/" + composeFile.getAbsoluteFile().getName());
refactor: replace compose container image dduportal/docker-compose:<I> with the official docker/compose:<I>
testcontainers_testcontainers-java
train
java
abb76790cb305c56abd4dbd46c417c3aeec5dec9
diff --git a/respond.src.js b/respond.src.js index <HASH>..<HASH> 100644 --- a/respond.src.js +++ b/respond.src.js @@ -10,7 +10,8 @@ var doc = win.document, docElem = doc.documentElement, mediastyles = [], - resizeThrottle = 50, + parsedSheets = [], + resizeThrottle = 0, head = doc.getElementsByTagName( "head" )[0] || docElem, links = head.getElementsByTagName( "link" ), //loop stylesheets, send text content to translateQueries @@ -19,10 +20,23 @@ sl = sheets.length; for( var i = 0; i < sl; i++ ){ - var href = sheets[ i ].href; - ajax( href, function( styles ){ - translateQueries( styles, href ); - } ); + var sheet = sheets[ i ], + href = sheet.href, + parsed = false; + + //prevent re-parsing when ripCSS is re-called + for( var i in parsedSheets ){ + if( parsedSheets[ i ] === sheet ){ + parsed = true; + } + } + + if( !parsed ){ + ajax( href, function( styles ){ + translateQueries( styles, href ); + parsedSheets.push( sheet ); + } ); + } } }, //find media blocks in css text, convert to style blocks
added a check to ensure a stylesheet is never re-requested, which will be important when re-running the loop.
scottjehl_Respond
train
js
1160d2219f611fc166549d0baad5f87aabbb9049
diff --git a/grimoire_elk/ocean/nntp.py b/grimoire_elk/ocean/nntp.py index <HASH>..<HASH> 100644 --- a/grimoire_elk/ocean/nntp.py +++ b/grimoire_elk/ocean/nntp.py @@ -37,7 +37,7 @@ class Mapping(BaseMapping): :returns: dictionary with a key, 'items', with the mapping """ - if es_major != 2: + if es_major != '2': mapping = ''' { "dynamic":true, @@ -66,7 +66,7 @@ class Mapping(BaseMapping): "properties": { "Subject": { "type": "string", - "index": "analyzed + "index": "analyzed" }, "body": { "dynamic":false,
[ocean] Modify check to detect ES version for NNTP connector This patch modifies the if condition used to detect the ElasticSearch version.
chaoss_grimoirelab-elk
train
py
86b2c3cffdbf3e1378aa79b9b313a6df11d656d2
diff --git a/modules/components/Form.js b/modules/components/Form.js index <HASH>..<HASH> 100644 --- a/modules/components/Form.js +++ b/modules/components/Form.js @@ -134,7 +134,6 @@ class Form extends Component { onChange, data, state, - initialFields, initForm, updateField, updateState,
Remove initialFields change from branch
rofrischmann_react-controlled-form
train
js
b4e0967242bc6dda9d22af53ee5c4aa4d4615ac6
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -8,7 +8,7 @@ module.exports = function(grunt) { // configure grunt grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), - buildpath: 'dist/<%= pkg.version %>', + buildpath: 'dist', temppath: '<%= buildpath %>/temp', files: { cat: 'jquery.powertip-<%= pkg.version %>.js',
Changed grunt buildpath to be unversioned.
stevenbenner_jquery-powertip
train
js
83f63c5f6a7220ed50c19a482725f3b93cb254e5
diff --git a/shinken/modules/hot_dependencies_arbiter.py b/shinken/modules/hot_dependencies_arbiter.py index <HASH>..<HASH> 100644 --- a/shinken/modules/hot_dependencies_arbiter.py +++ b/shinken/modules/hot_dependencies_arbiter.py @@ -61,6 +61,7 @@ class Hot_dependencies_arbiter: #Called by Arbiter to say 'let's prepare yourself guy' def init(self): print "I open the HOT dependency module" + # Remember what we add def get_name(self): @@ -86,5 +87,9 @@ class Hot_dependencies_arbiter: father = arb.hosts.find_by_name(father_name) if son != None and father != None: print "finded!", son_name, father_name + if not son.is_linked_with_host(father): + print "Doing simple link between", son.get_name(), 'and', father.get_name() + # Add a dep link between the son and the father + son.add_host_act_dependancy(father, ['w', 'u', 'd'], None, True) else: print "Missing one of", son_name, father_name
Add : at hot dep launch, really create hosts connexions
Alignak-monitoring_alignak
train
py
2654ee2f8cd37427c6271825e0a1c1f6be29e130
diff --git a/src/Gaufrette/Adapter/RackspaceCloudfiles.php b/src/Gaufrette/Adapter/RackspaceCloudfiles.php index <HASH>..<HASH> 100644 --- a/src/Gaufrette/Adapter/RackspaceCloudfiles.php +++ b/src/Gaufrette/Adapter/RackspaceCloudfiles.php @@ -129,7 +129,7 @@ class RackspaceCloudfiles extends Base protected function tryGetObject($key) { try { - return $this->container->getObject($key); + return $this->container->get_object($key); } catch (\NoSuchObjectException $e) { // the NoSuchObjectException is thrown by the CF_Object during it's // creation if the object doesn't exist
Typo in tryGetObject. Fatal error: Call to undefined method CF_Container::getObject().
KnpLabs_Gaufrette
train
php
d16e8f62db08411d7e1ec96abb6dbba7f8e91262
diff --git a/server.js b/server.js index <HASH>..<HASH> 100644 --- a/server.js +++ b/server.js @@ -158,8 +158,8 @@ var minAccuracy = 0.75; // = 1 - max(1, df) / rf var freqRatioMax = 1 - minAccuracy; -// Request cache size of 50MB (~5000 bytes/image). -var requestCache = new LruCache(0); // 10000 +// Request cache size of 5MB (~5000 bytes/image). +var requestCache = new LruCache(1000); // Deep error handling for vendor hooks. var vendorDomain = domain.create();
Re-enable server cache The hope is that having only one server (HTTP, instead of HTTP + HTTPS) would be enough to relieve the server of the stress it experiences memory-wise. While there was a crash a week with two servers, there was only one crash in a month since the switch, and the server was immediately restarted.
badges_shields
train
js
854481c7634ad6a2f80d0270e95b66367a90ecd8
diff --git a/repo_modules/ui/component.js b/repo_modules/ui/component.js index <HASH>..<HASH> 100644 --- a/repo_modules/ui/component.js +++ b/repo_modules/ui/component.js @@ -29,7 +29,7 @@ Component.addDecorator(spec => { { componentProps(componentName) { return { - id: this._uniqueID, + id: componentName ? this._uniqueID + componentName : this._uniqueID, ref: componentName || spec.name, className: this.getClasses(componentName), styles: this.getStyles(componentName) diff --git a/repo_modules/ui/lib/mixins/Identified.js b/repo_modules/ui/lib/mixins/Identified.js index <HASH>..<HASH> 100644 --- a/repo_modules/ui/lib/mixins/Identified.js +++ b/repo_modules/ui/lib/mixins/Identified.js @@ -3,6 +3,6 @@ var uniqueID = () => i++ % 1000000; module.exports = { componentWillMount() { - this._uniqueID = `component-${uniqueID()}`; + this._uniqueID = `ui-${uniqueID()}`; } }; \ No newline at end of file
unique ids should really be unique
reapp_reapp-ui
train
js,js
171ae7c749dbf57ef59f933d049efef419c8fe3d
diff --git a/heartbeat/heartbeat.py b/heartbeat/heartbeat.py index <HASH>..<HASH> 100644 --- a/heartbeat/heartbeat.py +++ b/heartbeat/heartbeat.py @@ -39,7 +39,7 @@ class Heartbeat(object): so Node A can verify that Node B has a specified file. """ - def __init__(self, file_path): + def __init__(self, filepath): # Check if the file exists if os.path.isfile(file_path): self.file_size = os.path.getsize(file_path)
Change method signature by renaming file_path to filepath
StorjOld_heartbeat
train
py
5ecd9ace593992aa0cd7523abeafa51242c5e4fd
diff --git a/src/Composer/Command/OutdatedCommand.php b/src/Composer/Command/OutdatedCommand.php index <HASH>..<HASH> 100644 --- a/src/Composer/Command/OutdatedCommand.php +++ b/src/Composer/Command/OutdatedCommand.php @@ -34,6 +34,7 @@ class OutdatedCommand extends ShowCommand new InputOption('all', 'a', InputOption::VALUE_NONE, 'Show all installed packages with their latest versions'), new InputOption('direct', 'D', InputOption::VALUE_NONE, 'Shows only packages that are directly required by the root package'), new InputOption('strict', null, InputOption::VALUE_NONE, 'Return a non-zero exit code when there are outdated packages'), + new InputOption('minor-only', 'm', InputOption::VALUE_NONE, 'Show only packages that have minor SemVer-compatible updates. Use with the --outdated option.'), )) ->setHelp(<<<EOT The outdated command is just a proxy for `composer show -l` @@ -70,6 +71,9 @@ EOT if ($input->getOption('strict')) { $args['--strict'] = true; } + if ($input->getOption('minor-only')) { + $args['--minor-only'] = true; + } $input = new ArrayInput($args);
Forward --minor-only flag to show command
composer_composer
train
php
98d57500f26a2d0bb6d584ad4fe602a333403719
diff --git a/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php b/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php @@ -1066,4 +1066,13 @@ class HttpCacheTest extends HttpCacheTestCase array('10.0.0.2, 10.0.0.3', '10.0.0.2, 10.0.0.3, 10.0.0.1'), ); } + + public function testXForwarderForHeaderForPassRequests() + { + $this->setNextResponse(); + $server = array('REMOTE_ADDR' => '10.0.0.1'); + $this->request('POST', '/', $server); + + $this->assertEquals('10.0.0.1', $this->kernel->getBackendRequest()->headers->get('X-Forwarded-For')); + } }
[HttpKernel] added some tests for previous merge
symfony_symfony
train
php
45f381a20041b7fdb12440f24c64147eb7d129b4
diff --git a/src/require_context.js b/src/require_context.js index <HASH>..<HASH> 100644 --- a/src/require_context.js +++ b/src/require_context.js @@ -7,7 +7,7 @@ function requireModules(keys, root, directory, regExp, recursive) { const files = fs.readdirSync(path.join(root, directory)); files.forEach((filename) => { - if (regExp.test(filename)) { + if (regExp.test(path.join(directory, filename))) { // webpack adds a './' to the begining of the key // TODO: Check this in windows const entryKey = `./${path.join(directory, filename)}`;
Test regex for the whole path instead of just the filename Should fix #<I>
storybook-eol_storyshots
train
js
6fb46bb1d5f852bdfc4be7aba813f48464c4844e
diff --git a/src/Reader.js b/src/Reader.js index <HASH>..<HASH> 100644 --- a/src/Reader.js +++ b/src/Reader.js @@ -43,13 +43,6 @@ Reader.open = function(file, cb){ Reader.openSync = Reader; -Reader.prototype.destroy = function(){ - this._buf = null; - this._pointerCache = null; - this.metadata = null; - this.ip = null; -}; - Reader.prototype.setup = function(){ var metaPosition = this.findMetaPosition(); this.metadata = this.readData(metaPosition).value; diff --git a/test/memory-test.js b/test/memory-test.js index <HASH>..<HASH> 100644 --- a/test/memory-test.js +++ b/test/memory-test.js @@ -23,13 +23,13 @@ console.log('Initial RSS: %s', start.rss); var num = 5000; // TEST DESTROY -console.log('\nTesting destroying...'); +console.log('\nTesting cleanup...'); -// Do a few loops of loading lots of stuff into mem and getting rid of it +// Do a few loops of loading lots of stuff into mem and chucking it away for(var j = 0; j < 10; j += 1){ - readers.forEach(function(r){ r.destroy(); }); + readers = []; gc();
On reflection, destroy is unclean. Just make sure nothing gets left around when a reader instance is unref'd
gosquared_mmdb-reader
train
js,js
f61a79175366c54b305df90bfb88095ac43fb465
diff --git a/wookmark.js b/wookmark.js index <HASH>..<HASH> 100644 --- a/wookmark.js +++ b/wookmark.js @@ -780,4 +780,4 @@ window.Wookmark = Wookmark; return Wookmark; })); -})(jQuery); +})(window.jQuery);
BUGFIX: Prevent error when jQuery is missing
germanysbestkeptsecret_Wookmark-jQuery
train
js
9a69b2cf08f11d58ba5e53e540b96b8f4ce5072d
diff --git a/src/event.js b/src/event.js index <HASH>..<HASH> 100644 --- a/src/event.js +++ b/src/event.js @@ -575,7 +575,6 @@ jQuery.each({ blur: "focusout" }, function( orig, fix ){ var event = jQuery.event, - special = event.special, handle = event.handle; function ieHandler() { @@ -583,18 +582,18 @@ jQuery.each({ return handle.apply(this, arguments); } - special[orig] = { + event.special[orig] = { setup:function() { if ( this.addEventListener ) this.addEventListener( orig, handle, true ); else - jQuery.event.add( this, fix, ieHandler ); + event.add( this, fix, ieHandler ); }, teardown:function() { if ( this.removeEventListener ) this.removeEventListener( orig, handle, true ); else - jQuery.event.remove( this, fix, ieHandler ); + event.remove( this, fix, ieHandler ); } }; });
Cleanup bubbling focus and blur events - Use cached event instead of jQuery.event - Do not cache event.special if you use it only once
jquery_jquery
train
js
7a0d74ee5ba30efd0f470654d6a54ec2f067757c
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -7,10 +7,10 @@ var visitCombyne = require('visit-combyne'); var extendsCache = {}; var extensions = { - html: 1, - cmb: 1, - cmbn: 1, - combyne: 1, + '.html': 1, + '.cmb': 1, + '.cmbn': 1, + '.combyne': 1, }; var processTemplate = function(templateSource, settings, callback) { @@ -94,12 +94,21 @@ var processTemplate = function(templateSource, settings, callback) { }; function combynify(file, settings) { - if (settings.extension && path.extname(file) !== settings.extension) { + var fileExtension = path.extname(file); + + // Ignore file if it does not match the specified file extension + if (settings.extension && fileExtension !== settings.extension) { return through(); } - else if (!extensions[file.split('.').pop()]) { + // Ignore file if it does not match any default supported file extensions + else if (!extensions[fileExtension]) { return through(); } + // If no extension was provided, but file matches one of the default + // supported extensions, use that setting for any nested partials + else if (!settings.extension) { + settings.extension = fileExtension; + } settings = settings || {};
Assume the same extension for partials as for the parent template
chesles_combynify
train
js
79e3ca77e0bcd11ffa670d042aef50fcc25c9b65
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb index <HASH>..<HASH> 100644 --- a/lib/chef/knife/bootstrap.rb +++ b/lib/chef/knife/bootstrap.rb @@ -18,11 +18,6 @@ require "chef/knife" require "chef/knife/data_bag_secret_options" -require "erubis" -require "chef/knife/bootstrap/chef_vault_handler" -require "chef/knife/bootstrap/client_builder" -require "chef/util/path_helper" -require "chef/dist" class Chef class Knife @@ -390,7 +385,13 @@ class Chef attr_reader :connection deps do + require "erubis" + require "chef/json_compat" + require "chef/util/path_helper" + require "chef/knife/bootstrap/chef_vault_handler" + require "chef/knife/bootstrap/client_builder" + require "chef/knife/bootstrap/train_connector" end banner "knife bootstrap [PROTOCOL://][USER@]FQDN (options)" @@ -623,8 +624,6 @@ class Chef end def do_connect(conn_options) - require "chef/knife/bootstrap/train_connector" - @connection = TrainConnector.new(host_descriptor, connection_protocol, conn_options) connection.connect! end
Move most bootstrap requires into deps()
chef_chef
train
rb
387c98bd2c5dfca6f94e0b164aae12768bdb2c1e
diff --git a/flask_fedora_commons/__init__.py b/flask_fedora_commons/__init__.py index <HASH>..<HASH> 100644 --- a/flask_fedora_commons/__init__.py +++ b/flask_fedora_commons/__init__.py @@ -557,6 +557,28 @@ class Repository(object): process_namespace(str(rdflib.OWL), 'owl') + def sparql(self, statement, accept_format='text/csv'): + """Method takes and executes a generic SPARQL statement and returns + the result. NOTE: The Fedora 4 supports a limited subset of SPARQL, + see <https://wiki.duraspace.org/display/FF/RESTful+HTTP+API+-+Search#RESTfulHTTPAPI-Search-SPARQLEndpoint> + for more information. + + Args: + statement(string): SPARQL statement + accept_format(string): Format for output, defaults to text/csv + + Returns: + result(string): Raw decoded string of the result from executing the + SPARQL statement + """ + request = urllib.request.Request( + '/'.join([self.base_url, 'rest', 'fcr:sparql']), + data=statement.encode(), + headers={"Context-Type": "application/sparql-query", + "Accept": accept_format}) + result = urllib.request.urlopen(request) + return result.read().decode() +
added sparql endpoint (not working yet
jermnelson_flask-fedora-commons
train
py
dfd3e99dece2a3fc8daf3eeff0486ed63efc34c2
diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -60,12 +60,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.3.5'; - const VERSION_ID = '20305'; + const VERSION = '2.3.6-DEV'; + const VERSION_ID = '20306'; const MAJOR_VERSION = '2'; const MINOR_VERSION = '3'; - const RELEASE_VERSION = '5'; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = '6'; + const EXTRA_VERSION = 'DEV'; /** * Constructor.
bumped Symfony version to <I>
symfony_symfony
train
php
e9553e6fc7db8115075052c19965c4a504dda4d5
diff --git a/lib/fog/storage/requests/hp/put_container.rb b/lib/fog/storage/requests/hp/put_container.rb index <HASH>..<HASH> 100644 --- a/lib/fog/storage/requests/hp/put_container.rb +++ b/lib/fog/storage/requests/hp/put_container.rb @@ -8,9 +8,10 @@ module Fog # ==== Parameters # * name<~String> - Name for container, should be < 256 bytes and must not contain '/' # - def put_container(name) + def put_container(name, options = {}) response = request( :expects => [201, 202], + :headers => options, :method => 'PUT', :path => URI.escape(name) )
Add a options hash so that headers can be passed in to set acls.
fog_fog
train
rb
5195202a33a2899536bf0ec56414832e5c2dab18
diff --git a/tests/test_main.py b/tests/test_main.py index <HASH>..<HASH> 100755 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -3215,8 +3215,10 @@ def test_grand_crusader(): assert len(game.player1.hand) == 1 crusader.play() assert len(game.player1.hand) == 1 - assert game.player1.hand[0].card_class == CardClass.PALADIN - assert game.player1.hand[0].data.collectible + card = game.player1.hand[0] + assert card.card_class == CardClass.PALADIN + assert card.data.collectible + assert card.type != CardType.HERO def test_grimscale_oracle(): @@ -6024,7 +6026,9 @@ def test_burgle(): burgle.play() assert len(game.player1.hand) == 2 assert game.player1.hand[0].card_class == game.player2.hero.card_class + assert game.player1.hand[0].type != CardType.HERO assert game.player1.hand[1].card_class == game.player2.hero.card_class + assert game.player1.hand[1].type != CardType.HERO def main():
Add tests for Grand Crusader and Burgle to ensure no heroes are created
jleclanche_fireplace
train
py
3cb25c06ea5bd58a1ff712a3b8167f624171e625
diff --git a/timeside/server/management/commands/timeside-import-items.py b/timeside/server/management/commands/timeside-import-items.py index <HASH>..<HASH> 100644 --- a/timeside/server/management/commands/timeside-import-items.py +++ b/timeside/server/management/commands/timeside-import-items.py @@ -31,7 +31,7 @@ class Command(BaseCommand): selection, c = Selection.objects.get_or_create(title=selection_title) if c: - print 'Selection "' + selection_title + '" created' + print('Selection "' + selection_title + '" created') for root, dirs, files in os.walk(import_dir): for filename in files: @@ -42,7 +42,7 @@ class Command(BaseCommand): title = unicode(selection_title + '_' + filename) item, c = Item.objects.get_or_create(title=title, source_file=relpath) if c: - print 'Item "' + title + '" created' + print('Item "' + title + '" created') if not item in selection.items.all(): selection.items.add(item) - print 'Item "' + title + '" added to selection "' + selection_title +'"' + print('Item "' + title + '" added to selection "' + selection_title +'"')
[server] use print() in timeside-import-items.py
Parisson_TimeSide
train
py
d650703c7ff6cf27708d981bdd9520e2abf6c6bc
diff --git a/Kwc/Form/Dynamic/Form/Component.php b/Kwc/Form/Dynamic/Form/Component.php index <HASH>..<HASH> 100644 --- a/Kwc/Form/Dynamic/Form/Component.php +++ b/Kwc/Form/Dynamic/Form/Component.php @@ -69,7 +69,7 @@ class Kwc_Form_Dynamic_Form_Component extends Kwc_Form_Component $msg = ''; foreach ($this->getData()->parent->getChildComponent('-paragraphs')->getRecursiveChildComponents(array('flags'=>array('formField'=>true))) as $c) { $f = $c->getComponent()->getFormField(); - if ($f->getName() && ($f->getFieldLabel() || $f instanceof Kwf_Form_Field_Checkbox)) { + if ($f->getName()) { if ($f instanceof Kwf_Form_Field_File) { $uploadRow = $row->getParentRow($f->getName()); if ($uploadRow) {
also include fields without label in mail text it never makes sense to have fields /not/ in message
koala-framework_koala-framework
train
php
f0badc7036dbe9039fdb4ad852313cbd31a1e74b
diff --git a/src/Task/PhpCsAutoFixerV2.php b/src/Task/PhpCsAutoFixerV2.php index <HASH>..<HASH> 100644 --- a/src/Task/PhpCsAutoFixerV2.php +++ b/src/Task/PhpCsAutoFixerV2.php @@ -83,6 +83,7 @@ class PhpCsAutoFixerV2 extends PhpCsFixerV2 $arguments->addOptionalArgument('--verbose', $config['verbose']); $arguments->addOptionalArgument('--diff', $config['diff']); $arguments->addOptionalArgument('--dry-run', $dryRun); + $arguments->add('fix'); return $arguments; }
Bugfix: Forgot to enable fixing
wearejust_grumphp-extra-tasks
train
php
dc5cd438cdb318dc35a1b371e82ca05fe5f1d0f2
diff --git a/src/ol/geom/SimpleGeometry.js b/src/ol/geom/SimpleGeometry.js index <HASH>..<HASH> 100644 --- a/src/ol/geom/SimpleGeometry.js +++ b/src/ol/geom/SimpleGeometry.js @@ -48,10 +48,9 @@ inherits(SimpleGeometry, Geometry); /** * @param {number} stride Stride. - * @private * @return {ol.geom.GeometryLayout} layout Layout. */ -SimpleGeometry.getLayoutForStride_ = function(stride) { +function getLayoutForStride(stride) { var layout; if (stride == 2) { layout = GeometryLayout.XY; @@ -61,7 +60,7 @@ SimpleGeometry.getLayoutForStride_ = function(stride) { layout = GeometryLayout.XYZM; } return /** @type {ol.geom.GeometryLayout} */ (layout); -}; +} /** @@ -242,7 +241,7 @@ SimpleGeometry.prototype.setLayout = function(layout, coordinates, nesting) { } } stride = coordinates.length; - layout = SimpleGeometry.getLayoutForStride_(stride); + layout = getLayoutForStride(stride); } this.layout = layout; this.stride = stride;
Don't store private function into SimpleGeometry class
openlayers_openlayers
train
js
cfb6f77ac0574d3cd613c99fcc32135016b4284c
diff --git a/activerecord/lib/active_record/associations/join_dependency/join_part.rb b/activerecord/lib/active_record/associations/join_dependency/join_part.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/associations/join_dependency/join_part.rb +++ b/activerecord/lib/active_record/associations/join_dependency/join_part.rb @@ -22,7 +22,7 @@ module ActiveRecord end def aliased_table - Arel::Nodes::TableAlias.new aliased_table_name, table + Arel::Nodes::TableAlias.new table, aliased_table_name end def ==(other)
TableAlias leg ordering has changed, so change accordingly
rails_rails
train
rb
31c7301f9a58e13d2d728fdbed4350d403de060a
diff --git a/app/addons/permissions/routes.js b/app/addons/permissions/routes.js index <HASH>..<HASH> 100644 --- a/app/addons/permissions/routes.js +++ b/app/addons/permissions/routes.js @@ -45,7 +45,8 @@ const PermissionsRouteObject = BaseRoute.extend({ { name: 'Permissions' } ]; - const url = FauxtonAPI.urls('permissions', 'server', databaseId); + const encodedDatabaseId = encodeURIComponent(databaseId); + const url = FauxtonAPI.urls('permissions', 'server', encodedDatabaseId); return <Layout docURL={FauxtonAPI.constants.DOC_URLS.DB_PERMISSION}
Encode database id in permissions (#<I>)
apache_couchdb-fauxton
train
js
e2abc3a3715367562f92503b9b4a0f9daac5b440
diff --git a/umap/umap_.py b/umap/umap_.py index <HASH>..<HASH> 100644 --- a/umap/umap_.py +++ b/umap/umap_.py @@ -6,7 +6,7 @@ from warnings import warn from scipy.optimize import curve_fit from sklearn.base import BaseEstimator -from sklearn.utils import check_random_state +from sklearn.utils import check_random_state, check_array import numpy as np import scipy.sparse @@ -1520,7 +1520,7 @@ class UMAP(BaseEstimator): """ # Handle other array dtypes (TODO: do this properly) - X = X.astype(np.float64) + X = check_array(X).astype(np.float64) random_state = check_random_state(self.random_state)
Fix dataframe not being recognised (issue #<I>)
lmcinnes_umap
train
py
81a32e147b74ba672bbcf974c97d080e279052dc
diff --git a/lib/irc.js b/lib/irc.js index <HASH>..<HASH> 100644 --- a/lib/irc.js +++ b/lib/irc.js @@ -11,6 +11,8 @@ function Bot() { logger.debug('Connecting to IRC'); this.client = new irc.Client(this.server, this.nickname, { + userName: this.nickname, + realName: this.nickname, channels: this.channels });
Set realname and username to IRC nickname
ekmartin_slack-irc
train
js
bb1decbca8b5b1dd34ae152a6f2ae6829b976292
diff --git a/astrobase/checkplot.py b/astrobase/checkplot.py index <HASH>..<HASH> 100644 --- a/astrobase/checkplot.py +++ b/astrobase/checkplot.py @@ -1443,11 +1443,11 @@ def _pkl_finder_objectinfo(objectinfo, plt.annotate('N%s' % nbrind, (annotatex, annotatey), xytext=(offx, offy), - arrowprops={'facecolor':'#d4ac0d', + arrowprops={'facecolor':'#117a65', 'width':2.0, - 'headwidth':0.0, - 'headlength':0.0}, - color='#d4ac0d') + 'headwidth':2.0, + 'headlength':2.0}, + color='#117a65') # # finish up the finder chart after neighbors are processed
lcproc: add neighbor stuff to parallel_cp workers and driver
waqasbhatti_astrobase
train
py
bd9b2b14deed47c8657490756349f50ef7bf83d4
diff --git a/h5sparse/h5sparse.py b/h5sparse/h5sparse.py index <HASH>..<HASH> 100644 --- a/h5sparse/h5sparse.py +++ b/h5sparse/h5sparse.py @@ -36,6 +36,9 @@ class Group(object): def __init__(self, h5py_group): self.h5py_group = h5py_group + def __contains__(self, item): + return self.h5py_group.__contains__(item) + def __getitem__(self, key): h5py_item = self.h5py_group[key] if isinstance(h5py_item, h5py.Group):
Enable "in" operator for Group
appier_h5sparse
train
py
5a8d416c022c5bc80614360295eb6835e6cd86da
diff --git a/library/src/main/java/com/getbase/android/db/loaders/SimpleCancellableFunction.java b/library/src/main/java/com/getbase/android/db/loaders/SimpleCancellableFunction.java index <HASH>..<HASH> 100644 --- a/library/src/main/java/com/getbase/android/db/loaders/SimpleCancellableFunction.java +++ b/library/src/main/java/com/getbase/android/db/loaders/SimpleCancellableFunction.java @@ -13,7 +13,8 @@ class SimpleCancellableFunction<TIn, TOut> implements CancellableFunction<TIn, T @Override public final TOut apply(TIn input, CancellationSignal signal) { + TOut result = transform.apply(input); signal.throwIfCanceled(); - return transform.apply(input); + return result; } }
Perform cancellation check after transformation - fix for cancellationsupport for all loaders
futuresimple_android-db-commons
train
java
46be046dac6fa5eec1ac44ffe4ae30952d716775
diff --git a/abydos/distance/_lcsseq.py b/abydos/distance/_lcsseq.py index <HASH>..<HASH> 100644 --- a/abydos/distance/_lcsseq.py +++ b/abydos/distance/_lcsseq.py @@ -49,7 +49,7 @@ class LCSseq(_Distance): """ def __init__(self, normalizer=max, **kwargs): - """Initialize LCSseq. + r"""Initialize LCSseq. Parameters ---------- diff --git a/abydos/distance/_lcsstr.py b/abydos/distance/_lcsstr.py index <HASH>..<HASH> 100644 --- a/abydos/distance/_lcsstr.py +++ b/abydos/distance/_lcsstr.py @@ -48,7 +48,7 @@ class LCSstr(_Distance): """ def __init__(self, normalizer=max, **kwargs): - """Initialize LCSseq. + r"""Initialize LCSseq. Parameters ----------
added r for strings with backslashes
chrislit_abydos
train
py,py
42b6e47382e32c48a89465b8e368de08d460090a
diff --git a/dev/io.openliberty.checkpoint/src/io/openliberty/checkpoint/internal/criu/DeployCheckpoint.java b/dev/io.openliberty.checkpoint/src/io/openliberty/checkpoint/internal/criu/DeployCheckpoint.java index <HASH>..<HASH> 100644 --- a/dev/io.openliberty.checkpoint/src/io/openliberty/checkpoint/internal/criu/DeployCheckpoint.java +++ b/dev/io.openliberty.checkpoint/src/io/openliberty/checkpoint/internal/criu/DeployCheckpoint.java @@ -10,10 +10,17 @@ *******************************************************************************/ package io.openliberty.checkpoint.internal.criu; +import java.security.AccessController; +import java.security.PrivilegedAction; + import io.openliberty.checkpoint.internal.CheckpointImpl; public class DeployCheckpoint { public static void checkpoint() { - CheckpointImpl.deployCheckpoint(); + PrivilegedAction<Void> deployCheckpoint = (PrivilegedAction<Void>) () -> { + CheckpointImpl.deployCheckpoint(); + return null; + }; + AccessController.doPrivileged(deployCheckpoint); } }
Protect app code from privileged operations during deployment checkpoint
OpenLiberty_open-liberty
train
java
6d71857dcfac70fd0cb1df23331895231feee326
diff --git a/pmagpy/ipmag.py b/pmagpy/ipmag.py index <HASH>..<HASH> 100755 --- a/pmagpy/ipmag.py +++ b/pmagpy/ipmag.py @@ -812,7 +812,8 @@ def common_mean_bootstrap(Data1, Data2, NumSims=1000, save=False, save_folder='. fignum = 1 fig = plt.figure(figsize=figsize) - fig = plt.subplot(1, 3, 1) + #fig = plt.subplot(1, 3, 1) + plt.subplot(1, 3, 1) minimum = int(0.025 * len(X1)) maximum = int(0.975 * len(X1)) diff --git a/pmagpy/version.py b/pmagpy/version.py index <HASH>..<HASH> 100755 --- a/pmagpy/version.py +++ b/pmagpy/version.py @@ -3,5 +3,5 @@ Module contains current pmagpy version number. Version number is displayed by GUIs and used by setuptools to assign number to pmagpy/pmagpy-cli. """ -"pmagpy-4.2.51" -version = 'pmagpy-4.2.51' +"pmagpy-4.2.52" +version = 'pmagpy-4.2.52'
modified: pmagpy/ipmag.py modified: pmagpy/version.py
PmagPy_PmagPy
train
py,py
f16ed06c2ca2ed247aa6f564bab23f03040e9f51
diff --git a/mod/quiz/report/statistics/report.php b/mod/quiz/report/statistics/report.php index <HASH>..<HASH> 100644 --- a/mod/quiz/report/statistics/report.php +++ b/mod/quiz/report/statistics/report.php @@ -54,6 +54,12 @@ class quiz_statistics_report extends quiz_default_report { $this->context = context_module::instance($cm->id); + if (!quiz_questions_in_quiz($quiz->questions)) { + $this->print_header_and_tabs($cm, $course, $quiz, 'statistics'); + echo quiz_no_questions_message($quiz, $cm, $this->context); + return true; + } + // Work out the display options. $download = optional_param('download', '', PARAM_ALPHA); $everything = optional_param('everything', 0, PARAM_BOOL); @@ -151,9 +157,7 @@ class quiz_statistics_report extends quiz_default_report { } } - if (!quiz_questions_in_quiz($quiz->questions)) { - echo quiz_no_questions_message($quiz, $cm, $this->context); - } else if (!$this->table->is_downloading() && $quizstats->s() == 0) { + if (!$this->table->is_downloading() && $quizstats->s() == 0) { echo $OUTPUT->notification(get_string('noattempts', 'quiz')); }
MDL-<I> exception when there are no questions
moodle_moodle
train
php
10b0825573bd39f5f43ed4d867bccd9cef277871
diff --git a/lib/stupidedi/contrib/002001/guides/SH856.rb b/lib/stupidedi/contrib/002001/guides/SH856.rb index <HASH>..<HASH> 100644 --- a/lib/stupidedi/contrib/002001/guides/SH856.rb +++ b/lib/stupidedi/contrib/002001/guides/SH856.rb @@ -31,7 +31,7 @@ module Stupidedi b::Element(e::Required, "Currency Code")), - d::TableDef.header("Detail", + d::TableDef.detail("Detail", d::LoopDef.build("HL", d::RepeatCount.bounded(1), b::Segment(50, s:: HL, "Hierarchical Level - Shipment Level", r::Situational, d::RepeatCount.unbounded,
replaced .header w/ .detail
irobayna_stupidedi
train
rb