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
27238c51d168b90cb9300da671fa5eabd4ac82d3
diff --git a/src/Plugin.php b/src/Plugin.php index <HASH>..<HASH> 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -83,8 +83,19 @@ class Plugin implements PluginInterface, EventSubscriberInterface $this->composer = $composer; if (null === $this->runonceManager) { + $rootDir = getcwd() . '/'; + $extras = $composer->getPackage()->getExtra(); + + if (isset($extras['symfony-var-dir']) && is_dir($extras['symfony-var-dir'])) { + $rootDir .= trim($extras['symfony-var-dir'], '/'); + } elseif (isset($extras['symfony-app-dir']) && is_dir($extras['symfony-app-dir'])) { + $rootDir .= trim($extras['symfony-app-dir'], '/'); + } else { + $rootDir .= '/app'; + } + $this->runonceManager = new RunonceManager( - dirname($composer->getConfig()->get('vendor-dir')) . '/app/Resources/contao/config/runonce.php' + $rootDir . '/Resources/contao/config/runonce.php' ); }
Respect override of the kernel directory in composer.json
contao-community-alliance_composer-plugin
train
php
4472df37dd307688c5182d127cebd26fdf7ea5cb
diff --git a/modularity.php b/modularity.php index <HASH>..<HASH> 100644 --- a/modularity.php +++ b/modularity.php @@ -80,6 +80,7 @@ add_action('plugins_loaded', function () { 'mod-social' => 'group_56dedc26e5327', 'mod-wpwidget' => 'group_5729f4d3e7c7a', 'mod-sites' => 'group_58ecb6b6330f4', + 'mod-table-block' => 'group_60b8bf5bbc4d7' )); $acfExportManager->import();
Add field group to AcfExportManager
helsingborg-stad_Modularity
train
php
33cbddcb51ea12b6b12434eb607e469d1c87c383
diff --git a/src/ElephantOnCouch/Info/DbInfo.php b/src/ElephantOnCouch/Info/DbInfo.php index <HASH>..<HASH> 100755 --- a/src/ElephantOnCouch/Info/DbInfo.php +++ b/src/ElephantOnCouch/Info/DbInfo.php @@ -10,6 +10,7 @@ namespace ElephantOnCouch\Info; use ElephantOnCouch\Extension; +use ElephantOnCouch\Helper; //! @brief This is an information only purpose class. It's used by Couch.getDbInfo() method.
added Helper to the namespaces list
dedalozzo_eoc-client
train
php
4f1f7ea0a6c442080fa794682e6ae79fede092d6
diff --git a/src/Directory.php b/src/Directory.php index <HASH>..<HASH> 100644 --- a/src/Directory.php +++ b/src/Directory.php @@ -85,6 +85,16 @@ class Directory extends FSObject { return $this->recurseOn()->cata($trans); } + /** + * Get an recursor over the content of this directory. + * + * @return DirectoryRecursor + */ + public function recurseOn() { + return new DirectoryRecursor($this); + } + + // Maybe remove these? Certainly reimplement them... /** @@ -97,15 +107,6 @@ class Directory extends FSObject { } /** - * Get an recursor over the content of this directory. - * - * @return DirectoryRecursor - */ - public function recurseOn() { - return $this->withContents()->recurseOn(); - } - - /** * Get an object that can perform a fold operation on all files in this * iterator. * @@ -114,6 +115,4 @@ class Directory extends FSObject { public function foldFiles() { return $this->withContents()->foldFiles(); } - - }
reimplemented Directory::recurseOn
lechimp-p_flightcontrol
train
php
7512c37641b1717cac74cb4e5667c7ede57cb205
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup(name='whereami', url='https://github.com/kootenpv/whereami', author_email='kootenpv@gmail.com', install_requires=[ - 'scikit-learn', 'tqdm', 'access_points' + 'scipy', 'numpy', 'scikit-learn', 'tqdm', 'access_points' ], entry_points={ 'console_scripts': ['whereami = whereami.__main__:main']
missing dependencies in setup.py
kootenpv_whereami
train
py
76dfe138990e3387ac5c987f26af56caca4c11bb
diff --git a/plugins/vega/Histogram/test/histogram.image.js b/plugins/vega/Histogram/test/histogram.image.js index <HASH>..<HASH> 100644 --- a/plugins/vega/Histogram/test/histogram.image.js +++ b/plugins/vega/Histogram/test/histogram.image.js @@ -5,5 +5,5 @@ imageTest({ url: 'http://localhost:28000/examples/histogram', selector: '#vis-element', delay: 1000, - threshold: 0.001 + threshold: 0.005 });
test: allow bigger margin of error to account for pixelwise rendering differences
Kitware_candela
train
js
485aa7afd40655629a3db8fe057ed1ce0d80a530
diff --git a/core-bundle/src/Resources/contao/classes/StyleSheets.php b/core-bundle/src/Resources/contao/classes/StyleSheets.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/classes/StyleSheets.php +++ b/core-bundle/src/Resources/contao/classes/StyleSheets.php @@ -961,7 +961,7 @@ class StyleSheets extends \Backend } // Optimize floating-point numbers (see #6634) - $return = preg_replace('/(?<!\-)0\.([0-9]+)/', '.$1', $return); + $return = preg_replace('/([^0-9\.\-])0\.([0-9]+)/', '$1.$2', $return); // Replace insert tags (see #5512) return $this->replaceInsertTags($return, false);
[Core] Correctly optimize floating-point numbers in style sheets (see #<I>)
contao_contao
train
php
54cd2d4f61bacd2f19cc3085125ab4c4a8b0204d
diff --git a/src/utils/polyfillEnvironment.js b/src/utils/polyfillEnvironment.js index <HASH>..<HASH> 100644 --- a/src/utils/polyfillEnvironment.js +++ b/src/utils/polyfillEnvironment.js @@ -42,7 +42,9 @@ const scriptURL = require('react-native').NativeModules.SourceCode.scriptURL; // // or Android device it will be `localhost:<port>` but when using real iOS device // it will be `<ip>.xip.io:<port>`. Thus the code below ensure we connect and download // manifest/hot-update from a valid origin. -global.DEV_SERVER_ORIGIN = scriptURL.match(/(^.+)\/index/)[1]; +const match = scriptURL && scriptURL.match(/(^.+)\/index/); + +global.DEV_SERVER_ORIGIN = match ? match[1] : null; // Webpack's `publicPath` needs to be overwritten with `DEV_SERVER_ORIGIN` otherwise, // it would still make requests to (usually) `localhost`. __webpack_require__.p = `${global.DEV_SERVER_ORIGIN}/`; // eslint-disable-line no-undef
Fix scriptUrl match for production build (#<I>)
callstack_haul
train
js
8aff0a8b04dbdde4787a3b03a06c7494b03c1082
diff --git a/src/blockchain.js b/src/blockchain.js index <HASH>..<HASH> 100644 --- a/src/blockchain.js +++ b/src/blockchain.js @@ -90,7 +90,7 @@ Blockchain.connect = function(connectionList, opts, doneCb) { Blockchain.execWhenReady = function(cb) { if (this.done) { - return cb(this.err); + return cb(this.err, this.web3); } if (!this.list) { this.list = []; @@ -104,7 +104,7 @@ Blockchain.doFirst = function(todo) { self.done = true; self.err = err; if (self.list) { - self.list.map((x) => x.apply(x, [self.err])); + self.list.map((x) => x.apply(x, [self.err, self.web3])); } }) }; @@ -133,7 +133,7 @@ let Contract = function (options) { let originalMethods = Object.keys(ContractClass); - Blockchain.execWhenReady(function() { + Blockchain.execWhenReady(function(err, web3) { if(!ContractClass.currentProvider){ ContractClass.setProvider(web3.currentProvider); }
feature: pass network info to onReady
embark-framework_EmbarkJS
train
js
357514ceec94df18abf98e5b906b50cb0dcf4cbd
diff --git a/lib/puppet/file_serving/fileset.rb b/lib/puppet/file_serving/fileset.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/file_serving/fileset.rb +++ b/lib/puppet/file_serving/fileset.rb @@ -59,6 +59,7 @@ class Puppet::FileServing::Fileset end def initialize(path, options = {}) + path = path.chomp(File::SEPARATOR) raise ArgumentError.new("Fileset paths must be fully qualified") unless File.expand_path(path) == path @path = path
(#<I>) Fix fileset path absoluteness checking with trailing slash Reviewed-By: Nick Lewis Reviewed-By: Pieter van de Bruggen
puppetlabs_puppet
train
rb
9b2680cd272ed430c3f3c38bd3882e1647f9d4ba
diff --git a/lib/models/turkee_task.rb b/lib/models/turkee_task.rb index <HASH>..<HASH> 100644 --- a/lib/models/turkee_task.rb +++ b/lib/models/turkee_task.rb @@ -244,7 +244,7 @@ module Turkee # Returns the default url of the model's :new route def self.form_url(host, typ, params = {}) - @app ||= ActionController::Integration::Session.new(Rails.application) + @app ||= ActionDispatch::Integration::Session.new(Rails.application) url = (host + @app.send("new_#{typ.to_s.underscore}_path")) full_url(url, params) end
updated deprecated class this removes: DEPRECATION WARNING: cl is deprecated and will be removed, use ActionDispatch::Integration instead. (called from form_url at ~/.rvm/gems/ruby-<I>-p<I>/bundler/gems/turkee-8c<I>e0/lib/models/turkee_task.rb:<I>)
aantix_turkee
train
rb
8a0e051c1dd059f3fede4147154b40f857b7d304
diff --git a/cmd/helm/installer/install.go b/cmd/helm/installer/install.go index <HASH>..<HASH> 100644 --- a/cmd/helm/installer/install.go +++ b/cmd/helm/installer/install.go @@ -166,6 +166,9 @@ func generateDeployment(opts *Options) *extensions.Deployment { }, }, }, + NodeSelector: map[string]string{ + "beta.kubernetes.io/os": "linux", + }, SecurityContext: &api.PodSecurityContext{ HostNetwork: opts.EnableHostNetwork, },
fix(helm): Ensures tiller pod lands on a linux node Without a node selector to ensure that tiller deploys on a linux node, the tiller pod can have issues starting in a mixed cluster. Fixes #<I>
helm_helm
train
go
df1d02fe1e5b17a07fc5ba47c254214ecd5c2206
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ try: import Cython from Cython.Distutils import build_ext - if Cython.__version__ < '0.18': + if Cython.__version__ < '0.28': raise ImportError() except ImportError: print(
Bump minimum cython to <I>
msmbuilder_msmbuilder
train
py
60404c7d01dced8007fa5417ee601855c748ca28
diff --git a/install.rb b/install.rb index <HASH>..<HASH> 100755 --- a/install.rb +++ b/install.rb @@ -122,12 +122,12 @@ def check_prereqs facter_version = Facter.version.to_f if facter_version < MIN_FACTER_VERSION puts "Facter version: #{facter_version}; minimum required: #{MIN_FACTER_VERSION}; cannot install" - exit (-1) + exit(-1) end end rescue LoadError puts "Could not load #{pre}; cannot install" - exit (-1) + exit(-1) end } end @@ -248,7 +248,7 @@ def prepare_installation require 'win32/dir' rescue LoadError => e puts "Cannot run on Microsoft Windows without the win32-process, win32-dir & win32-service gems: #{e}" - exit (-1) + exit(-1) end end
(maint) Resolve ruby -wc warnings Remove space between method name and parentheses.
puppetlabs_puppet
train
rb
76c98206a98e10c916656e1b3fec92883a33ed40
diff --git a/green/test/test_plugin.py b/green/test/test_plugin.py index <HASH>..<HASH> 100644 --- a/green/test/test_plugin.py +++ b/green/test/test_plugin.py @@ -18,7 +18,7 @@ class TestPlugin(PluginTester, unittest.TestCase): def test_NOSE_GREEN_setsEnabled(self): parser = MagicMock() self.assertEqual(self.g.enabled, False) - self.g.options(parser, env={'NOSE_GREEN':'1'}) + self.g.options(parser, env={'NOSE_WITH_GREEN':'1'}) self.assertEqual(self.g.enabled, True)
Updated the options test to match with the updated environment variable.
CleanCut_green
train
py
d853d66539c89f7d2c3a0eef807c1edb48fd29f2
diff --git a/lib/downloadr/version.rb b/lib/downloadr/version.rb index <HASH>..<HASH> 100644 --- a/lib/downloadr/version.rb +++ b/lib/downloadr/version.rb @@ -1,3 +1,3 @@ module Downloadr - VERSION='0.0.17' + VERSION='0.0.18' end
Bumped Gem version to <I>
claudijd_downloadr
train
rb
8b85cfd3497ccf30b7dc6a19b8738932d120257a
diff --git a/src/ReportService/ReportService.php b/src/ReportService/ReportService.php index <HASH>..<HASH> 100644 --- a/src/ReportService/ReportService.php +++ b/src/ReportService/ReportService.php @@ -1070,7 +1070,7 @@ class ReportService array_push($uriParameterList, array("item", $this->getItem())); } if (!is_null($this->classid)) { - array_push($uriParameterList, array("classid", $this->getClassid())); + array_push($uriParameterList, array("class", $this->getClassid())); } if (!is_null($this->appaid)) { array_push($uriParameterList, array("appaid", $this->getAppaid()));
the Quickbooks API expects the lass paramater to be named 'class' instead of 'classid'
intuit_QuickBooks-V3-PHP-SDK
train
php
43988475465a24a1dbb7cc30d53618e7939af270
diff --git a/CHANGES.txt b/CHANGES.txt index <HASH>..<HASH> 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,8 @@ +0.8.10 +------ + + - Strip '/' from end of urls when crawling + 0.8.9 ------ diff --git a/scrape/__init__.py b/scrape/__init__.py index <HASH>..<HASH> 100644 --- a/scrape/__init__.py +++ b/scrape/__init__.py @@ -1,3 +1,3 @@ """scrape is a rule-based web crawler and information extraction tool capable of manipulating and merging new and existing documents. XML Path Language (XPath) and regular expressions are used to define rules for filtering content and web traversal. Output can be any one of text, CSV, PDF, and/or HTML formats. """ -__version__ = '0.8.9' +__version__ = '0.8.10' diff --git a/scrape/utils.py b/scrape/utils.py index <HASH>..<HASH> 100644 --- a/scrape/utils.py +++ b/scrape/utils.py @@ -296,7 +296,7 @@ def add_scheme(url): def remove_scheme(url): """Remove scheme from URL""" - return url.replace('http://', '').replace('https://', '') + return url.replace('http://', '').replace('https://', '').rstrip('/') def check_scheme(url):
Strip '/' from end of urls when crawling
huntrar_scrape
train
txt,py,py
6a07715c1de19a27dce8c38153ee5ddb06093967
diff --git a/src/structures/Guild.js b/src/structures/Guild.js index <HASH>..<HASH> 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -266,7 +266,7 @@ class Guild extends Base { */ this.emojis = new GuildEmojiStore(this); if (data.emojis) for (const emoji of data.emojis) this.emojis.add(emoji); - } else { + } else if (data.emojis) { this.client.actions.GuildEmojisUpdate.handle({ guild_id: this.id, emojis: data.emojis,
fix(Guild): only update emojis when they are present in the payload
discordjs_discord.js
train
js
fc5719ebef9586ed7c8e4df15744a77a74559e1d
diff --git a/fauxflake-core/src/main/java/com/github/rholder/fauxflake/provider/MacMachineIdProvider.java b/fauxflake-core/src/main/java/com/github/rholder/fauxflake/provider/MacMachineIdProvider.java index <HASH>..<HASH> 100644 --- a/fauxflake-core/src/main/java/com/github/rholder/fauxflake/provider/MacMachineIdProvider.java +++ b/fauxflake-core/src/main/java/com/github/rholder/fauxflake/provider/MacMachineIdProvider.java @@ -40,12 +40,14 @@ public class MacMachineIdProvider implements MachineIdProvider { static { long value = 0L; - byte[] raw = Arrays.copyOf(macAddress(), 8); try { // first 6 bytes are MAC + byte[] raw = Arrays.copyOf(macAddress(), 8); value = new DataInputStream(new ByteArrayInputStream(raw)).readLong(); } catch (IOException e) { e.printStackTrace(); + } catch (UnsupportedOperationException e) { + e.printStackTrace(); } MACHINE_ID = value; }
more gracefully handle UnsupportedOperationException when the MAC cannot be retrieved
rholder_fauxflake
train
java
b2f5842ebdaec2751997f26f1aff3b60b003b3ef
diff --git a/saltcloud/config.py b/saltcloud/config.py index <HASH>..<HASH> 100644 --- a/saltcloud/config.py +++ b/saltcloud/config.py @@ -161,7 +161,8 @@ def cloud_config(path, env_var='SALT_CLOUD_CONFIG', defaults=None, opts = apply_cloud_config(overrides, defaults) # 3rd - Include Cloud Providers - if 'providers' in opts and (providers_config or providers_config_path): + if 'providers' in opts and (providers_config is not None or ( + providers_config and os.path.isfile(providers_config_path))): raise saltcloud.exceptions.SaltCloudConfigError( 'Do not mix the old cloud providers configuration with ' 'the new one. The providers configuration should now go in ' @@ -170,8 +171,15 @@ def cloud_config(path, env_var='SALT_CLOUD_CONFIG', defaults=None, '`/etc/salt/cloud.providers`.' ) elif 'providers' not in opts and providers_config is None: + # Load from configuration file, even if that files does not exist since + # it will be populated with defaults. providers_config = cloud_providers_config(providers_config_path) - opts['providers'] = providers_config + elif 'providers' not in opts and providers_config is not None: + # We're being passed a configuration dictionary + opts['providers'] = providers_config + else: + # Old style config + providers_config = opts['providers'] # 4th - Include VM profiles config if vm_config is None:
Fix providers config loading logic and also handle old configs properly.
saltstack_salt
train
py
ef68a65360910b78d4322ea20235d866f320ca6d
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -24,7 +24,7 @@ module.exports = function(opts, callback){ return callback(error, null); } - var data = opts.format == 'json' ? JSON.parse(body.toString()) : body.toString(); + var data = opts.format == 'json' ? JSON.parse(body) : body; return callback(null, data);
Removes unnecessary .toString() from body
zrrrzzt_html-validator
train
js
8cff9a780b00fc4ce9b3724ba5e4b5c75bafa127
diff --git a/lib/omnibus/config.rb b/lib/omnibus/config.rb index <HASH>..<HASH> 100644 --- a/lib/omnibus/config.rb +++ b/lib/omnibus/config.rb @@ -159,6 +159,15 @@ module Omnibus # @!endgroup + # @!group Build Version Parameters + + # @!attribute [rw] append_timestamp + # + # @return [Boolean] + append_timestamp true + + # # @!endgroup + # @!group Validation Methods # Asserts that the Config object is in a valid state. If invalid
add an `append_timestamp` configuration value This value will be used to indicate whether a timestamp should be appended to the build version.
chef_omnibus
train
rb
737e4f047afd40cca7f93a3df6fa6fe904de5ef4
diff --git a/js/wee.data.js b/js/wee.data.js index <HASH>..<HASH> 100644 --- a/js/wee.data.js +++ b/js/wee.data.js @@ -193,7 +193,7 @@ } // Add POST content type - if (method == 'POST') { + if (method == 'POST' && ! conf.json) { headers[contentTypeHeader] = 'application/x-www-form-urlencoded; charset=UTF-8'; }
Don't override JSON content type header if json is set to true
weepower_wee-core
train
js
74fa5bee319aa303018be1066f139295794f8266
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -44,11 +44,11 @@ except(IOError, ImportError): setup( name='esgfpid', - version='0.7.1', + version='0.7.2-dev', author='Merret Buurman, German Climate Computing Centre (DKRZ)', author_email='buurman@dkrz.de', url='https://github.com/IS-ENES-Data/esgf-pid', - download_url='https://github.com/IS-ENES-Data/esgf-pid/archive/0.7.1.tar.gz', + download_url='https://github.com/IS-ENES-Data/esgf-pid/archive/0.7.2-dev.tar.gz', description='Library for sending PID requests to a rabbit messaging queue during ESGF publication.', long_description=long_description, packages=packages + test_packages,
Incremented version number to <I>-dev.
IS-ENES-Data_esgf-pid
train
py
aaedc088c714cdc76c3da7febf98314f0ca395f9
diff --git a/config/environment.rb b/config/environment.rb index <HASH>..<HASH> 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -39,6 +39,7 @@ require 'lib/rubygems' require 'lib/rubygems/format' require 'lib/rubygems/indexer' require 'lib/rubygems/source_index' +require 'lib/rubygems/version' require 'lib/indexer' require 'lib/core_ext/string'
I guess we need version.rb too
rubygems_rubygems.org
train
rb
98b127ac43547e9d5ed97f4c9e783c6226aff7bb
diff --git a/person-directory-impl/src/main/java/org/jasig/services/persondir/support/merger/IAttributeMerger.java b/person-directory-impl/src/main/java/org/jasig/services/persondir/support/merger/IAttributeMerger.java index <HASH>..<HASH> 100644 --- a/person-directory-impl/src/main/java/org/jasig/services/persondir/support/merger/IAttributeMerger.java +++ b/person-directory-impl/src/main/java/org/jasig/services/persondir/support/merger/IAttributeMerger.java @@ -68,8 +68,6 @@ public interface IAttributeMerger { * @param toConsider - in consideration of this map * @return the modified Map * @throws IllegalArgumentException if either toModify or toConsider is null - * @deprecated Merging individual result sets is no longer needed by client code. This method will be removed in 1.6 */ - @Deprecated public Map<String, List<Object>> mergeAttributes(Map<String, List<Object>> toModify, Map<String, List<Object>> toConsider); } \ No newline at end of file
NOJIRA don't deprecate merge attributes method as client code may need it git-svn-id: <URL>
apereo_person-directory
train
java
52bc0667b71e787d2c8ce966544a5d386d42f806
diff --git a/productmd/composeinfo.py b/productmd/composeinfo.py index <HASH>..<HASH> 100644 --- a/productmd/composeinfo.py +++ b/productmd/composeinfo.py @@ -744,6 +744,7 @@ class Variant(VariantBase): variant_uids = ["%s-%s" % (self.uid, i) for i in variant_ids] for variant_uid in variant_uids: variant = Variant(self._metadata) + variant.parent = self variant.deserialize(full_data, variant_uid) self.add(variant) @@ -782,4 +783,3 @@ class Variant(VariantBase): def add(self, variant): VariantBase.add(self, variant) - variant.parent = self
Set parent for child variant before deserializing When variant is deserialized, validations are run on it. Some of these validations require that parent is set, otherwise an error is raised. It is therefore too late to set the parent after the deserialization.
release-engineering_productmd
train
py
82c1f9273f269df8732fc27ac7a8645072eabf08
diff --git a/src/main/java/hex/glm/GLM2.java b/src/main/java/hex/glm/GLM2.java index <HASH>..<HASH> 100644 --- a/src/main/java/hex/glm/GLM2.java +++ b/src/main/java/hex/glm/GLM2.java @@ -462,7 +462,8 @@ public class GLM2 extends Job.ModelJobWithoutClassificationField { //pass } toEnum = family == Family.binomial && (!response.isEnum() && (response.min() < 0 || response.max() > 1)); - + if(source2.numCols() <= 1 && !intercept) + throw new IllegalArgumentException("There are no predictors left after ignoring constant columns in the dataset and no intercept => No parameters to estimate."); Frame fr = DataInfo.prepareFrame(source2, response, new int[0], toEnum, true, true); if(offset != null){ // now put the offset just in front of response int id = source.find(offset);
GLM fix: throw IAE in case there are no predictor columns and no intercept.
h2oai_h2o-2
train
java
b3bbca86cdc438a49c0b5e37642c8be279a769e8
diff --git a/src/directives/mwlDraggable.js b/src/directives/mwlDraggable.js index <HASH>..<HASH> 100644 --- a/src/directives/mwlDraggable.js +++ b/src/directives/mwlDraggable.js @@ -77,7 +77,7 @@ angular default: } - if (!$window.getComputedStyle(elm[0]).position) { + if ($window.getComputedStyle(elm[0]).position === 'static') { elm.css('position', 'relative'); }
Fix z-index of events being dragged on the year and month views
mattlewis92_angular-bootstrap-calendar
train
js
cc95d835d5908cc86f3b729a5b632bdde246357e
diff --git a/chef-server-api/spec/spec_model_helper.rb b/chef-server-api/spec/spec_model_helper.rb index <HASH>..<HASH> 100644 --- a/chef-server-api/spec/spec_model_helper.rb +++ b/chef-server-api/spec/spec_model_helper.rb @@ -53,6 +53,13 @@ def make_runlist(*items) res end +def make_client(name,admin=false) + res = Chef::ApiClient.new + res.name(name) + res.admin(admin) + res +end + def stub_checksum(checksum, present = true) Chef::Checksum.should_receive(:new).with(checksum).and_return do obj = stub(Chef::Checksum)
make_client model helper for testing ApiClient objects
chef_chef
train
rb
c1d020b0a68630bbc9950b09ad72ba38ee1c749f
diff --git a/spacy/pt/stop_words.py b/spacy/pt/stop_words.py index <HASH>..<HASH> 100644 --- a/spacy/pt/stop_words.py +++ b/spacy/pt/stop_words.py @@ -27,7 +27,7 @@ geral grande grandes grupo hoje horas há -iniciar inicio ir irá isso ista isto já +iniciar inicio ir irá isso isto já lado ligado local logo longe lugar lá
Remove "ista" from portuguese stop words
explosion_spaCy
train
py
38c5ab1b67477063e2a7cdbf952033ce2f78840e
diff --git a/app/class-element.php b/app/class-element.php index <HASH>..<HASH> 100644 --- a/app/class-element.php +++ b/app/class-element.php @@ -52,6 +52,33 @@ class Element { public $attr = null; /** + * Array of self-closing tags (i.e., void elements) that have + * no content. + * + * @since 5.0.0 + * @access protected + * @var array + */ + protected $self_closing = [ + 'base', + 'br', + 'col', + 'command', + 'embed', + 'hr', + 'img', + 'input', + 'keygen', + 'link', + 'menuitem', + 'meta', + 'param', + 'source', + 'track', + 'wbr' + ]; + + /** * Set up the object. * * @since 5.0.0 @@ -79,6 +106,11 @@ class Element { $attr = $this->attr instanceof Attributes ? $this->attr->fetch() : ''; + if ( in_array( $this->tag, $this->self_closing ) ) { + + return sprintf( '<%1$s %2$s />', tag_escape( $this->tag ), $attr ); + } + return sprintf( '<%1$s %2$s>%3$s</%1$s>', tag_escape( $this->tag ),
Add support for self-closing tags to the `Element` class.
justintadlock_hybrid-core
train
php
8c9aba94f4e08c6026f668e3e5dbceb88e16e1eb
diff --git a/lib/core.js b/lib/core.js index <HASH>..<HASH> 100644 --- a/lib/core.js +++ b/lib/core.js @@ -373,9 +373,8 @@ function keyObj(key) { return obj; } -function normalizeList(arr) { - if (!Array.isArray(arr)) arr = arr.split(','); - return arr.map(function(str) {return str.trim();}).sort().join(','); +function normalizeList(strlist) { + return strlist.split(',').map(function(str) {return str.trim();}).sort().join(','); } function dataEqual(a, b) {
Don't let express manage a http header list
kapouer_raja
train
js
0c0f5b021bc6f78ff737ca2dd78ddb3fd7f3a4c1
diff --git a/controller/src/main/java/org/jboss/as/controller/registry/AbstractResourceRegistration.java b/controller/src/main/java/org/jboss/as/controller/registry/AbstractResourceRegistration.java index <HASH>..<HASH> 100644 --- a/controller/src/main/java/org/jboss/as/controller/registry/AbstractResourceRegistration.java +++ b/controller/src/main/java/org/jboss/as/controller/registry/AbstractResourceRegistration.java @@ -509,7 +509,7 @@ abstract class AbstractResourceRegistration implements ManagementResourceRegistr for (Map.Entry<String, ModelNode> entry : overrideDescriptionProvider.getAttributeOverrideDescriptions(locale).entrySet()) { attrs.get(entry.getKey()).set(entry.getValue()); } - ModelNode children = result.get(ModelDescriptionConstants.ATTRIBUTES); + ModelNode children = result.get(ModelDescriptionConstants.CHILDREN); for (Map.Entry<String, ModelNode> entry : overrideDescriptionProvider.getChildTypeOverrideDescriptions(locale).entrySet()) { children.get(entry.getKey()).set(entry.getValue()); }
[WFLY-<I>] OverrideDescriptionCombiner should add overridden children to the children and not to the attributes was: <I>bb<I>baa<I>dcf<I>b3ca<I>dd<I>c<I>dc1
wildfly_wildfly-core
train
java
d8b5cdea73f4edacc37dc1aac95541c20bbdf52a
diff --git a/lib/db.js b/lib/db.js index <HASH>..<HASH> 100644 --- a/lib/db.js +++ b/lib/db.js @@ -22,6 +22,7 @@ mkdirp.sync(path.join(DB_PATH, '/cache')) ============================================================================== */ let loaded = false +let loadError = null const onLoads = [] var db = (module.exports = { @@ -35,7 +36,7 @@ var db = (module.exports = { instances: ['users', 'connections', 'queries', 'cache', 'config'], onLoad: function(fn) { if (loaded) { - return fn + return fn(loadError) } onLoads.push(fn) } @@ -73,6 +74,7 @@ async.series( ], function finishedLoading(err) { loaded = true + loadError = err onLoads.forEach(fn => fn(err)) } )
Fix and enhance db.onLoad (#<I>)
rickbergfalk_sqlpad
train
js
341d4d2e0cb48c1460bc7570b86e263dbca88c67
diff --git a/js/huobipro.js b/js/huobipro.js index <HASH>..<HASH> 100644 --- a/js/huobipro.js +++ b/js/huobipro.js @@ -27,6 +27,7 @@ module.exports = class huobipro extends Exchange { 'fetchOpenOrders': true, 'fetchDepositAddress': true, 'withdraw': true, + 'loadLimits': true, }, 'timeframes': { '1m': '1min', @@ -62,6 +63,7 @@ module.exports = class huobipro extends Exchange { 'common/symbols', // 查询系统支持的所有交易对 'common/currencys', // 查询系统支持的所有币种 'common/timestamp', // 查询系统当前时间 + 'common/exchange', // order limits ], }, 'private': { @@ -154,6 +156,13 @@ module.exports = class huobipro extends Exchange { return result; } + + async loadLimits (market, params = {}) { + return await this.publicGetCommonExchange (this.extend ({ + 'symbol': market['id']; + })) + } + async fetchMarkets () { let response = await this.publicGetCommonSymbols (); return this.parseMarkets (response['data']);
added loadMarkets to huobipro
ccxt_ccxt
train
js
ed6436d481806e5eda3cc8f40131c5ef21322398
diff --git a/src/test/moment/create.js b/src/test/moment/create.js index <HASH>..<HASH> 100644 --- a/src/test/moment/create.js +++ b/src/test/moment/create.js @@ -578,7 +578,12 @@ test('parsing iso', function (assert) { ['2011281 180420,111' + tz2, '2011-10-08T18:04:20.111' + tz] ], i; for (i = 0; i < formats.length; i++) { - assert.equal(moment(formats[i][0]).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), formats[i][1], 'moment should be able to parse ISO ' + formats[i][0]); + assert.equal(moment(formats[i][0]).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), + formats[i][1], 'moment should be able to parse ISO ' + formats[i][0]); + assert.equal(moment(formats[i][0], moment.ISO_8601).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), + formats[i][1], 'moment should be able to parse specified ISO ' + formats[i][0]); + assert.equal(moment(formats[i][0], moment.ISO_8601, true).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), + formats[i][1], 'moment should be able to parse specified strict ISO ' + formats[i][0]); } });
Add more iso tests variations (strict and non-strict ISO_<I>)
moment_moment
train
js
fe90f319b30cebc312c5d1a6edc68b1950f42e4c
diff --git a/fuseops/convert.go b/fuseops/convert.go index <HASH>..<HASH> 100644 --- a/fuseops/convert.go +++ b/fuseops/convert.go @@ -197,15 +197,17 @@ func Convert( case *bazilfuse.FsyncRequest: // We don't currently support this for directories. if typed.Dir { - return - } - - to := &SyncFileOp{ - Inode: InodeID(typed.Header.Node), - Handle: HandleID(typed.Handle), + to := &unknownOp{} + io = to + co = &to.commonOp + } else { + to := &SyncFileOp{ + Inode: InodeID(typed.Header.Node), + Handle: HandleID(typed.Handle), + } + io = to + co = &to.commonOp } - io = to - co = &to.commonOp case *bazilfuse.FlushRequest: to := &FlushFileOp{
Fixed a bug in handling of an unknown op type.
jacobsa_fuse
train
go
f0e0f2e7147542043e2d5465c724276c416e98f8
diff --git a/falafel/mappers/tests/test_interrupts.py b/falafel/mappers/tests/test_interrupts.py index <HASH>..<HASH> 100644 --- a/falafel/mappers/tests/test_interrupts.py +++ b/falafel/mappers/tests/test_interrupts.py @@ -68,6 +68,10 @@ INT_INVALID_2 = """ """.strip() +INT_NO_INTERRUPTS = """ + CPU0 +""" + def test_interrupts(): all_ints = Interrupts(context_wrap(INT_MULTI)) @@ -92,3 +96,6 @@ def test_interrupts(): with pytest.raises(ParseException): Interrupts(context_wrap(INT_INVALID_2)) + + with pytest.raises(ParseException): + Interrupts(context_wrap(INT_NO_INTERRUPTS))
Interrupts tests at <I>% code coverage Test the (unlikely) situation where the file shows a header but no interrupts.
RedHatInsights_insights-core
train
py
2588462ea9193103391df21fccf9b55115356e73
diff --git a/app/libraries/Setups/Views/Header.php b/app/libraries/Setups/Views/Header.php index <HASH>..<HASH> 100644 --- a/app/libraries/Setups/Views/Header.php +++ b/app/libraries/Setups/Views/Header.php @@ -86,9 +86,14 @@ final class Header extends AbstractSetup public function renderMenu() { echo '<nav id="primary-menu" class="js-main-menu site-navigation '. - $this->menuStatus().'">'. - $this->menuSkipTo('main', \esc_html__('Skip to content', 'jentil')); + $this->menuStatus().'">'; \get_search_form(); + + echo $this->menuSkipTo( + 'main', + \esc_html__('Skip to content', 'jentil') + ); + \wp_nav_menu(['theme_location' => 'primary-menu']); echo '</nav>'; }
Move skip to content link to the immediate top of nav menu
GrottoPress_jentil
train
php
20591f47462be08705beab8ce99016facbaa7bfc
diff --git a/thumbor/error_handlers/sentry.py b/thumbor/error_handlers/sentry.py index <HASH>..<HASH> 100644 --- a/thumbor/error_handlers/sentry.py +++ b/thumbor/error_handlers/sentry.py @@ -36,9 +36,7 @@ class ErrorHandler(object): res_mod = pkg_resources.get_distribution(module) if res_mod is not None: resolved[module] = res_mod.version - except (pkg_resources.DistributionNotFound, - pkg_resources._vendor.packaging.requirements.InvalidRequirement, - pkg_resources.RequirementParseError): + except pkg_resources.DistributionNotFound: pass return resolved
Fix Sentry test error It seems like Sentry has changed things around that error once again
thumbor_thumbor
train
py
76085db5a91cdda9073194859082341674b340f1
diff --git a/src/cartodb.js b/src/cartodb.js index <HASH>..<HASH> 100644 --- a/src/cartodb.js +++ b/src/cartodb.js @@ -93,7 +93,8 @@ 'vis/layers.js', // PUBLIC API - 'api/layers.js' + 'api/layers.js', + 'api/sql.js' ]; cdb.init = function(ready) {
added sql.js to files
CartoDB_carto.js
train
js
7f1732bc4f160aad8668f828cfe182f7aaa1095b
diff --git a/app/controllers/rails_admin/application_controller.rb b/app/controllers/rails_admin/application_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/rails_admin/application_controller.rb +++ b/app/controllers/rails_admin/application_controller.rb @@ -8,7 +8,7 @@ module RailsAdmin end class ApplicationController < ::ApplicationController - newrelic_ignore if defined?(NewRelic) + newrelic_ignore if defined?(NewRelic) && respond_to?(:newrelic_ignore) before_filter :_authenticate! before_filter :_authorize!
Fix when newrelic_ignore is not present If `newrelic_rpm` gem is included only in production environment, `newrelic_ignore` method is not available for development env.
sferik_rails_admin
train
rb
0388dbe38fdcbb796e0bb92b00e46d76177dc111
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -156,10 +156,11 @@ export default class TimeAgo extends Component<DefaultProps, Props, void> { ? [Math.round(seconds / MONTH), 'month'] : [Math.round(seconds / YEAR), 'year'] - const passDownTitle = title - || typeof date === 'string' - ? date - : (new Date(date)).toISOString().substr(0, 16).replace('T', ' ') + const passDownTitle = typeof title === 'undefined' + ? (typeof date === 'string' + ? date + : (new Date(date)).toISOString().substr(0, 16).replace('T', ' ')) + : title if (Komponent === 'time') { passDownProps.dateTime = (new Date(date)).toISOString()
Pass down title verbatim when specified. Closes #<I>
nmn_react-timeago
train
js
0d404d660f5e36ce1a5b1d62f7fccc40065723ef
diff --git a/core/Archive/ArchiveInvalidator.php b/core/Archive/ArchiveInvalidator.php index <HASH>..<HASH> 100644 --- a/core/Archive/ArchiveInvalidator.php +++ b/core/Archive/ArchiveInvalidator.php @@ -566,9 +566,9 @@ class ArchiveInvalidator $reArchiveList = new ReArchiveList($this->logger); $items = $reArchiveList->getAll(); - foreach ($items as $entry) { + foreach ($items as $item) { try { - $entry = @json_decode($entry, true); + $entry = @json_decode($item, true); if (empty($entry)) { continue; } @@ -588,7 +588,7 @@ class ArchiveInvalidator 'ex' => $ex, ]); } finally { - $reArchiveList->remove([$entry]); + $reArchiveList->remove([$item]); } } }
Fix removal of rearchiving records (#<I>)
matomo-org_matomo
train
php
d9e49c59004b1b4768647f6e40f5c60ec592030a
diff --git a/marathon_acme/sse_protocol.py b/marathon_acme/sse_protocol.py index <HASH>..<HASH> 100644 --- a/marathon_acme/sse_protocol.py +++ b/marathon_acme/sse_protocol.py @@ -1,6 +1,7 @@ from twisted.internet import error from twisted.internet.defer import Deferred from twisted.internet.protocol import connectionDone, Protocol +from twisted.logger import Logger, LogLevel class SseProtocol(Protocol): @@ -11,6 +12,7 @@ class SseProtocol(Protocol): _buffer = b'' MAX_LENGTH = 16384 + log = Logger() def __init__(self, handler): """ @@ -120,6 +122,7 @@ class SseProtocol(Protocol): return '\n'.join(self.data_lines) def connectionLost(self, reason=connectionDone): + self.log.failure('SSE connection lost', reason, LogLevel.warn) for d in list(self._waiting): d.callback(None) self._waiting = []
SSE: Log the reason for the lost connection
praekeltfoundation_marathon-acme
train
py
e276724fa4baa09510b466ef88915801d41db3a7
diff --git a/tests/Keboola/StorageApi/FilesTest.php b/tests/Keboola/StorageApi/FilesTest.php index <HASH>..<HASH> 100644 --- a/tests/Keboola/StorageApi/FilesTest.php +++ b/tests/Keboola/StorageApi/FilesTest.php @@ -49,6 +49,18 @@ class Keboola_StorageApi_FilesTest extends StorageApiTestCase $this->assertEquals($fileId, $file['id']); } + public function testFilesListFilterByInvalidValues() + { + try { + $this->_client->apiGet('storage/files?' . http_build_query([ + 'tags' => 'tag', + ])); + $this->fail('Validation error should be thrown'); + } catch (\Keboola\StorageApi\ClientException $e) { + $this->assertEquals('storage.validation', $e->getStringCode()); + } + } + public function testSetTagsFromArrayWithGaps() { $file = $this->_client->prepareFileUpload((new FileUploadOptions())
tests(files): filter by invalid tags type
keboola_storage-api-php-client
train
php
43421e977da856c5d7c47aa9c0cb889ee5bca5b5
diff --git a/bin/methods/start.js b/bin/methods/start.js index <HASH>..<HASH> 100644 --- a/bin/methods/start.js +++ b/bin/methods/start.js @@ -61,4 +61,9 @@ module.exports = class Cordlr { this.getConfiguration() this.start() } + + stop () { + this.bot.destroy() + process.exit(1) + } } diff --git a/loader/plugins/restart.js b/loader/plugins/restart.js index <HASH>..<HASH> 100644 --- a/loader/plugins/restart.js +++ b/loader/plugins/restart.js @@ -15,14 +15,31 @@ module.exports = class RestartPlugin extends CordlrPlugin { 'permissions': [ 'ADMINISTRATOR' ] + }, + 'stop': { + 'usage': '', + 'function': 'stopBot', + 'description': 'Stops the current bot instance', + 'permissions': [ + 'ADMINISTRATOR' + ] } } } restartBot (message) { + this.sendInfo(message, 'Restarting...', 'Cordlr', null, 'error') message.delete() .then(() => { this.bot.bot.bin.restart() }) } + + stopBot (message) { + this.sendInfo(message, 'Stopping...', 'Cordlr', null, 'error') + message.delete() + .then(() => { + this.bot.bot.bin.stop() + }) + } }
feat(CORE:Restart): Implemented Stop and Restart functionality
Devcord_cordlr-cli
train
js,js
cb3668318fe83b5fe1a9e19815b8108a752d5f4e
diff --git a/lib/rest-ftp-daemon/constants.rb b/lib/rest-ftp-daemon/constants.rb index <HASH>..<HASH> 100644 --- a/lib/rest-ftp-daemon/constants.rb +++ b/lib/rest-ftp-daemon/constants.rb @@ -57,7 +57,7 @@ LOG_PIPE_LEN = 10 LOG_COL_WID = 8 LOG_COL_JID = JOB_IDENT_LEN + 3 + 2 LOG_COL_ID = 6 -LOG_TRIM_LINE = 80 +LOG_TRIM_LINE = 200 LOG_DUMPS = File.dirname(__FILE__) + "/../../log/" LOG_ROTATION = "daily" LOG_FORMAT_TIME = "%Y-%m-%d %H:%M:%S"
don’t trim log lines too short: dangerous when we get backtraces with paths
bmedici_rest-ftp-daemon
train
rb
e3ea13e7f59be77d2dfdc52d772d04a10d6aabcf
diff --git a/haraka.js b/haraka.js index <HASH>..<HASH> 100644 --- a/haraka.js +++ b/haraka.js @@ -46,6 +46,11 @@ process.on('uncaughtException', function (err) { }); }); +process.on('SIGUSR1', function () { + logger.lognotice("Flushing the temp fail queue"); + server.flushQueue(); +}) + process.on('exit', function() { process.title = path.basename(process.argv[1], '.js'); logger.lognotice('Shutting down'); diff --git a/server.js b/server.js index <HASH>..<HASH> 100644 --- a/server.js +++ b/server.js @@ -66,6 +66,17 @@ Server.daemonize = function (config_data) { } } +Server.flushQueue = function () { + if (Server.cluster) { + for (var id in cluster.workers) { + cluster.workers[id].send({event: 'flush_queue'}); + } + } + else { + out.flush_queue(); + } +} + Server.createServer = function (params) { var config_data = config.get('smtp.ini'); var param_key;
Flush the outbound temp fail queue with SIGUSR1
haraka_Haraka
train
js,js
31d2e19663ccf6038fb5f30ec8a255fb0311a08f
diff --git a/test/rdb_workloads/lots_of_tables.rb b/test/rdb_workloads/lots_of_tables.rb index <HASH>..<HASH> 100755 --- a/test/rdb_workloads/lots_of_tables.rb +++ b/test/rdb_workloads/lots_of_tables.rb @@ -7,6 +7,9 @@ port = ENV['PORT'].to_i raise RuntimeError,"Must specify HOST and PORT in environment." if (!host || !port) +raise RuntimeError,"Expected at most one argument" if ARGV.length > 1 +if ARGV.length == 1 then count = ARGV[0].to_i else count = 100 end + require 'rethinkdb.rb' extend RethinkDB::Shortcuts_Mixin @@ -23,7 +26,7 @@ datacenter_name = datacenters_json.to_a[0][1]["name"] require 'time' i = 0 -while i < 100 do +while i < count do tbl_name = rand().to_s start_time = Time.now r.db(ENV["DB_NAME"]).create_table(tbl_name, datacenter_name).run
Make number of tables configurable in lots_of_tables.rb. So you can only do a few tables instead of lots if you want.
rethinkdb_rethinkdb
train
rb
6f61b4133dcc36b12f889de462deadbe815a702f
diff --git a/api/src/main/java/com/capitalone/dashboard/service/CollectorServiceImpl.java b/api/src/main/java/com/capitalone/dashboard/service/CollectorServiceImpl.java index <HASH>..<HASH> 100644 --- a/api/src/main/java/com/capitalone/dashboard/service/CollectorServiceImpl.java +++ b/api/src/main/java/com/capitalone/dashboard/service/CollectorServiceImpl.java @@ -191,7 +191,19 @@ public class CollectorServiceImpl implements CollectorService { Collector existing = collectorRepository.findByName(collector.getName()); if (existing != null) { collector.setId(existing.getId()); + /* + * Since this is invoked by api it always needs to be enabled and online, + * additionally since this record is fetched from the database existing record + * needs to updated with these values. + * */ + existing.setEnabled(true); + existing.setOnline(true); + existing.setLastExecuted(System.currentTimeMillis()); + return collectorRepository.save(existing); } + /* + * create a new collector record + * */ return collectorRepository.save(collector); }
Update the collector record if already existing else create a new one. (#<I>)
Hygieia_Hygieia
train
java
9342699a5c58864d5820d0dcd68e52f914340789
diff --git a/Log/observer.php b/Log/observer.php index <HASH>..<HASH> 100644 --- a/Log/observer.php +++ b/Log/observer.php @@ -72,6 +72,16 @@ class Log_observer $type = strtolower($type); $class = 'Log_observer_' . $type; + /* + * If the desired class already exists (because the caller has supplied + * it from some custom location), simply instantiate and return a new + * instance. + */ + if (class_exist($class)) { + $object = new $class($priority, $conf); + return $object; + } + /* Support both the new-style and old-style file naming conventions. */ if (file_exists(dirname(__FILE__) . '/observer_' . $type . '.php')) { $classfile = 'Log/observer_' . $type . '.php'; @@ -82,8 +92,7 @@ class Log_observer } /* Issue a warning if the old-style conventions are being used. */ - if (!$newstyle) - { + if (!$newstyle) { trigger_error('Using old-style Log_observer conventions', E_USER_WARNING); }
If the desired class already exists (because the caller has supplied it from some custom location), simply instantiate and return a new instance. Noticed by: Mads Danquah
pear_Log
train
php
e89098d37fd11180cc030eea6c316c85f32579ea
diff --git a/lib/components/map/default-map.js b/lib/components/map/default-map.js index <HASH>..<HASH> 100644 --- a/lib/components/map/default-map.js +++ b/lib/components/map/default-map.js @@ -13,7 +13,6 @@ import { setMapPopupLocation, setMapPopupLocationAndGeocode } from '../../actions/map' - import BoundsUpdatingOverlay from './bounds-updating-overlay' import EndpointsOverlay from './connected-endpoints-overlay' import ParkAndRideOverlay from './connected-park-and-ride-overlay' diff --git a/lib/components/narrative/line-itin/itin-summary.js b/lib/components/narrative/line-itin/itin-summary.js index <HASH>..<HASH> 100644 --- a/lib/components/narrative/line-itin/itin-summary.js +++ b/lib/components/narrative/line-itin/itin-summary.js @@ -1,6 +1,6 @@ import TriMetModeIcon from '@opentripplanner/icons/lib/trimet-mode-icon' -import React, { Component } from 'react' import PropTypes from 'prop-types' +import React, { Component } from 'react' import { calculateFares, calculatePhysicalActivity, isTransit } from '../../../util/itinerary' import { formatDuration, formatTime } from '../../../util/time'
style: Organize imports per PR comments.
opentripplanner_otp-react-redux
train
js,js
9c424c56df8b7ced75047c2d9363d53ef0d1844e
diff --git a/core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java b/core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java index <HASH>..<HASH> 100644 --- a/core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java +++ b/core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java @@ -42,6 +42,7 @@ import java.util.NoSuchElementException; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantReadWriteLock; +import javax.annotation.Nullable; import javax.annotation.concurrent.GuardedBy; import javax.annotation.concurrent.ThreadSafe; @@ -329,6 +330,7 @@ public final class MountTable implements JournalEntryIterable { * @param mountId the given ufs id * @return the mount information with this id or null if this mount id is not found */ + @Nullable public MountInfo getMountInfo(long mountId) { try (LockResource r = new LockResource(mReadLock)) { for (Map.Entry<String, MountInfo> entry : mMountTable.entrySet()) {
add Nullable notation for MountTable.java
Alluxio_alluxio
train
java
3d65af010680194bb68b02b00cd54dca5ff4242b
diff --git a/driver-compat/src/main/com/mongodb/DBCollection.java b/driver-compat/src/main/com/mongodb/DBCollection.java index <HASH>..<HASH> 100644 --- a/driver-compat/src/main/com/mongodb/DBCollection.java +++ b/driver-compat/src/main/com/mongodb/DBCollection.java @@ -197,6 +197,10 @@ public class DBCollection { return new WriteResult(result, writeConcernToUse); } + public DBCursor find(final DBObject filter) { + return find(filter, null); + } + public DBCursor find(final DBObject filter, final DBObject fields) { return new DBCursor(collection, new MongoFind(). where(DBObjects.toQueryFilterDocument(filter)).
Implemented another find method in DBCollection
mongodb_mongo-java-driver
train
java
9b280558e68f7e5c5bab85eef8b8258cf7edac03
diff --git a/nyt.js b/nyt.js index <HASH>..<HASH> 100644 --- a/nyt.js +++ b/nyt.js @@ -48,16 +48,16 @@ function nyt (keys) { community.recent(args, callback, myKeys, table); }, random : function (args, callback) { - + community.random(args, callback, myKeys, table); }, byDate : function (args, callback) { - + community.byDate(args, callback, myKeys, table); }, byUser : function (args, callback) { - + community.byUser(args, callback, myKeys, table); }, byURL : function (args, callback) { - + community.byURL(args, callback, myKeys, table); } }
added community outline in nyt
czarlos_nyt
train
js
02776ee668f6876a9d7d92b64a5fa653aea26e83
diff --git a/tests/mock_tests/test_sqlparsing.py b/tests/mock_tests/test_sqlparsing.py index <HASH>..<HASH> 100644 --- a/tests/mock_tests/test_sqlparsing.py +++ b/tests/mock_tests/test_sqlparsing.py @@ -232,6 +232,7 @@ class VoidQuery(MockTest): class TestCanvasVoidQuery(VoidQuery): + @skip def test_query(self): self.sql = 'CREATE TABLE "introspection_comment" ("id" int NOT NULL PRIMARY KEY AUTOINCREMENT, "ref" string NOT NULL UNIQUE, "article_id" int NOT NULL, "email" string NOT NULL, "pub_date" date NOT NULL, "up_votes" long NOT NULL, "body" string NOT NULL, CONSTRAINT "up_votes_gte_0_check" CHECK ("up_votes" >= 0), CONSTRAINT "article_email_pub_date_uniq" UNIQUE ("article_id", "email", "pub_date"))' self.exe()
Support for Django <I>
nesdis_djongo
train
py
a78acf0015742a8f9abe6961b7a02cd78ff2f27e
diff --git a/src/Model/Behavior/SlugBehavior.php b/src/Model/Behavior/SlugBehavior.php index <HASH>..<HASH> 100644 --- a/src/Model/Behavior/SlugBehavior.php +++ b/src/Model/Behavior/SlugBehavior.php @@ -182,7 +182,7 @@ class SlugBehavior extends Behavior throw new InvalidArgumentException('The `slug` key is required by the `slugged` finder.'); } - return $query->where([$this->config('field') => $options['slug']]); + return $query->where([$this->_table->alias() . '.' . $this->config('field') => $options['slug']]); } /**
Resolves #4. Add the table class alias to the field
UseMuffin_Slug
train
php
7a8e80ac0daf4fc39f818c46226df6ed54415cd9
diff --git a/conn.go b/conn.go index <HASH>..<HASH> 100644 --- a/conn.go +++ b/conn.go @@ -232,7 +232,13 @@ func Connect(config ConnConfig) (c *Conn, err error) { } } +// Close closes a connection. It is safe to call Close on a already closed +// connection. func (c *Conn) Close() (err error) { + if !c.IsAlive() { + return nil + } + err = c.txMsg('X', c.getBuf(), true) c.die(errors.New("Closed")) c.logger.Info("Closed connection") @@ -1190,4 +1196,6 @@ func (c *Conn) getBuf() *bytes.Buffer { func (c *Conn) die(err error) { c.alive = false c.causeOfDeath = err + c.writer.Flush() + c.conn.Close() }
Make Conn Close idempotent * die (which is called by Close) now closes underlying connection
jackc_pgx
train
go
68e58ba76afca7e19eeeb168d90eb723d6708ad8
diff --git a/user/tabs.php b/user/tabs.php index <HASH>..<HASH> 100644 --- a/user/tabs.php +++ b/user/tabs.php @@ -231,9 +231,9 @@ $secondrow = array(); $secondrow[] = new tabobject('assign', $CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$usercontext->id.'&amp;userid='.$user->id.'&amp;courseid='.$course->id - ,get_string('assignroles', 'role')); + ,get_string('localroles', 'role')); $secondrow[] = new tabobject('override', $CFG->wwwroot.'/'.$CFG->admin.'/roles/override.php?contextid='.$usercontext->id.'&amp;userid='.$user->id.'&amp;courseid='.$course->id - ,get_string('overrideroles', 'role')); + ,get_string('overridepermissions', 'role')); } }
MDL-<I>, keep roles tabs consistent, see tracker
moodle_moodle
train
php
cbbada6193f262ecb29ecefe12e28a7a056450cf
diff --git a/lib/opal/parser.rb b/lib/opal/parser.rb index <HASH>..<HASH> 100644 --- a/lib/opal/parser.rb +++ b/lib/opal/parser.rb @@ -652,7 +652,7 @@ module Opal f("'local-variable'", sexp) when :gvar gvar_name = part[1].to_s[1..-1] - f("($gvars.hasOwnProperty(#{gvar_name.inspect}) != null ? 'global-variable' : nil)", sexp) + f("(($gvars.hasOwnProperty(#{gvar_name.inspect}) != null) ? 'global-variable' : nil)", sexp) when :yield [f('( (', sexp), js_block_given(sexp, level), f(") != null ? 'yield' : nil)", sexp)] when :super
It's lisp right?
opal_opal
train
rb
537507285ace4cfa8c80993a74df149d826b43bc
diff --git a/holoviews/plotting/bokeh/plot.py b/holoviews/plotting/bokeh/plot.py index <HASH>..<HASH> 100644 --- a/holoviews/plotting/bokeh/plot.py +++ b/holoviews/plotting/bokeh/plot.py @@ -23,14 +23,6 @@ class BokehPlot(Plot): height = param.Integer(default=300) renderer = BokehRenderer - - def update(self, key): - """ - Update the internal state of the Plot to represent the given - key tuple (where integers represent frames). Returns this - state. - """ - return self.state @property def state(self): @@ -40,13 +32,13 @@ class BokehPlot(Plot): """ return self.handles['plot'] - def update(self, key): + def update(self, key, redraw=True): """ Update the internal state of the Plot to represent the given key tuple (where integers represent frames). Returns this state. """ - if not self.drawn: + if redraw: self.initialize_plot() return self.__getitem__(key)
BokehPlot.update now has redraw option
pyviz_holoviews
train
py
9ebf7d9496158bc83708e93f6901c48c8c6862dc
diff --git a/linguist/mixins.py b/linguist/mixins.py index <HASH>..<HASH> 100644 --- a/linguist/mixins.py +++ b/linguist/mixins.py @@ -236,9 +236,7 @@ class QuerySetMixin(object): grouped_translations[obj.object_id].append(obj) for instance in self: - instance.clear_translations_cache() - for translation in grouped_translations[instance.pk]: instance._linguist.set_cache(instance=instance, translation=translation) @@ -272,11 +270,27 @@ class ManagerMixin(object): """ Proxy for ``QuerySetMixin.activate_language()`` method. """ - self.get_queryset().active_language(language) + self.get_queryset().activate_language(language) class ModelMixin(object): + def prefetch_translations(self): + if not self.pk: + return + + from .models import Translation + + decider = self._meta.linguist.get('decider', Translation) + identifier = self._meta.linguist.get('identifier', None) + + if identifier is None: + raise Exception('You must define Linguist "identifier" meta option') + + translations = decider.objects.filter(identifier=identifier, object_id=self.pk) + for translation in translations: + self._linguist.set_cache(instance=self, translation=translation) + @property def linguist_identifier(self): """
Add prefetch_translations() for single instance.
ulule_django-linguist
train
py
6d3269b19a5929398c3d1b2faad6a3fb372733a5
diff --git a/redis/client.py b/redis/client.py index <HASH>..<HASH> 100644 --- a/redis/client.py +++ b/redis/client.py @@ -193,6 +193,19 @@ class Redis(object): self.errors = errors self.select(host, port, db, password) + #### Legacty accessors of connection information #### + def _get_host(self): + return self.connection.host + host = property(_get_host) + + def _get_port(self): + return self.connection.port + port = property(_get_port) + + def _get_db(self): + return self.connection.db + db = property(_get_db) + def pipeline(self): return Pipeline(self.connection, self.encoding, self.errors)
added accessors for host/port/db information off the current connection
andymccurdy_redis-py
train
py
005a461f46d92dd6398b72d92b3b3050b45ee3b5
diff --git a/annis-gui/src/main/java/annis/gui/querybuilder/TigerQueryBuilderCanvas.java b/annis-gui/src/main/java/annis/gui/querybuilder/TigerQueryBuilderCanvas.java index <HASH>..<HASH> 100644 --- a/annis-gui/src/main/java/annis/gui/querybuilder/TigerQueryBuilderCanvas.java +++ b/annis-gui/src/main/java/annis/gui/querybuilder/TigerQueryBuilderCanvas.java @@ -418,7 +418,7 @@ public class TigerQueryBuilderCanvas extends Panel if (nodeComponentCount++ > 0) { nodeIdentityOperations.append("\n& #").append(componentCount).append( - " = #").append(componentCount + 1); + " _=_ #").append(componentCount + 1); query.append(" & "); componentCount++; }
fixed a small bug in qb identical coverage "identical coverage" operator was = but should be _=_
korpling_ANNIS
train
java
8209267a0b12f53aa78cecf7856a79348e62aeae
diff --git a/src/Namespaces/ItemsNamespace.php b/src/Namespaces/ItemsNamespace.php index <HASH>..<HASH> 100644 --- a/src/Namespaces/ItemsNamespace.php +++ b/src/Namespaces/ItemsNamespace.php @@ -42,18 +42,16 @@ class ItemsNamespace extends AbstractNamespace /** * @param string $ean * @param array $embedded - * @param int $limit - * @param int $offset - * @return Cursor|ItemWithEmbeddedTransfer[] + * @return ItemWithEmbeddedTransfer|null */ - public function findByEan($ean, $embedded = null, $limit = 30, $offset = 0) + public function findByEan($ean, array $embedded = null) { - return $this->buildFind() + $list = $this->buildFind() ->addParam('ean', $ean) ->addParam('embedded', $embedded) - ->setLimit($limit) - ->setOffset($offset) ->find(); + + return $list->total() ? $list->current() : null; } /**
Fix findByEan method so that it returns either Item or null
hitmeister_api-sdk-php
train
php
30a2850267f8c791f518317d60883300fcfcb6dc
diff --git a/lib/websession_webinterface.py b/lib/websession_webinterface.py index <HASH>..<HASH> 100644 --- a/lib/websession_webinterface.py +++ b/lib/websession_webinterface.py @@ -693,7 +693,7 @@ class WebInterfaceYourAccountPages(WebInterfaceDirectory): # login successful! if args['referer']: - redirect_to_url(req, args['referer']) + redirect_to_url(req, args['referer'], apache.HTTP_MOVED_TEMPORARILY) else: return self.display(req, form) else:
Using HTTP_MOVED_TEMPORARILY when successful login (otherwise FireFox complains with HTTP_TEMPORARY_REDIRECT that it have to resend form information to a new URL.
inveniosoftware_invenio-accounts
train
py
866ff89e862d5e06cb71781485ec15c7a4dfb1b3
diff --git a/lib/govuk_app_config.rb b/lib/govuk_app_config.rb index <HASH>..<HASH> 100644 --- a/lib/govuk_app_config.rb +++ b/lib/govuk_app_config.rb @@ -6,9 +6,9 @@ require "govuk_app_config/govuk_i18n" # This require is deprecated and should be removed on next major version bump # and should be required by applications directly. require "govuk_app_config/govuk_unicorn" -require "govuk_app_config/govuk_prometheus_exporter" if defined?(Rails) + require "govuk_app_config/govuk_prometheus_exporter" require "govuk_app_config/govuk_logging" require "govuk_app_config/govuk_content_security_policy" require "govuk_app_config/railtie"
Use GovukPrometheusExport for only Rails apps The initialiser modules loads middleware into Rack and explicity depends on Rails being present.
alphagov_govuk_app_config
train
rb
4c105239fab0220ec66fc034263df740c5d12d4f
diff --git a/src/Core/Application.php b/src/Core/Application.php index <HASH>..<HASH> 100644 --- a/src/Core/Application.php +++ b/src/Core/Application.php @@ -1397,14 +1397,37 @@ class Application extends Container implements ApplicationContract, HttpKernelIn return $this; } - $this['action']->add('admin_init', function () use ($kernel, $request) { + $this['action']->add('admin_init', $this->dispatchToAdmin($kernel, $request)); + + return $this; + } + + /** + * Manage WordPress Admin Init. + * Handle incoming request and return a response. + * + * @param string $kernel + * @param $request + * + * @return Closure + */ + protected function dispatchToAdmin(string $kernel, $request) + { + return function () use ($kernel, $request) { $kernel = $this->make($kernel); + /** @var Response $response */ $response = $kernel->handle($request); - $response->sendHeaders(); - }); - return $this; + if (500 <= $response->getStatusCode()) { + // In case of an internal server error, we stop the process + // and send full response back to the user. + $response->send(); + } else { + // HTTP OK - Send only the response headers.s + $response->sendHeaders(); + } + }; } /**
Send error response if administration route failed.
themosis_framework
train
php
222af1f10d80938cbec5ff0165c5a25456e014b0
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ except ImportError: # Python version and OS. REQUIRED_PACKAGES = [ 'httplib2>=0.8', - 'oauth2client>=1.2', + 'oauth2client>=1.4.8', 'protorpc>=0.9.1', 'six>=1.8.0', ]
Set a minimum required oauth2client version. This ensures we pick up recent fixes for better `body` handling on <I> when `body` is a stream.
google_apitools
train
py
a3201c9d6b308485d3ccd041dcb2da9683585aaf
diff --git a/ET_Client.php b/ET_Client.php index <HASH>..<HASH> 100644 --- a/ET_Client.php +++ b/ET_Client.php @@ -58,7 +58,7 @@ class ET_Client extends SoapClient { $url = "https://www.exacttargetapis.com/platform/v1/endpoints/soap?access_token=".$this->getAuthToken($this->tenantKey); $endpointResponse = restGet($url); $endpointObject = json_decode($endpointResponse->body); - if ($endpointResponse && property_exists($endpointObject,"url")){ + if ($endpointObject && property_exists($endpointObject,"url")){ $this->endpoint = $endpointObject->url; } else { throw new Exception('Unable to determine stack using /platform/v1/endpoints/:'.$endpointResponse->body);
Fix ET_Client::__construct incorrectly checking the response object instead of the response body for an endpoint
salesforce-marketingcloud_FuelSDK-PHP
train
php
58d3a6a0bbb4b2662417a7f5651a584aa9e80ea9
diff --git a/components/html/html.php b/components/html/html.php index <HASH>..<HASH> 100644 --- a/components/html/html.php +++ b/components/html/html.php @@ -67,7 +67,7 @@ class Component_html extends Component { } $args['pagenum'] = any($analytics->pandora_result['page_num'], 1); - $args['version'] = $webapp->getAppVersion(); + $args['version'] = (!empty($webapp) ? $webapp->getAppVersion() : "unknown"); $args['filters'] = $analytics->qpmreq->filter['brand'] ? '1' : '0'; $args['filters'] .= $analytics->qpmreq->filter['color'] ? '1' : '0'; $args['filters'] .= $analytics->qpmreq->filter['storeswithdeals'] ? '1' : '0'; //(coupons)
- Fix error in html component when called from command line
jbaicoianu_elation
train
php
a4b8ef29863932b9a052a073604dab076e5061ec
diff --git a/test/genomeintervaltree_test.py b/test/genomeintervaltree_test.py index <HASH>..<HASH> 100644 --- a/test/genomeintervaltree_test.py +++ b/test/genomeintervaltree_test.py @@ -39,14 +39,12 @@ def test_knownGene(): def test_ensGene(): # Smoke-test we can at least read ensGene. ensGene_url = 'http://hgdownload.cse.ucsc.edu/goldenpath/hg19/database/ensGene.txt.gz' - ensGene_url = 'http://kt.era.ee/distribute/pyintervaltree/ensGene.txt.gz' ensGene = GenomeIntervalTree.from_table(url=ensGene_url, mode='cds', parser=UCSCTable.ENS_GENE) assert len(ensGene) == 204940 def test_refGene(): # Smoke-test for refGene refGene_url = 'http://hgdownload.cse.ucsc.edu/goldenpath/hg19/database/refGene.txt.gz' - refGene_url = 'http://kt.era.ee/distribute/pyintervaltree/refGene.txt.gz' refGene = GenomeIntervalTree.from_table(url=refGene_url, mode='tx', parser=UCSCTable.REF_GENE) assert len(refGene) == 52289 # NB: Some time ago it was 50919, hence it seems the table data changes on UCSC and eventually the mirror and UCSC won't be the same.
removed other broken urls from genome test
chaimleib_intervaltree
train
py
9556eaf30a3bd81dffab2e11b97b8b44a2710358
diff --git a/src/Graviton/RestBundle/Routing/Loader/BasicLoader.php b/src/Graviton/RestBundle/Routing/Loader/BasicLoader.php index <HASH>..<HASH> 100644 --- a/src/Graviton/RestBundle/Routing/Loader/BasicLoader.php +++ b/src/Graviton/RestBundle/Routing/Loader/BasicLoader.php @@ -5,7 +5,7 @@ namespace Graviton\RestBundle\Routing\Loader; -use Symfony\Component\Config\Loader\Loader; +use Graviton\CoreBundle\Routing\RouteLoaderAbstract; use Symfony\Component\Routing\RouteCollection; /** @@ -15,7 +15,7 @@ use Symfony\Component\Routing\RouteCollection; * @license https://opensource.org/licenses/MIT MIT License * @link http://swisscom.ch */ -class BasicLoader extends Loader +class BasicLoader extends RouteLoaderAbstract { /** * @var boolean @@ -68,6 +68,16 @@ class BasicLoader extends Loader } /** + * returns the name of the resource to load + * + * @return string resource name + */ + public function getResourceName() + { + return 'rest'; + } + + /** * load routes for a single service * * @param string $service service name
change our loader to our new abstract
libgraviton_graviton
train
php
293feeb522b2fb1137c56887aba823cbf5e99df5
diff --git a/framework/db/QueryInterface.php b/framework/db/QueryInterface.php index <HASH>..<HASH> 100644 --- a/framework/db/QueryInterface.php +++ b/framework/db/QueryInterface.php @@ -100,7 +100,7 @@ interface QueryInterface * The method will *not* do any quoting or escaping. * * - **or**: similar to the `and` operator except that the operands are concatenated using `OR`. For example, - * `['or', ['type' => [7, 8, 9]], ['id' => [1, 2, 3]]` will generate `(type IN (7, 8, 9) OR (id IN (1, 2, 3)))`. + * `['or', ['type' => [7, 8, 9]], ['id' => [1, 2, 3]]]` will generate `(type IN (7, 8, 9) OR (id IN (1, 2, 3)))`. * * - **not**: this will take only one operand and build the negation of it by prefixing the query string with `NOT`. * For example `['not', ['attribute' => null]]` will result in the condition `NOT (attribute IS NULL)`.
Update QueryInterface.php Missing closing bracket in OR condition example
yiisoft_yii2
train
php
38ef9aca28a2358d8dbc20bebafd6613cf195872
diff --git a/lib/api/manipulation.js b/lib/api/manipulation.js index <HASH>..<HASH> 100644 --- a/lib/api/manipulation.js +++ b/lib/api/manipulation.js @@ -15,21 +15,9 @@ var removeChild = function(parent, elem) { parsing strings if necessary */ var makeCheerioArray = function(elems) { - var dom = [], - len = elems.length, - elem; - - for (var i = 0; i < len; i++) { - elem = elems[i]; - // If a cheerio object - if (elem.cheerio) { - dom = dom.concat(elem.toArray()); - } else { - dom = dom.concat($.parse.eval(elem)); - } - } - - return dom; + return _.reduce(elems, function(dom, elem) { + return dom.concat(elem.cheerio ? elem.toArray() : $.parse.eval(elem)); + }, []); }; var append = exports.append = function() {
manipulation: refactor `makeCheerioArray`
oyyd_cheerio-without-node-native
train
js
2ab328d8ee7368f61fdbf73b81f4b55eebab51eb
diff --git a/ores/__init__.py b/ores/__init__.py index <HASH>..<HASH> 100644 --- a/ores/__init__.py +++ b/ores/__init__.py @@ -1 +1 @@ -__version__ = "0.7.1" +__version__ = "0.7.2" diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ def requirements(fname): setup( name="ores", - version="0.7.1", # Update in ores/__init__.py too. + version="0.7.2", # Update in ores/__init__.py too. author="Aaron Halfaker", author_email="ahalfaker@wikimedia.org", description=("A webserver for hosting scorer models."),
Increments version to <I>
wikimedia_ores
train
py,py
f105bc0c885eb4056699bd2f0c09e6492a6f6b6a
diff --git a/src/views/rrd/_search.php b/src/views/rrd/_search.php index <HASH>..<HASH> 100644 --- a/src/views/rrd/_search.php +++ b/src/views/rrd/_search.php @@ -39,3 +39,13 @@ use yii\helpers\Html; <div class="col-md-2"> <?= $search->field('shift') ?> </div> + +<?php +$widgetId = $search->getDivId(); + +$this->registerJs(<<<JS + $('#form-$widgetId').on('change', 'input[type="radio"]', function (event) { + $(this).submit(); + }); +JS +);
RRD view - autosubmit on radio filters change
hiqdev_hipanel-module-server
train
php
9c033c21f32ef6a545ed49ed939d4fbd4b950aab
diff --git a/src/Illuminate/Hashing/BcryptHasher.php b/src/Illuminate/Hashing/BcryptHasher.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Hashing/BcryptHasher.php +++ b/src/Illuminate/Hashing/BcryptHasher.php @@ -63,7 +63,7 @@ class BcryptHasher implements HasherContract public function needsRehash($hashedValue, array $options = []) { return password_needs_rehash($hashedValue, PASSWORD_BCRYPT, [ - 'cost' => isset($options['rounds']) ? $options['rounds'] : $this->rounds + 'cost' => isset($options['rounds']) ? $options['rounds'] : $this->rounds, ]); }
Apply fixes from StyleCI (#<I>)
laravel_framework
train
php
2be27f8939b385734e723839fabee47d27e1dd81
diff --git a/test/lib/rubycritic/generators/console_report_test.rb b/test/lib/rubycritic/generators/console_report_test.rb index <HASH>..<HASH> 100644 --- a/test/lib/rubycritic/generators/console_report_test.rb +++ b/test/lib/rubycritic/generators/console_report_test.rb @@ -28,15 +28,15 @@ describe RubyCritic::Generator::ConsoleReport do assert output_contains?('Rating', @mock_analysed_module.rating) end - it "includes the module's rating in the report" do + it "includes the module's churn metric in the report" do assert output_contains?('Churn', @mock_analysed_module.churn) end - it "includes the module's rating in the report" do + it "includes the module's complexity in the report" do assert output_contains?('Complexity', @mock_analysed_module.complexity) end - it "includes the module's rating in the report" do + it "includes the module's duplication metric in the report" do assert output_contains?('Duplication', @mock_analysed_module.duplication) end
Spec: Fix copy-pasted titles of "it" cases
whitesmith_rubycritic
train
rb
3b3b6c3c45ab5c6c9be70a01a5b7ee6cd65dcad1
diff --git a/lib/MountFs.js b/lib/MountFs.js index <HASH>..<HASH> 100644 --- a/lib/MountFs.js +++ b/lib/MountFs.js @@ -52,7 +52,7 @@ var MountFs = module.exports = function MountFs(options) { } var args = [].slice.call(arguments); args[0] = path; - if (/Sync$/.test(fsMethodName)) { + if (/(Sync|Stream)$/.test(fsMethodName)) { try { return mountedFs[fsMethodName].apply(this, args); } catch (err) {
handle createReadStream et.al. like Sync methods ie methods not taking a callback. fixes unexpected-fs, express, send, express-jsxtransform
papandreou_node-mountfs
train
js
6385ad52bbddda2675b312b406533e525650f752
diff --git a/packages/ember-metal/lib/computed.js b/packages/ember-metal/lib/computed.js index <HASH>..<HASH> 100644 --- a/packages/ember-metal/lib/computed.js +++ b/packages/ember-metal/lib/computed.js @@ -359,6 +359,39 @@ ComputedPropertyPrototype.get = function(obj, keyName) { Generally speaking if you intend for your computed property to be set your backing function should accept either two or three arguments. + ```javascript + var Person = Ember.Object.extend({ + // these will be supplied by `create` + firstName: null, + lastName: null, + + fullName: function(key, value, oldValue) { + // getter + if (arguments.length === 1) { + var firstName = this.get('firstName'); + var lastName = this.get('lastName'); + + return firstName + ' ' + lastName; + + // setter + } else { + var name = value.split(' '); + + this.set('firstName', name[0]); + this.set('lastName', name[1]); + + return value; + } + }.property('firstName', 'lastName') + }); + + var person = Person.create(); + + person.set('fullName', 'Peter Wagenet'); + person.get('firstName'); // 'Peter' + person.get('lastName'); // 'Wagenet' + ``` + @method set @param {String} keyName The key being accessed. @param {Object} newValue The new value being assigned.
[DOC] add example to computed properties set in API
emberjs_ember.js
train
js
f550203449a2a243f3f72d5b96387e6e46dffbda
diff --git a/src/main/java/org/craftercms/engine/util/spring/cors/SiteAwareCorsConfigurationSource.java b/src/main/java/org/craftercms/engine/util/spring/cors/SiteAwareCorsConfigurationSource.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/craftercms/engine/util/spring/cors/SiteAwareCorsConfigurationSource.java +++ b/src/main/java/org/craftercms/engine/util/spring/cors/SiteAwareCorsConfigurationSource.java @@ -22,9 +22,10 @@ import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.CorsConfigurationSource; import javax.servlet.http.HttpServletRequest; +import java.util.Arrays; import java.util.List; -import static java.util.Arrays.asList; +import static java.util.stream.Collectors.toList; /** * Implementation of {@link CorsConfigurationSource} that uses the current site configuration @@ -89,7 +90,7 @@ public class SiteAwareCorsConfigurationSource implements CorsConfigurationSource } protected List<String> getValues(HierarchicalConfiguration<?> config, String key, String defaultValue) { - return asList(config.getString(key, defaultValue).split(",")); + return Arrays.stream(config.getString(key, defaultValue).split(",")).map(String::trim).collect(toList()); } }
Fix issue with empty spaces in CORS config
craftercms_engine
train
java
555d4adbb016b92e6c1739ff23a56bf8ef74e8e9
diff --git a/Generator/Plugin.php b/Generator/Plugin.php index <HASH>..<HASH> 100644 --- a/Generator/Plugin.php +++ b/Generator/Plugin.php @@ -142,6 +142,20 @@ class Plugin extends PHPClassFileWithInjection { 'parent_plugin_id' => [ 'label' => 'Parent class plugin ID', 'description' => "Use another plugin's class as the parent class for this plugin.", + 'validation' => function($property_name, $property_info, $component_data) { + if (!empty($component_data['parent_plugin_id'])) { + // TODO: go via the environment for testing! + try { + $plugin_definition = \Drupal::service('plugin.manager.' . $component_data['plugin_type'])->getDefinition($component_data['parent_plugin_id']); + } + catch (\Drupal\Component\Plugin\Exception\PluginNotFoundException $plugin_exception) { + return ["There is no plugin '@plugin-id' of type '@plugin-type'.", [ + '@plugin-id' => $component_data['parent_plugin_id'], + '@plugin-type' => $component_data['plugin_type'] + ]]; + } + } + }, ], 'replace_parent_plugin' => [ 'label' => 'Replace parent plugin',
Added validation of annotation plugin generator's parent plugin ID property.
drupal-code-builder_drupal-code-builder
train
php
b27a3aff35bf2a7515d4236afe191a7c63481a23
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -250,8 +250,14 @@ module ActionDispatch if controller.is_a? Regexp hash[:controller] = controller else - check_controller! controller - hash[:controller] = controller.to_s if controller + if controller + hash[:controller] = check_controller!(controller).to_s + else + unless segment_keys.include?(:controller) + message = "Missing :controller key on routes definition, please check your routes." + raise ArgumentError, message + end + end end if action.is_a? Regexp @@ -292,13 +298,7 @@ module ActionDispatch end def check_controller!(controller) - unless controller || segment_keys.include?(:controller) - message = "Missing :controller key on routes definition, please check your routes." - raise ArgumentError, message - end - - return unless controller - return if controller =~ /\A[a-z_0-9][a-z_0-9\/]*\z/ + return controller if controller =~ /\A[a-z_0-9][a-z_0-9\/]*\z/ if controller =~ %r{\A/} message = "controller name should not start with a slash"
only do one nil check against the controller
rails_rails
train
rb
844e8fd944eb4c7c7299ef414e8c36e1e18ea062
diff --git a/spyderlib/widgets/calltip.py b/spyderlib/widgets/calltip.py index <HASH>..<HASH> 100644 --- a/spyderlib/widgets/calltip.py +++ b/spyderlib/widgets/calltip.py @@ -273,7 +273,7 @@ class CallTipWidget(QLabel): """ Hides the tooltip after some time has passed (assuming the cursor is not over the tooltip). """ - if (not self._hide_timer.isActive() and + if (self.hide_timer_on and not self._hide_timer.isActive() and # If Enter events always came after Leave events, we wouldn't need # this check. But on Mac OS, it sometimes happens the other way # around when the tooltip is created.
Calltip: Don't hide it if the cursor leaves the tooltip and there's no timer
spyder-ide_spyder
train
py
a9f099ad39241f28f5323c3ae60ba457549f46d2
diff --git a/devices.js b/devices.js index <HASH>..<HASH> 100755 --- a/devices.js +++ b/devices.js @@ -13405,6 +13405,18 @@ const devices = [ { fingerprint: [ {type: 'Router', manufacturerName: 'AwoX', modelID: 'TLSR82xx', endpoints: [ + {ID: 1, profileID: 260, deviceID: 258, inputClusters: [0, 3, 4, 5, 6, 8, 768, 4096], outputClusters: [6, 25]}, + {ID: 3, profileID: 49152, deviceID: 258, inputClusters: [65360, 65361], outputClusters: [65360, 65361]}, + ]}, + ], + model: '33943', + vendor: 'AwoX', + description: 'LED RGB & brightness', + extend: preset.light_onoff_brightness_colortemp_color(), + }, + { + fingerprint: [ + {type: 'Router', manufacturerName: 'AwoX', modelID: 'TLSR82xx', endpoints: [ {ID: 1, profileID: 260, deviceID: 269, inputClusters: [0, 3, 4, 5, 6, 8, 768, 4096, 64599], outputClusters: [6]}, {ID: 3, profileID: 4751, deviceID: 269, inputClusters: [65360, 65361], outputClusters: [65360, 65361]}, ]},
Adding awox <I> (#<I>) * Added support for AwoX <I> * Removed unsupported feature * Added fingerprint * Added space after ',' * Removed trailing spaces. * Updating fingerprint * Update devices.js * Review fixes
Koenkk_zigbee-shepherd-converters
train
js
ab1388a253b10628ed7d559c8ab649de43261f6d
diff --git a/lib/nerve/reporter/zookeeper.rb b/lib/nerve/reporter/zookeeper.rb index <HASH>..<HASH> 100644 --- a/lib/nerve/reporter/zookeeper.rb +++ b/lib/nerve/reporter/zookeeper.rb @@ -70,7 +70,7 @@ class Nerve::Reporter end def ping? - return @zk.ping? + return @zk.connected? && @zk.exists?(@full_key || '/') end private diff --git a/lib/nerve/service_watcher.rb b/lib/nerve/service_watcher.rb index <HASH>..<HASH> 100644 --- a/lib/nerve/service_watcher.rb +++ b/lib/nerve/service_watcher.rb @@ -87,7 +87,11 @@ module Nerve end def check_and_report - @reporter.ping? + if !@reporter.ping? + # If the reporter can't ping, then we do not know the status + # and must force a new report. + @was_up = nil + end # what is the status of the service? is_up = check?
Fix bug in session disconnects with pooling If we get a session disconnect we need to ensure that nerve recreates the ephemeral nodes when it reconnects.
airbnb_nerve
train
rb,rb
7b44b8aeceb445fd0f59a85f8bbf9527c3898954
diff --git a/cmd/geth/main.go b/cmd/geth/main.go index <HASH>..<HASH> 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -48,9 +48,9 @@ import ( const ( ClientIdentifier = "Geth" - Version = "1.2.0-dev" + Version = "1.3.0-dev" VersionMajor = 1 - VersionMinor = 2 + VersionMinor = 3 VersionPatch = 0 )
cmd/geth: dev version number
ethereum_go-ethereum
train
go
68caab7a3c1c7543e4bb1d5c5a5199bcded49077
diff --git a/geoplot/geoplot.py b/geoplot/geoplot.py index <HASH>..<HASH> 100644 --- a/geoplot/geoplot.py +++ b/geoplot/geoplot.py @@ -1317,14 +1317,14 @@ def kdeplot( if self.projection: sns.kdeplot( - pd.Series([p.x for p in self.df.geometry]), - pd.Series([p.y for p in self.df.geometry]), + x=pd.Series([p.x for p in self.df.geometry]), + y=pd.Series([p.y for p in self.df.geometry]), transform=ccrs.PlateCarree(), ax=ax, cmap=self.cmap, **self.kwargs ) else: sns.kdeplot( - pd.Series([p.x for p in self.df.geometry]), - pd.Series([p.y for p in self.df.geometry]), + x=pd.Series([p.x for p in self.df.geometry]), + y=pd.Series([p.y for p in self.df.geometry]), ax=ax, cmap=self.cmap, **self.kwargs ) return ax
Set explicit x/y params in KDEPlot (#<I>)
ResidentMario_geoplot
train
py
3604710facaacc6feb9c8a0a4f236dce7aa61196
diff --git a/server/sonar-server/src/test/java/org/sonar/server/tester/ServerTester.java b/server/sonar-server/src/test/java/org/sonar/server/tester/ServerTester.java index <HASH>..<HASH> 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/tester/ServerTester.java +++ b/server/sonar-server/src/test/java/org/sonar/server/tester/ServerTester.java @@ -98,16 +98,6 @@ public class ServerTester extends ExternalResource { Properties properties = new Properties(); properties.putAll(initialProps); - try { - searchServer.start(); - System.out.println("searchServer = " + searchServer.isReady()); - while (!searchServer.isReady()) { - Thread.sleep(100); - } - } catch (Exception e) { - e.printStackTrace(); - } - properties.setProperty(IndexProperties.CLUSTER_NAME, clusterName); properties.setProperty(IndexProperties.NODE_PORT, clusterPort.toString()); properties.setProperty(MonitoredProcess.NAME_PROPERTY, "ES"); @@ -121,6 +111,7 @@ public class ServerTester extends ExternalResource { } } + searchServer.start(); platform.init(properties); platform.addComponents(components); platform.doStart();
No need to wait for ES in non-blocking mode (start returns when node is started)
SonarSource_sonarqube
train
java
7986b5dcedc600b0633e582a79ec32cd8918c36e
diff --git a/src/kit/app/SchemaDrivenCommandManager.js b/src/kit/app/SchemaDrivenCommandManager.js index <HASH>..<HASH> 100644 --- a/src/kit/app/SchemaDrivenCommandManager.js +++ b/src/kit/app/SchemaDrivenCommandManager.js @@ -65,7 +65,6 @@ export default class SchemaDrivenCommandManager extends CommandManager { // to a non existing node // If really needed we should document why, and in which case. if (!node) { - // FIXME: explain when this happens.' throw new Error('FIXME: explain when this happens') } @@ -99,10 +98,12 @@ export default class SchemaDrivenCommandManager extends CommandManager { } function _getNodeProp (node, path) { - let propName = last(path) - let prop = node.getSchema().getProperty(propName) - if (!prop) console.error('Could not find property for path', path, node) - return prop + if (path.length === 2) { + let propName = last(path) + let prop = node.getSchema().getProperty(propName) + if (!prop) console.error('Could not find property for path', path, node) + return prop + } } function _disabled (commands) {
Let SchemaDrivenCommandManager treat NodeSelections correctly.
substance_texture
train
js
bbb7f8bf522960a8ca7625f539e9e5d109abb704
diff --git a/sos/report/plugins/networking.py b/sos/report/plugins/networking.py index <HASH>..<HASH> 100644 --- a/sos/report/plugins/networking.py +++ b/sos/report/plugins/networking.py @@ -156,7 +156,8 @@ class Networking(Plugin): "ethtool --phy-statistics " + eth, "ethtool --show-priv-flags " + eth, "ethtool --show-eee " + eth, - "tc -s filter show dev " + eth + "tc -s filter show dev " + eth, + "tc -s filter show dev " + eth + " ingress", ], tags=eth) # skip EEPROM collection by default, as it might hang or
[networking] collect also tc filter show ingress Both "tc -s filter show dev %eth [|ingress]" commands required as they provide different output. Resolves: #<I>
sosreport_sos
train
py
7fba3568c43f931f9f524ddd26b8c736e0352f46
diff --git a/lib/ansible/vault.rb b/lib/ansible/vault.rb index <HASH>..<HASH> 100644 --- a/lib/ansible/vault.rb +++ b/lib/ansible/vault.rb @@ -10,5 +10,9 @@ module Ansible @path = path @password = password end + + def inspect + %Q{#<Ansible::Vault:#{"0x00%x" % (object_id << 1)} @path="#{@path}", @password="#{@password[0,4]}...">} + end end end diff --git a/spec/ansible/vault_spec.rb b/spec/ansible/vault_spec.rb index <HASH>..<HASH> 100644 --- a/spec/ansible/vault_spec.rb +++ b/spec/ansible/vault_spec.rb @@ -13,5 +13,15 @@ module Ansible end end + describe '#inspect' do + let(:vault) { + Vault.new(path: fixture_path('blank.yml'), password: 'this-is-the-password') + } + + it 'must include only the first 4 characters of the password followed by elipses' do + expect(vault.inspect).to_not include 'this-is-the-password' + expect(vault.inspect).to include 'this...' + end + end end end
Ensure we're not leaking passwords to error logs and the like
tpickett66_ansible-vault-rb
train
rb,rb
5cf3b5fc8aad6ea80317ddbe9267a41afc2e8bda
diff --git a/RTEditor/src/main/java/com/onegravity/rteditor/fonts/AssetIndex.java b/RTEditor/src/main/java/com/onegravity/rteditor/fonts/AssetIndex.java index <HASH>..<HASH> 100644 --- a/RTEditor/src/main/java/com/onegravity/rteditor/fonts/AssetIndex.java +++ b/RTEditor/src/main/java/com/onegravity/rteditor/fonts/AssetIndex.java @@ -49,7 +49,7 @@ abstract class AssetIndex { mAssetIndex.add(line); } } catch (final IOException e) { - Log.e(AssetIndex.class.getSimpleName(), e.getMessage(), e); + Log.w(AssetIndex.class.getSimpleName(), "The assets.index file could not be read. If you want to use your own fonts, please copy the fonts to the assets folder and the build code to generate the assets.index file into your build.gradle (for more details consult the readme, chapter fonts)", e); } finally { IOUtils.closeQuietly(in); IOUtils.closeQuietly(reader);
more meaningful log output message if the assets.index file is missing
1gravity_Android-RTEditor
train
java
96026e8204b8c5acfba21b8c1de417460e43c2f8
diff --git a/spec/wings/active_fedora_converter_spec.rb b/spec/wings/active_fedora_converter_spec.rb index <HASH>..<HASH> 100644 --- a/spec/wings/active_fedora_converter_spec.rb +++ b/spec/wings/active_fedora_converter_spec.rb @@ -21,6 +21,22 @@ RSpec.describe Wings::ActiveFedoraConverter, :clean_repo do expect(converter.convert).to eq work end + context 'fedora objState' do + let(:resource) { build(:hyrax_work) } + + it 'is active by default' do + expect(converter.convert) + .to have_attributes state: Hyrax::ResourceStatus::ACTIVE + end + + it 'converts non-active states' do + resource.state = Hyrax::ResourceStatus::INACTIVE + + expect(converter.convert) + .to have_attributes state: Hyrax::ResourceStatus::INACTIVE + end + end + context 'when given a valkyrie native model' do let(:resource) { klass.new }
[wings] Test state conversion with ActiveFedoraConverter
samvera_hyrax
train
rb
c9bc68d966766814c55c2bbdc5fe6e22e8120598
diff --git a/genericm2m/models.py b/genericm2m/models.py index <HASH>..<HASH> 100644 --- a/genericm2m/models.py +++ b/genericm2m/models.py @@ -127,12 +127,12 @@ class RelatedObjectsDescriptor(object): uses_gfk = self.is_gfk(rel_field) class RelatedManager(superclass): - def get_query_set(self): + def get_queryset(self): if uses_gfk: qs = GFKOptimizedQuerySet(self.model, gfk_field=rel_field) return qs.filter(**(core_filters)) else: - return superclass.get_query_set(self).filter(**(core_filters)) + return superclass.get_queryset(self).filter(**(core_filters)) def add(self, *objs): for obj in objs: @@ -183,7 +183,7 @@ class RelatedObjectsDescriptor(object): ) def symmetrical(self): - return superclass.get_query_set(self).filter( + return superclass.get_queryset(self).filter( Q(**rel_obj.get_query_from(instance)) | Q(**rel_obj.get_query_to(instance)) ).distinct()
Rename to `get_queryset` > RemovedInDjango<I>Warning: `BaseManager.get_query_set` is deprecated, use `get_queryset` instead. and > RemovedInDjango<I>Warning: `RelatedManager.get_query_set` method should be renamed `get_queryset`.
coleifer_django-generic-m2m
train
py
9156324e1bb32f6ca44ca790ba9da9d1881c5e57
diff --git a/config/routes.rb b/config/routes.rb index <HASH>..<HASH> 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -435,7 +435,7 @@ Src::Application.routes.draw do end end - resources :system_groups do + resources :system_groups, :except => [:new, :edit] do member do post :lock post :unlock
system group - Adds support for locking and unlocking a system group in the CLI
Katello_katello
train
rb