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
08901e56993adb401b60e237cbe0c43741f9fdd8
diff --git a/src/Graviton/ProxyBundle/Definition/ApiDefinition.php b/src/Graviton/ProxyBundle/Definition/ApiDefinition.php index <HASH>..<HASH> 100644 --- a/src/Graviton/ProxyBundle/Definition/ApiDefinition.php +++ b/src/Graviton/ProxyBundle/Definition/ApiDefinition.php @@ -129,7 +129,7 @@ class ApiDefinition * * @param boolean $withHost url with hostname * @param string $prefix add a prefix to the url (blub/endpoint/url) - * @param string $host + * @param string $host Host to be used instead of the host defined in the swagger json * * @return array */
Added missing descriptoin in docblock
libgraviton_graviton
train
php
a734d4b981df356d2aace115471983d0fbb319e5
diff --git a/src/AwsS3V3/AwsS3V3Adapter.php b/src/AwsS3V3/AwsS3V3Adapter.php index <HASH>..<HASH> 100644 --- a/src/AwsS3V3/AwsS3V3Adapter.php +++ b/src/AwsS3V3/AwsS3V3Adapter.php @@ -44,6 +44,7 @@ class AwsS3V3Adapter implements FilesystemAdapter 'ContentEncoding', 'ContentLength', 'ContentType', + 'ContentMD5', 'Expires', 'GrantFullControl', 'GrantRead',
Adding `ContentMD5` option to `AVAILABLE_OPTIONS` array his proposed change is adding `ContentMD5` option to `AVAILABLE_OPTIONS` array. Without this option in the array it is impossible to upload file on file lock enabled S3.
thephpleague_flysystem
train
php
6c29671bf816d2a2115f03a0ff76d7aca78cce4a
diff --git a/lib/cld3.rb b/lib/cld3.rb index <HASH>..<HASH> 100644 --- a/lib/cld3.rb +++ b/lib/cld3.rb @@ -76,7 +76,7 @@ module CLD3 # The arguments are two Numeric objects. def initialize(min_num_bytes = MIN_NUM_BYTES_TO_CONSIDER, max_num_bytes = MAX_NUM_BYTES_TO_CONSIDER) - raise ArgumentError if max_num_bytes <= 0 || min_num_bytes < 0 || min_num_bytes >= max_num_bytes + raise ArgumentError if min_num_bytes < 0 || min_num_bytes >= max_num_bytes @cc = Unstable::NNetLanguageIdentifier::Pointer.new(Unstable.new_NNetLanguageIdentifier(min_num_bytes, max_num_bytes)) end
Accept 0 as min_num_bytes
akihikodaki_cld3-ruby
train
rb
b6f664ff45f3986d8087d16d5e7cef6c91307e52
diff --git a/gflex/base.py b/gflex/base.py index <HASH>..<HASH> 100644 --- a/gflex/base.py +++ b/gflex/base.py @@ -687,7 +687,13 @@ class Flexure(Utility, Plotting): # Finalize def finalize(self): - # Just print a line to stdout + # Can include an option for this later, but for the moment, this will + # clear the coefficient array so it doens't cause problems for model runs + # searching for the proper rigidity + try: + del self.coeff_matrix + except: + pass if self.Quiet==False: print ""
Clear coeff_matrix during finalize() to allow Te to change between runs
awickert_gFlex
train
py
7394e750cbb646baaa52eb8c303674b250c3119e
diff --git a/sources/scalac/transformer/ExplicitOuterClasses.java b/sources/scalac/transformer/ExplicitOuterClasses.java index <HASH>..<HASH> 100644 --- a/sources/scalac/transformer/ExplicitOuterClasses.java +++ b/sources/scalac/transformer/ExplicitOuterClasses.java @@ -153,6 +153,9 @@ public class ExplicitOuterClasses extends Transformer { } case Ident(Name name): { + if (! name.isTermName()) + return super.transform(tree); + // Follow "outer" links to fetch data in outer classes. Symbol sym = tree.symbol(); Symbol owner = sym.classOwner();
- bug fix: do not use outer links to access typ... - bug fix: do not use outer links to access type parameters of outer classes
scala_scala
train
java
747e7ba843e85422ac9e9d13eb6fef4e8610abf7
diff --git a/zappa/zappa.py b/zappa/zappa.py index <HASH>..<HASH> 100644 --- a/zappa/zappa.py +++ b/zappa/zappa.py @@ -344,7 +344,8 @@ class Zappa(object): return None return venv - def contains_python_files_or_subdirs(self, filename, dirs, files): + @staticmethod + def contains_python_files_or_subdirs(dirs, files): return len(dirs) > 0 or len([filename for filename in files if filename.endswith('.py') or filename.endswith('.pyc')]) > 0 def create_lambda_zip( self, @@ -541,7 +542,7 @@ class Zappa(object): with open(os.path.join(root, filename), 'rb') as f: zipf.writestr(zipi, f.read(), compression_method) - if '__init__.py' not in files and self.contains_python_files_or_subdirs(filename, dirs, files): + if '__init__.py' not in files and self.contains_python_files_or_subdirs(dirs, files): tmp_init = os.path.join(temp_project_path, '__init__.py') open(tmp_init, 'a').close() os.chmod(tmp_init, 0o755)
Small cleanup: static method and removed unused var
Miserlou_Zappa
train
py
47b4ff945a0fbc01fa863cdb22d1f5e08439cd16
diff --git a/src/Tasks/Engines/DoormanRunner.php b/src/Tasks/Engines/DoormanRunner.php index <HASH>..<HASH> 100644 --- a/src/Tasks/Engines/DoormanRunner.php +++ b/src/Tasks/Engines/DoormanRunner.php @@ -103,6 +103,11 @@ class DoormanRunner extends BaseRunner implements TaskRunnerEngine $manager->setLogPath($logPath); } + $phpBinary = Environment::getEnv('SS_DOORMAN_PHPBINARY'); + if ($phpBinary && is_executable($phpBinary)) { + $manager->setBinary($phpBinary); + } + // Assign default rules $defaultRules = $this->getDefaultRules();
feat: Allow ProcessManager PHP binary to be configurable via environment variable using Doorman.
symbiote_silverstripe-queuedjobs
train
php
7a742cb03375a57291242131a27ffd4903bfdbd8
diff --git a/airflow/cli/commands/webserver_command.py b/airflow/cli/commands/webserver_command.py index <HASH>..<HASH> 100644 --- a/airflow/cli/commands/webserver_command.py +++ b/airflow/cli/commands/webserver_command.py @@ -260,7 +260,8 @@ class GunicornMonitor(LoggingMixin): new_worker_count = min( self.num_workers_expected - num_workers_running, self.worker_refresh_batch_size ) - self.log.debug( + # log at info since we are trying fix an error logged just above + self.log.info( '[%d / %d] Spawning %d workers', num_ready_workers_running, num_workers_running,
Change log level from debug to info when spawning new gunicorn workers (#<I>)
apache_airflow
train
py
2faaba2cd2ae36aac65d92c6d1ae9585ea7aab7c
diff --git a/lib/cli/commands/apps.rb b/lib/cli/commands/apps.rb index <HASH>..<HASH> 100644 --- a/lib/cli/commands/apps.rb +++ b/lib/cli/commands/apps.rb @@ -559,6 +559,8 @@ module VMC::Cli::Command else FileUtils.mkdir(explode_dir) files = Dir.glob('{*,.[^\.]*}') + # Do not process .git files + files.delete('.git') if files FileUtils.cp_r(files, explode_dir) end
Do not process .git directories
cloudfoundry-attic_cf
train
rb
707d95b89c458e40e9d210abaa5fbc7e9866831a
diff --git a/lib/processors/index.js b/lib/processors/index.js index <HASH>..<HASH> 100644 --- a/lib/processors/index.js +++ b/lib/processors/index.js @@ -4,8 +4,8 @@ var path = require('path'), jade = require('jade'), coffee = require(root + '/public/js/vendor/coffee-script').CoffeeScript, markdown = require(root + '/public/js/vendor/markdown'), - less = require('less'), - stylus = require('stylus'); + less = require('less'); + //stylus = require('stylus'); module.exports = { @@ -54,6 +54,10 @@ module.exports = { stylus: function (source) { var css = ''; + return source; +/* + + // disabled due to huge infinite loop bug... ::sigh:: try { stylus(source).render(function (err, result) { if (err) { @@ -67,5 +71,6 @@ module.exports = { } catch (e) {} return css; +*/ } };
Removed stylus support from the server
jsbin_jsbin
train
js
f882a583d08b478415088bfbd53bb9c67acc81b8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -105,11 +105,14 @@ if not ISRELEASED: # partial clone, manually construct version string # this is the format before we started using git-describe # to get an ordering on dev version strings. - rev = "v%s.dev-%s" % (VERSION, rev) + rev = "v%s+dev.%s" % (VERSION, rev) # Strip leading v from tags format "vx.y.z" to get th version string FULLVERSION = rev.lstrip('v') + # make sure we respect PEP 440 + FULLVERSION = FULLVERSION.replace("-", "+dev", 1).replace("-", ".") + else: FULLVERSION += QUALIFIER
Respect PEP <I> (#<I>) * Respect PEP <I> Change unreleased version numbers as to respect PEP <I>. Rather than `<I>-9-g<I>a1a<I>` we will have `<I>+dev9.g<I>a1a<I>`. This means automated setuptools requirements can be respected. Closes #<I>. * The fallback version string should also respect PEP <I>
pydata_xarray
train
py
0cacbda14fd339027dc4a13834a3a841c32e7446
diff --git a/lib/hesabu/version.rb b/lib/hesabu/version.rb index <HASH>..<HASH> 100644 --- a/lib/hesabu/version.rb +++ b/lib/hesabu/version.rb @@ -1,3 +1,3 @@ module Hesabu - VERSION = "0.1.3".freeze + VERSION = "0.1.4".freeze end
Bump hesabu to <I>
BLSQ_hesabu
train
rb
a3477cf7bad59f508ce906a51a2ede49704f8128
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,4 @@ -import { withTranslation, Trans } from 'react-i18next' +import { withTranslation, useTranslation, Trans } from 'react-i18next' import hoistNonReactStatics from 'hoist-non-react-statics' import createConfig from './config/create-config' @@ -27,9 +27,12 @@ export default class NextI18Next { withTranslation(namespace, options)(Component), Component) const nextI18NextInternals = { config: this.config, i18n: this.i18n } - this.Trans = Trans this.Link = withInternals(Link, nextI18NextInternals) this.Router = wrapRouter(nextI18NextInternals) + + /* Directly export `react-i18next` methods */ + this.Trans = Trans + this.useTranslation = useTranslation } }
feat: Add useTranslation (#<I>)
isaachinman_next-i18next
train
js
037cd40817b4031656b23ae527741811110ec39a
diff --git a/lib/pragmatic_tokenizer/tokenizer.rb b/lib/pragmatic_tokenizer/tokenizer.rb index <HASH>..<HASH> 100644 --- a/lib/pragmatic_tokenizer/tokenizer.rb +++ b/lib/pragmatic_tokenizer/tokenizer.rb @@ -138,7 +138,7 @@ module PragmaticTokenizer process_numbers! remove_short_tokens! if minimum_length > 0 process_punctuation! - remove_stop_words!(stop_words) if remove_stop_words + remove_stop_words! if remove_stop_words remove_emoji! if remove_emoji remove_emails! if remove_emails mentions! if mentions @@ -237,11 +237,11 @@ module PragmaticTokenizer end end - def remove_stop_words!(stop_words) + def remove_stop_words! if downcase - @tokens -= stop_words + @tokens -= @stop_words else - @tokens.delete_if { |t| stop_words.include?(Unicode.downcase(t)) } + @tokens.delete_if { |t| @stop_words.include?(Unicode.downcase(t)) } end end
no need to pass stop words to method
diasks2_pragmatic_tokenizer
train
rb
0cdaa6bc82d6ebe517e1d1e8b01028029ef1b0cf
diff --git a/lib/cinch/user.rb b/lib/cinch/user.rb index <HASH>..<HASH> 100644 --- a/lib/cinch/user.rb +++ b/lib/cinch/user.rb @@ -354,7 +354,7 @@ module Cinch when String self.to_s == other when Bot - self.nick == other.config.nick + self.nick == other.nick else false end
when comparing a User with a Bot, use the bot's current nick, not the configured one
cinchrb_cinch
train
rb
37e4d36af8ce2fb61ccb0106e9ee01db40102d80
diff --git a/modules/LocationUtils.js b/modules/LocationUtils.js index <HASH>..<HASH> 100644 --- a/modules/LocationUtils.js +++ b/modules/LocationUtils.js @@ -1,4 +1,5 @@ import invariant from 'invariant' +import warning from 'warning' import { parsePath } from './PathUtils' import { POP } from './Actions' @@ -8,6 +9,11 @@ export const createQuery = (props) => export const createLocation = (input = '/', action = POP, key = null) => { const object = typeof input === 'string' ? parsePath(input) : input + warning( + !object.path, + 'Location descriptor objects should have a `pathname`, not a `path`.' + ) + const pathname = object.pathname || '/' const search = object.search || '' const hash = object.hash || ''
Warn on location descriptor objects with `path`
ReactTraining_history
train
js
4474d5e2092b189846e114cf35062dec97f0a6f2
diff --git a/autopep8.py b/autopep8.py index <HASH>..<HASH> 100644 --- a/autopep8.py +++ b/autopep8.py @@ -13,7 +13,7 @@ import tokenize from optparse import OptionParser from subprocess import Popen, PIPE -__version__ = '0.1' +__version__ = '0.1.1' pep8bin = 'pep8' @@ -28,9 +28,13 @@ class FixPEP8(object): [fixed method list] - e231 + - e261 + - e262 - e302 - e303 - e401 + - e701 + - e702 - w291 - w293 - w391 @@ -167,6 +171,12 @@ class FixPEP8(object): self.indent_word * indent_level + target[c:].lstrip() self.source[result['line'] - 1] = fixed_source + def fix_e702(self, result): + target = self.source[result['line'] - 1] + f = target.split(";") + fixed = "".join(f) + self.source[result['line'] - 1] = fixed + def fix_w291(self, result): fixed_line = self.source[result['line'] - 1].strip() self.source[result['line'] - 1] = "%s%s" % (fixed_line, self.newline)
featured: e<I> fixed method. (and added doc)
hhatto_autopep8
train
py
12ca58957e911118399ce3ab3bb8d9d148b82eb1
diff --git a/src/article/shared/EditorPanel.js b/src/article/shared/EditorPanel.js index <HASH>..<HASH> 100644 --- a/src/article/shared/EditorPanel.js +++ b/src/article/shared/EditorPanel.js @@ -106,8 +106,8 @@ export default class EditorPanel extends Component { appState.propagateUpdates() } - _scrollElementIntoView (el) { - this._getContentPanel().scrollElementIntoView(el, 'onlyIfNotVisible') + _scrollElementIntoView (el, force) { + this._getContentPanel().scrollElementIntoView(el, !force) } _getContentPanel () {
Let EditorPanel scrollIntoView when forced.
substance_texture
train
js
9824aa68be79003a1e3288c8b3a9c9ea7e890052
diff --git a/wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/implementation/StatementImpl.java b/wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/implementation/StatementImpl.java index <HASH>..<HASH> 100644 --- a/wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/implementation/StatementImpl.java +++ b/wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/implementation/StatementImpl.java @@ -20,6 +20,7 @@ package org.wikidata.wdtk.datamodel.implementation; * #L% */ +import java.util.Collections; import java.util.List; import org.apache.commons.lang3.Validate; @@ -85,7 +86,7 @@ public class StatementImpl implements Statement { @Override public List<? extends Snak> getQualifiers() { - return qualifiers; + return Collections.unmodifiableList(qualifiers); } @Override @@ -95,7 +96,9 @@ public class StatementImpl implements Statement { @Override public List<List<? extends Snak>> getReferences() { - return references; + // TODO This still allows inner lists of Snaks to be modified. Do + // we have to protect against this? + return Collections.unmodifiableList(references); } /*
Return only unmodifiable collections
Wikidata_Wikidata-Toolkit
train
java
d63a6da4a8c163fba705b90e7adc7317627601b9
diff --git a/lib/compiler.js b/lib/compiler.js index <HASH>..<HASH> 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -191,7 +191,8 @@ Compiler.prototype = { if (filter.isASTFilter) { this.buf.push(fn(filter.block, this, filter.attrs)); } else { - this.buffer(fn(utils.text(filter.block.nodes.join('')), filter.attrs)); + var text = filter.block.nodes.join(''); + this.buffer(utils.text(fn(text, filter.attrs))); } }, diff --git a/test/filters.test.js b/test/filters.test.js index <HASH>..<HASH> 100644 --- a/test/filters.test.js +++ b/test/filters.test.js @@ -83,6 +83,9 @@ module.exports = { assert.equal( '<script type="text/javascript">\n' + js + '\n</script>', render(':coffeescript\n square = (x) ->\n x * x')); + + assert.equal('<script type="text/javascript">\n(function() {\n alert(\'test\');\n}).call(this);\n</script>' + , render(":coffeescript\n alert 'test'")); }, 'test parse tree': function(assert){
Fixed single-quote filter escape bug. Closes #<I> escape quotes _after_ passing to filter
pugjs_then-pug
train
js,js
7e321953ecbceb18b080f8c69078c99ca3786f91
diff --git a/schedule/src/main/java/org/openbase/jul/schedule/TimeoutSplitter.java b/schedule/src/main/java/org/openbase/jul/schedule/TimeoutSplitter.java index <HASH>..<HASH> 100644 --- a/schedule/src/main/java/org/openbase/jul/schedule/TimeoutSplitter.java +++ b/schedule/src/main/java/org/openbase/jul/schedule/TimeoutSplitter.java @@ -71,7 +71,7 @@ public class TimeoutSplitter { */ public long getTime() throws TimeoutException { final long time = timeout - (System.currentTimeMillis() - timestamp); - if (time < 0) { + if (time <= 0) { throw new TimeoutException(); } return time;
Fix TimeoutSplitter by making sure zero is never returned during timeout computation and a TimeoutException is thrown instead.
openbase_jul
train
java
dc6436d778f4230f4d2fef9cc628302bc3197ece
diff --git a/src/extensions/default/CSSPseudoSelectorHints/main.js b/src/extensions/default/CSSPseudoSelectorHints/main.js index <HASH>..<HASH> 100644 --- a/src/extensions/default/CSSPseudoSelectorHints/main.js +++ b/src/extensions/default/CSSPseudoSelectorHints/main.js @@ -42,7 +42,7 @@ define(function (require, exports, module) { // Magic code to get around CM's 'pseudo' identification logic // As per CSS3 spec : - // -> ':' identifies pseudo slectors + // -> ':' identifies pseudo selectors // -> '::' identifies pseudo elements // We should strictly check for single or double occurance of ':' by slicing // the line text till the token start position
slectors -> selectors (#<I>)
adobe_brackets
train
js
9afe5fa7afbf3f143dd2b8d293be59f572a14c79
diff --git a/interfaces/python/infomap.py b/interfaces/python/infomap.py index <HASH>..<HASH> 100644 --- a/interfaces/python/infomap.py +++ b/interfaces/python/infomap.py @@ -118,7 +118,7 @@ def _construct_args( DeprecationWarning, ) - if not include_self_links: + if include_self_links is not None and not include_self_links: args += " --no-self-links" if no_self_links:
fix(python): no_self_links was always set unless include_self_links=True
mapequation_infomap
train
py
43be72acb46a2f132f74e03efbd060b2c689ecc7
diff --git a/src/Composer/Package/Archiver/PharArchiver.php b/src/Composer/Package/Archiver/PharArchiver.php index <HASH>..<HASH> 100644 --- a/src/Composer/Package/Archiver/PharArchiver.php +++ b/src/Composer/Package/Archiver/PharArchiver.php @@ -22,7 +22,7 @@ use Composer\Package\PackageInterface; */ class PharArchiver implements ArchiverInterface { - static protected $formats = array( + protected static $formats = array( 'zip' => \Phar::ZIP, 'tar' => \Phar::TAR, );
Follow PSR-2 for method modifier ordering
mothership-ec_composer
train
php
2c466523df3aa2a915d2cbe7490573a1dce4cbe5
diff --git a/src/FieldsBuilder.php b/src/FieldsBuilder.php index <HASH>..<HASH> 100644 --- a/src/FieldsBuilder.php +++ b/src/FieldsBuilder.php @@ -525,6 +525,11 @@ class FieldsBuilder extends ParentDelegationBuilder implements NamedBuilder return $this->getFieldManager()->getField($name); } + public function fieldExists($name) + { + return $this->getFieldManager()->fieldNameExists($name); + } + /** * Modify an already defined field * @param string $name Name of the field
Expose a fieldExists method to FieldsBuilder
StoutLogic_acf-builder
train
php
41586965f0f061fd77d666edcfced50780afdc23
diff --git a/intranet/static/js/eighth/schedule.js b/intranet/static/js/eighth/schedule.js index <HASH>..<HASH> 100644 --- a/intranet/static/js/eighth/schedule.js +++ b/intranet/static/js/eighth/schedule.js @@ -162,4 +162,15 @@ $(function() { }); } }); + $(".schedule-form input[type='submit']").click(function(e) { + var activities = ""; + $("tr.form-row:not(.hidden)").each(function(i,el) { + if (!$("td[data-field='sponsors'] .selectize-input", el).hasClass('has-items')) { + activities += "\n " + $(".block-name a", this).html().trim(); + } + }); + if (activities !== "" && !confirm("Are you sure you want to add the following activities without a sponsor?\n" + activities)) { + e.preventDefault(); + } + }); });
Add warning when an activity is scheduled without a sponsor
tjcsl_ion
train
js
1919b79b8b036d48818eb648e712df41f8a1299c
diff --git a/cassiopeia-diskstore/cassiopeia_diskstore/staticdata.py b/cassiopeia-diskstore/cassiopeia_diskstore/staticdata.py index <HASH>..<HASH> 100644 --- a/cassiopeia-diskstore/cassiopeia_diskstore/staticdata.py +++ b/cassiopeia-diskstore/cassiopeia_diskstore/staticdata.py @@ -472,9 +472,9 @@ class StaticDataDiskService(SimpleKVDiskService): return dto if "id" in query: - rune = find_matching_attribute(runes["data"].values(), "runeId", str(query["id"])) + rune = find_matching_attribute(runes["data"], "runeId", str(query["id"])) elif "name" in query: - rune = find_matching_attribute(runes["data"].values(), "runeName", query["name"]) + rune = find_matching_attribute(runes["data"], "runeName", query["name"]) else: raise ValueError("Impossible!") if rune is None: @@ -509,4 +509,3 @@ class StaticDataDiskService(SimpleKVDiskService): version=item["version"], locale=item["locale"]) self._put(key, item) -
runes data is list rather than dict
meraki-analytics_cassiopeia-datastores
train
py
462bf2043f890c246920bf44aa795c570de02462
diff --git a/tests/bootstrap.php b/tests/bootstrap.php index <HASH>..<HASH> 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -5,7 +5,7 @@ require_once __DIR__ . '/../src/loader.php'; // Add PEAR to include path for Travis CI if(!class_exists('PEAR_RunTest')) - set_include_path(get_include_path() . PATH_SEPARATOR . realpath(__DIR__ . '(../lib/pear-core')); + set_include_path(get_include_path() . PATH_SEPARATOR . realpath(__DIR__ . '/../lib/pear-core')); // Test helper objects autoloader
[Travis CI] fix my stupidness
smasty_Neevo
train
php
5d9ab554fe902ea74307bdb58d1450a64891c74f
diff --git a/hazelcast/src/main/java/com/hazelcast/internal/networking/nonblocking/NonBlockingIOThread.java b/hazelcast/src/main/java/com/hazelcast/internal/networking/nonblocking/NonBlockingIOThread.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/internal/networking/nonblocking/NonBlockingIOThread.java +++ b/hazelcast/src/main/java/com/hazelcast/internal/networking/nonblocking/NonBlockingIOThread.java @@ -127,7 +127,8 @@ public class NonBlockingIOThread extends Thread implements OperationHostileThrea private static Selector newSelector(ILogger logger) { try { Selector selector = Selector.open(); - if (Boolean.getBoolean("tcp.optimizedselector")) { + boolean optimize = Boolean.parseBoolean(System.getProperty("hazelcast.io.optimizeselector", "true")); + if (optimize) { optimize(selector, logger); } return selector;
Enabled optimized selector by default. Various other projects like Netty, Agrona do this be default as well. There is a switch to disable it, and if something fails while trying to modify, it will fallback on the non optimized version anyway.
hazelcast_hazelcast
train
java
005fbae44cb9fd2921476c928d5e31a0b1576feb
diff --git a/core/formatter.js b/core/formatter.js index <HASH>..<HASH> 100644 --- a/core/formatter.js +++ b/core/formatter.js @@ -35,23 +35,30 @@ var formatter = function(results, format) { } function formatPlain() { - var res = '', - obj = results.metrics, - key; + var colors = require('ansicolors'), + res = '', + metrics = results.metrics; // header res += 'phantomas metrics for <' + results.url + '>:\n\n'; // metrics - for (key in obj) { - res += '* ' + key + ': ' + obj[key]+ '\n'; - } + Object.keys(metrics).forEach(function(metric) { + res += '* ' + metric + ': ' + metrics[metric]+ '\n'; + }); res += '\n'; // notices results.notices.forEach(function(msg) { - res += '> ' + msg + "\n"; + msg = msg. + // color labels + replace(/^[^ <][^:<]+:/, colors.brightGreen). + // color URLs + replace(/<[^>]+>/, colors.brightBlue); + + // add a notice + res += msg + "\n"; }); return res.trim(); @@ -62,4 +69,3 @@ var formatter = function(results, format) { }; exports.formatter = formatter; -
Improve logging: * color URLs and notices labels
macbre_phantomas
train
js
80cede498a9ec2b7807ae3eba0356668016bf53c
diff --git a/cwltool/job.py b/cwltool/job.py index <HASH>..<HASH> 100644 --- a/cwltool/job.py +++ b/cwltool/job.py @@ -105,8 +105,8 @@ class CommandLineJob(object): with open(createtmp, "w") as f: f.write(vol.resolved.encode("utf-8")) runtime.append(u"--volume=%s:%s:ro" % (createtmp, vol.target)) - runtime.append(u"--volume=%s:%s:rw" % (os.path.abspath(self.outdir), "/var/spool/cwl")) - runtime.append(u"--volume=%s:%s:rw" % (os.path.abspath(self.tmpdir), "/tmp")) + runtime.append(u"--volume=%s:%s:rw" % (os.path.realpath(self.outdir), "/var/spool/cwl")) + runtime.append(u"--volume=%s:%s:rw" % (os.path.realpath(self.tmpdir), "/tmp")) runtime.append(u"--workdir=%s" % ("/var/spool/cwl")) runtime.append("--read-only=true") if (kwargs.get("enable_net", None) is None and
abspath -> realpath for volume paths
common-workflow-language_cwltool
train
py
f6925b743cd6e8873ac981273d5edb0e8d1b20b9
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -79,8 +79,8 @@ extra_objects = glob.glob(os.path.join(cfitsio_build_dir,'*.o')) extra_objects += glob.glob(os.path.join(cfitsio_zlib_dir,'*.o')) if platform.system()=='Darwin': - extra_compile_args=['-arch','i386','-arch','x86_64'] - extra_link_args=['-arch','i386','-arch','x86_64'] + extra_compile_args=['-arch','x86_64'] + extra_link_args=['-arch','x86_64'] else: extra_compile_args=[] extra_link_args=[]
removed -iarch in setup.py
esheldon_fitsio
train
py
51d7a7b920e1808a35f27cae1ff16d37d38c7672
diff --git a/core-bundle/src/Resources/contao/config/config.php b/core-bundle/src/Resources/contao/config/config.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/config/config.php +++ b/core-bundle/src/Resources/contao/config/config.php @@ -371,10 +371,6 @@ $GLOBALS['TL_CROP'] = array */ $GLOBALS['TL_CRON'] = array ( - 'monthly' => array - ( - 'purgeImageCache' => array('Automator', 'purgeImageCache') - ), 'weekly' => array ( 'generateSitemap' => array('Automator', 'generateSitemap'),
[Core] Do not purge the image cache automatically.
contao_contao
train
php
9d18f08c3c6b550462f1972ebc70edc53036ea7c
diff --git a/tweepy/api.py b/tweepy/api.py index <HASH>..<HASH> 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -1423,12 +1423,11 @@ class API(object): # image must be gif, jpeg, png, webp if not file_type: - if f is None: - file_type = imghdr.what(filename) or mimetypes.guess_type(filename)[0] - else: - file_type = imghdr.what(filename, h=f.read()) or mimetypes.guess_type(filename)[0] - f.seek(0) # Reset to beginning of file - + h = None + if f is not None: + h = f.read(32) + f.seek(0) + file_type = imghdr.what(filename, h=h) or mimetypes.guess_type(filename)[0] if file_type is None: raise TweepError('Could not determine file type') if file_type in ['gif', 'jpeg', 'png', 'webp']:
Resolving media_upload conflicts
tweepy_tweepy
train
py
fbee4670ccc41cc42cdbdd2dc42c650dd33d640c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -17,7 +17,6 @@ setuptools.setup( classifiers=[ "Development Status :: 2 - Pre-Alpha" ], - include_package_data=True, test_suite="nion.swift.test", entry_points={ 'console_scripts': [
Ensure all resource files are included in sdist. Removed include_package_data since it is used to either include what is in the manifest or _everything_ in under version control, but seemingly only CVS or Subversion, not Git. Once removed, the package_data tag properly adds the stylesheet to the sdist.
nion-software_nionswift
train
py
a38c70f82de69308886fcdd3bffb8c60e9c8648d
diff --git a/spec/client_pool_spec.rb b/spec/client_pool_spec.rb index <HASH>..<HASH> 100644 --- a/spec/client_pool_spec.rb +++ b/spec/client_pool_spec.rb @@ -261,6 +261,7 @@ describe ZK::Pool do describe 'disconnected client' do before do + pending flexmock(@cnx1) do |m| m.should_receive(:connected?).and_return(false) end
w<I>t! the on_connected race was *the* bug (sheesh)
zk-ruby_zk
train
rb
69030722e5f6263e14bc5d75831e6faea69a1d18
diff --git a/src/common/event_util.js b/src/common/event_util.js index <HASH>..<HASH> 100644 --- a/src/common/event_util.js +++ b/src/common/event_util.js @@ -33,6 +33,10 @@ sre.EventUtil.KeyCode = { ENTER: 13, ESC: 27, SPACE: 32, + PAGE_UP: 33, // also NUM_NORTH_EAST + PAGE_DOWN: 34, // also NUM_SOUTH_EAST + END: 35, // also NUM_SOUTH_WEST + HOME: 36, // also NUM_NORTH_WEST LEFT: 37, UP: 38, RIGHT: 39,
Adds some additional keycodes.
zorkow_speech-rule-engine
train
js
21d22d6eca7e1fde34ff2ca93eb42a552b0316ef
diff --git a/javascript/node/selenium-webdriver/testing/index.js b/javascript/node/selenium-webdriver/testing/index.js index <HASH>..<HASH> 100644 --- a/javascript/node/selenium-webdriver/testing/index.js +++ b/javascript/node/selenium-webdriver/testing/index.js @@ -41,16 +41,14 @@ * The provided wrappers leverage the {@link webdriver.promise.ControlFlow} * to simplify writing asynchronous tests: * - * var By = require('selenium-webdriver').By, - * until = require('selenium-webdriver').until, - * firefox = require('selenium-webdriver/firefox'), - * test = require('selenium-webdriver/testing'); + * var {Builder, By, until} = require('selenium-webdriver'); + * var test = require('selenium-webdriver/testing'); * * test.describe('Google Search', function() { * var driver; * * test.before(function() { - * driver = new firefox.Driver(); + * driver = new Builder().forBrowser('firefox').build(); * }); * * test.after(function() {
[js] Update example in selenium-webdriver/testing documentation The firefox.Driver constructor was changed in <I> to not do any work. Users should always use the Builder class to create new driver instances. Fixes #<I>
SeleniumHQ_selenium
train
js
1c763f87b58efb307b72e7dc038a5fc7ba45f8c2
diff --git a/packages/react/src/components/DatePicker/DatePicker.js b/packages/react/src/components/DatePicker/DatePicker.js index <HASH>..<HASH> 100644 --- a/packages/react/src/components/DatePicker/DatePicker.js +++ b/packages/react/src/components/DatePicker/DatePicker.js @@ -383,6 +383,13 @@ export default class DatePicker extends Component { } } + componentDidUpdate({ dateFormat: prevDateFormat }) { + const { dateFormat } = this.props; + if (this.cal && prevDateFormat !== dateFormat) { + this.cal.set({ dateFormat }); + } + } + componentWillUnmount() { if (this.cal) { this.cal.destroy();
fix(date-picker): support changing date format (#<I>) This change allows change in `dateFormat` prop after initialization reflected correctly to the underlying Flatpickr.
carbon-design-system_carbon-components
train
js
a2699eb053521c5852dee099f05598dbd2c850f1
diff --git a/nerve/report.go b/nerve/report.go index <HASH>..<HASH> 100644 --- a/nerve/report.go +++ b/nerve/report.go @@ -86,8 +86,11 @@ func toReport(status error, s *Service) Report { func (r *Report) String() string { var buffer bytes.Buffer - - buffer.WriteString(fmt.Sprint(r.Available)) + if r.Available == nil { + buffer.WriteString(fmt.Sprint(true)) + } else { + buffer.WriteString(fmt.Sprint(*r.Available)) + } buffer.WriteString(" ") buffer.WriteString(r.Name) buffer.WriteString(" ")
Check available nil pointer in String
blablacar_go-nerve
train
go
aaf2c561ab1ce1bb730b7bb397fe88d1b7b2a375
diff --git a/pytds/__init__.py b/pytds/__init__.py index <HASH>..<HASH> 100644 --- a/pytds/__init__.py +++ b/pytds/__init__.py @@ -286,6 +286,11 @@ class Connection(object): last_error = LoginError("Cannot connect to server '{0}': {1}".format(host, e), e) else: sock.setsockopt(socket.SOL_TCP, socket.TCP_NODELAY, 1) + + # default keep alive should be 30 seconds according to spec: + # https://msdn.microsoft.com/en-us/library/dd341108.aspx + sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 30) + sock.settimeout(retry_time) conn = _TdsSocket(self._use_tz) try:
set TCP keep-alive to <I> seconds according to spec should fix #<I>
denisenkom_pytds
train
py
4dd7cfce9d5dde3c7d85b72b84974192e9aff220
diff --git a/src/Database/Type/DateTimeType.php b/src/Database/Type/DateTimeType.php index <HASH>..<HASH> 100644 --- a/src/Database/Type/DateTimeType.php +++ b/src/Database/Type/DateTimeType.php @@ -245,7 +245,7 @@ class DateTimeType extends BaseType /** * @inheritDoc */ - public function manyToPHP(array $values, array $fields, DriverInterface $driver) + public function manyToPHP(array $values, array $fields, DriverInterface $driver): array { foreach ($fields as $field) { if (!isset($values[$field])) {
Add missing return type to manyToPHP
cakephp_cakephp
train
php
bcbb0e1129f481760ab103adee1f06b98993e5f0
diff --git a/lib/commander/runner.rb b/lib/commander/runner.rb index <HASH>..<HASH> 100644 --- a/lib/commander/runner.rb +++ b/lib/commander/runner.rb @@ -211,9 +211,7 @@ module Commander def require_program *keys keys.each do |key| - if program(key).nil? or program(key).empty? - raise CommandError, "Program #{key} required (use #program method)" - end + raise CommandError, "program #{key} required" if program(key).nil? or program(key).empty? end end
Refactored #require_program
commander-rb_commander
train
rb
3619462740a4c4369f80ea314d33c1df383dab4f
diff --git a/cassandra/io/libevreactor.py b/cassandra/io/libevreactor.py index <HASH>..<HASH> 100644 --- a/cassandra/io/libevreactor.py +++ b/cassandra/io/libevreactor.py @@ -102,10 +102,10 @@ class LibevLoop(object): def _run_loop(self): while True: - end_condition = self._loop.start() + self._loop.start() # there are still active watchers, no deadlock with self._lock: - if not self._shutdown and (end_condition or self._live_conns): + if not self._shutdown and self._live_conns: log.debug("Restarting event loop") continue else:
there is no return from libev Loop_start This is leftover from when the class was copied over from asyncore.
datastax_python-driver
train
py
8ccb8befa5323d63e61efa83c6a409a5b2b3c583
diff --git a/lib/beaker-answers/version.rb b/lib/beaker-answers/version.rb index <HASH>..<HASH> 100644 --- a/lib/beaker-answers/version.rb +++ b/lib/beaker-answers/version.rb @@ -1,5 +1,5 @@ module BeakerAnswers module Version - STRING = '0.26.3' + STRING = '0.27.0' end end
(GEM) update beaker-answers version to <I>
puppetlabs_beaker-answers
train
rb
972d865ea2d5d3c475eb69f404be1675141375c7
diff --git a/src/Sylius/Bundle/CoreBundle/Installer/Provider/DatabaseSetupCommandsProvider.php b/src/Sylius/Bundle/CoreBundle/Installer/Provider/DatabaseSetupCommandsProvider.php index <HASH>..<HASH> 100644 --- a/src/Sylius/Bundle/CoreBundle/Installer/Provider/DatabaseSetupCommandsProvider.php +++ b/src/Sylius/Bundle/CoreBundle/Installer/Provider/DatabaseSetupCommandsProvider.php @@ -45,12 +45,10 @@ final class DatabaseSetupCommandsProvider implements DatabaseSetupCommandsProvid return [ 'doctrine:database:create', 'doctrine:migrations:migrate' => ['--no-interaction' => true], - 'cache:clear', ]; } return array_merge($this->getRequiredCommands($input, $output, $questionHelper), [ - 'cache:clear', 'doctrine:migrations:version' => [ '--add' => true, '--all' => true,
Fix installation errors by removing cache clearing during the process
Sylius_Sylius
train
php
74c3a4f76f64569f911adb2577927d6fc45d05fe
diff --git a/lib/oxcelix/workbook.rb b/lib/oxcelix/workbook.rb index <HASH>..<HASH> 100644 --- a/lib/oxcelix/workbook.rb +++ b/lib/oxcelix/workbook.rb @@ -1,3 +1,4 @@ +require "tmpdir" # The namespace for all classes and modules included on Oxcelix. module Oxcelix # Helper methods for the Workbook class @@ -48,7 +49,7 @@ module Oxcelix # * adding comments to the cells # * Converting each sheet to a Matrix object def initialize(filename=nil, options={}) - @destination = Dir.pwd+'/tmp' + @destination = Dir.mktmpdir @sheets=[] @sheetbase={} @sharedstrings=[] @@ -95,7 +96,7 @@ module Oxcelix def parse(filename, options={}) thrs = [] thrcount = 0 - + @sheets.each do |x| thrs[thrcount] = Thread.new {
Excel file now gets unzipped in the system Temp directory
gbiczo_oxcelix
train
rb
2c1a6a237d4e68c077c175d16f4d76518c00e4d2
diff --git a/tools/mpy-tool.py b/tools/mpy-tool.py index <HASH>..<HASH> 100755 --- a/tools/mpy-tool.py +++ b/tools/mpy-tool.py @@ -532,6 +532,7 @@ class RawCodeNative(RawCode): if config.native_arch in ( MP_NATIVE_ARCH_X86, MP_NATIVE_ARCH_X64, + MP_NATIVE_ARCH_ARMV6, MP_NATIVE_ARCH_XTENSA, MP_NATIVE_ARCH_XTENSAWIN, ):
tools/mpy-tool.py: Support relocating ARMv6 arch.
micropython_micropython
train
py
7e9c826e232f0387b7b6c9e089ae240b9472afc2
diff --git a/pypsa/io.py b/pypsa/io.py index <HASH>..<HASH> 100644 --- a/pypsa/io.py +++ b/pypsa/io.py @@ -618,6 +618,7 @@ def _import_from_importer(network, importer, basename, skip_time=False): snapshot_levels = set(["period", "timestep", "snapshot"]).intersection(df.columns) if snapshot_levels: df.set_index(sorted(snapshot_levels), inplace=True) + network.set_snapshots(df.index) cols = ['objective', 'generators', 'stores'] if not df.columns.intersection(cols).empty:
io: revert removal of needed line
PyPSA_PyPSA
train
py
c8c03eb79fdbc331eebe0bee7d2fe9c9cb9aba5d
diff --git a/vendor/assets/javascripts/bs-breadcrumbs.js b/vendor/assets/javascripts/bs-breadcrumbs.js index <HASH>..<HASH> 100644 --- a/vendor/assets/javascripts/bs-breadcrumbs.js +++ b/vendor/assets/javascripts/bs-breadcrumbs.js @@ -52,9 +52,11 @@ THIS COMPPONENT IS CUSTOMIZED! displayName = _this.get('nameDictionary')["" + _this.dictionaryNamePrefix + "." + routeName]; displayIcon = null; } else { - displayName = route.handler.routeName.split('.').pop(); - displayName = displayName[0].toUpperCase() + displayName.slice(1).toLowerCase(); - displayIcon = null; + if (route.handler.breadcrumbs != false) { + displayName = route.handler.routeName.split('.').pop(); + displayName = displayName[0].toUpperCase() + displayName.slice(1).toLowerCase(); + displayIcon = null; + } } crumb = Ember.Object.create({ route: route.handler.routeName, @@ -68,7 +70,10 @@ THIS COMPPONENT IS CUSTOMIZED! name: route.handler.context.get('name') }); } - return _this.get('content').pushObject(crumb); + if(displayName){ + return _this.get('content').pushObject(crumb); + } + return; }); return this.get('content.lastObject').set('active', true); }
Add support to hide breadcrumbs in bs-breadcrumbs
FromUte_dune-dashboard
train
js
d849930e511b7eb102d8b370d7fdf792ef3e50b6
diff --git a/middleman-core/lib/middleman-core/application.rb b/middleman-core/lib/middleman-core/application.rb index <HASH>..<HASH> 100644 --- a/middleman-core/lib/middleman-core/application.rb +++ b/middleman-core/lib/middleman-core/application.rb @@ -98,11 +98,11 @@ module Middleman # Middleman mode. Defaults to :server, set to :build by the build process # @return [String] - define_setting :mode, ((ENV['MM_ENV'] && ENV['MM_ENV'].to_sym) || :server), 'Middleman mode. Defaults to :server' + define_setting :mode, :server, 'Middleman mode. Defaults to :server' # Middleman environment. Defaults to :development # @return [String] - define_setting :environment, :development, 'Middleman environment. Defaults to :development' + define_setting :environment, ((ENV['MM_ENV'] && ENV['MM_ENV'].to_sym) || :development), 'Middleman environment. Defaults to :development' # Which file should be used for directory indexes # @return [String]
Don't set mode AND environment with the same ENV
middleman_middleman
train
rb
70171337a7ba5559b997902bbcd62b4f49232c0e
diff --git a/src/Console/BaseCommand.php b/src/Console/BaseCommand.php index <HASH>..<HASH> 100644 --- a/src/Console/BaseCommand.php +++ b/src/Console/BaseCommand.php @@ -221,10 +221,7 @@ abstract class BaseCommand implements CommandInterface * @param \Cake\Console\ConsoleIo $io The console io * @return int|null The exit code or null for success */ - public function execute(Arguments $args, ConsoleIo $io): ?int - { - return null; - } + abstract public function execute(Arguments $args, ConsoleIo $io): ?int; /** * Halt the the current process with a StopException.
Add an abstract method to indicate what is expected of implementations.
cakephp_cakephp
train
php
5c8e46de5ad850ba0e9a3c6efdf282987e851751
diff --git a/openxc/src/com/openxc/interfaces/VehicleInterfaceFactory.java b/openxc/src/com/openxc/interfaces/VehicleInterfaceFactory.java index <HASH>..<HASH> 100644 --- a/openxc/src/com/openxc/interfaces/VehicleInterfaceFactory.java +++ b/openxc/src/com/openxc/interfaces/VehicleInterfaceFactory.java @@ -5,9 +5,26 @@ import java.lang.reflect.InvocationTargetException; import android.content.Context; import android.util.Log; +/** + * A factory that uses reflection to create instance of VehicleInterface + * implementations. + */ public class VehicleInterfaceFactory { private static final String TAG = "VehicleInterfaceFactory"; + /** + * Obtain the Class object for a given VehicleInterface class name. + * + * The class must be in the classpath of the process' context, or an + * exception will be thrown. + * + * @param interfaceName the canonical name of class implementing + * {@link VehicleInterface} + * @return the Class object, if found. + * @throws VehicleInterfaceException if the named class could not be found + * or loaded. + * + */ public static Class<? extends VehicleInterface> findClass( String interfaceName) throws VehicleInterfaceException { Log.d(TAG, "Looking up class for name " + interfaceName);
Document a method in VehicleInterfaceFactory.
openxc_openxc-android
train
java
00d94730ca1956025fda66bc591da32bfa24b6a2
diff --git a/app/classes/timthumb.php b/app/classes/timthumb.php index <HASH>..<HASH> 100644 --- a/app/classes/timthumb.php +++ b/app/classes/timthumb.php @@ -41,6 +41,15 @@ if (empty($matches[1]) || empty($matches[2]) || empty($matches[4])) { die("Malformed thumbnail URL. Should look like '/thumbs/320x240c/filename.jpg'."); } +/** + * Bolt specific: Set BOLT_PROJECT_ROOT_DIR, and Bolt-specific settings.. + */ +if (substr(__DIR__, -20) == DIRECTORY_SEPARATOR.'bolt-public'.DIRECTORY_SEPARATOR.'classes') { // installed bolt with composer + require_once __DIR__ . '/../../../vendor/bolt/bolt/app/bootstrap.php'; +} else { + require_once __DIR__ . '/../bootstrap.php'; +} + // Let's get on with the rest.. $yamlparser = new Symfony\Component\Yaml\Parser(); $config['general'] = $yamlparser->parse(file_get_contents(BOLT_CONFIG_DIR .'/config.yml') . "\n");
Fix thumbnail issue introduced in pull #<I>
bolt_bolt
train
php
cf20e656e0b3ddf73637292b362addb2024397bc
diff --git a/lib/enum_ish/definer/active_record.rb b/lib/enum_ish/definer/active_record.rb index <HASH>..<HASH> 100644 --- a/lib/enum_ish/definer/active_record.rb +++ b/lib/enum_ish/definer/active_record.rb @@ -27,7 +27,7 @@ module EnumIsh enum.mapping.invert[read_attribute(enum.name)] end define_method "#{enum.name}=" do |value| - write_attribute(enum.name, enum.mapping[value]) + write_attribute(enum.name, enum.mapping[value] || value) end end end
Fix accessor mapping for activerecord
kanety_enum_ish
train
rb
c246f4439f2b0fed35aae5fee84f8b437d64b915
diff --git a/indra/preassembler/grounding_mapper/mapper.py b/indra/preassembler/grounding_mapper/mapper.py index <HASH>..<HASH> 100644 --- a/indra/preassembler/grounding_mapper/mapper.py +++ b/indra/preassembler/grounding_mapper/mapper.py @@ -1,6 +1,6 @@ __all__ = ['GroundingMapper', 'load_grounding_map', 'default_grounding_map', 'default_agent_map', 'default_ignores', 'default_misgrounding_map', - 'default_mapper'] + 'default_mapper', 'gm'] import os import csv import json @@ -567,6 +567,7 @@ def _load_default_ignores(): default_grounding_map = _load_default_grounding_map() +gm = default_grounding_map # For backwards compatibility, redundant default_misgrounding_map = _load_default_misgrounding_map() default_agent_map = _load_default_agent_map() default_ignores = _load_default_ignores()
Add gm (redundant) for backwards compatibility
sorgerlab_indra
train
py
79d6db94c06e8e399bbe05eb837540ac9982b136
diff --git a/Flame/Rest/Security/Cors.php b/Flame/Rest/Security/Cors.php index <HASH>..<HASH> 100644 --- a/Flame/Rest/Security/Cors.php +++ b/Flame/Rest/Security/Cors.php @@ -79,7 +79,15 @@ class Cors extends Object implements ICors if (isset($this->config['headers'])) { if ($this->config['headers'] === '*') { $headers = array('origin', 'content-type', 'authorization'); - $this->config['headers'] = array_merge($headers, array_keys((array) $this->httpRequest->getHeaders())); + /* + * Because OPTIONS requests aren't contain declared headers but send list of + * headers in Access-Control-Request-Headers header + */ + $expectedHeaders = $this->httpRequest->getHeader("Access-Control-Request-Headers", []); + if (!empty($expectedHeaders)) { + $expectedHeaders = array_map('trim', explode(",", $expectedHeaders)); + } + $this->config['headers'] = array_merge($headers, array_keys((array) $this->httpRequest->getHeaders()), $expectedHeaders); } if (is_array($this->config['headers'])) {
Fixed 'all headers' for OPTIONS requests
flame-org_TinyREST
train
php
908676dea380a24f0389c7980ba2569608716a96
diff --git a/pkg/cmd/cli/cli.go b/pkg/cmd/cli/cli.go index <HASH>..<HASH> 100644 --- a/pkg/cmd/cli/cli.go +++ b/pkg/cmd/cli/cli.go @@ -292,7 +292,7 @@ func CommandFor(basename string) *cobra.Command { case "kubectl": cmd = NewCmdKubectl(basename, out) default: - cmd = NewCommandCLI(basename, basename, in, out, errout) + cmd = NewCommandCLI("oc", "oc", in, out, errout) } if cmd.UsageFunc() == nil {
don't use baseCmdName when printing client version This patch addresses an issue where the client name will be printed as what the "base / root" command was when invoking the "version" cmd.
openshift_origin
train
go
a4101bdbc6c52521e4330935ad830bde6a48bb2e
diff --git a/glue/statedb.py b/glue/statedb.py index <HASH>..<HASH> 100644 --- a/glue/statedb.py +++ b/glue/statedb.py @@ -70,6 +70,23 @@ class StateSegmentDatabaseLFNExistsException(exceptions.Exception): +class StateSegmentDatabaseSegnumException(exceptions.Exception): + """ + Exceptions raised by the classes and methods in this module + will be instances of this class. + """ + def __init__(self, args=None): + """ + Create an instance of this class exception. + + @param args: + + @return: Instance of class StateSegmentDatabaseSegnumException + """ + self.args = args + + + class StateSegmentDatabase: """ Class that represents an instance of a state segment database @@ -292,6 +309,11 @@ class StateSegmentDatabase: Publish a state segment for a state vector in the database """ + # check that we are in science mode if the user has given a segnum + if segnum and val != 65535: + msg = "segnum can only be specified if val is 65535" + raise StateSegmentDatabaseSegnumException, msg + # check that we have an lfn registered if not self.lfn_id: msg = "No LFN registered to publish state information"
added a science mode check on segnum
gwastro_pycbc-glue
train
py
bc5750fa6dc729ddc7bf5a9336e70d5769219edc
diff --git a/mod/quiz/report/overview/report.php b/mod/quiz/report/overview/report.php index <HASH>..<HASH> 100644 --- a/mod/quiz/report/overview/report.php +++ b/mod/quiz/report/overview/report.php @@ -207,7 +207,7 @@ class quiz_report extends quiz_default_report { $table->add_data($row); } - echo '<script type="text/javascript" src="'.$CFG->wwwroot.'/mod/quiz/report/overview/utility.js" />'; + echo '<script type="text/javascript" src="'.$CFG->wwwroot.'/mod/quiz/report/overview/utility.js"></script>'; echo '<form id="attemptsform" method="post" action="report.php" onsubmit="var menu = document.getElementById(\'actionmenu\'); return confirm_if(menu.options[menu.selectedIndex].value == \'delete\', \''.$strreallydel.'\');">'; echo '<input type="hidden" name="id" value="'.$cm->id.'" />';
IE doesn't display anything after a script include tag that closes with />. Please close all your script tags like <script></script> or else. Disgusting.
moodle_moodle
train
php
8095d6b7db16bc81c748a9812d4b2a8c7d16e00b
diff --git a/value/src/org/immutables/value/Value.java b/value/src/org/immutables/value/Value.java index <HASH>..<HASH> 100644 --- a/value/src/org/immutables/value/Value.java +++ b/value/src/org/immutables/value/Value.java @@ -201,9 +201,15 @@ public @interface Value { @Target(ElementType.TYPE) public @interface Transformer {} +/* + @Beta + @Documented + @Retention(RetentionPolicy.SOURCE) + @Target(ElementType.METHOD) + public @interface Builder {} +*/ /* * Generate visitor for a set of nested classes. - @Beta @Documented @Retention(RetentionPolicy.SOURCE) @@ -302,8 +308,8 @@ public @interface Value { * Generated accessor methods have annotation copied from original accessor method. However * {@code org.immutables.*} and {@code java.lang.*} are not copied. This allow some frameworks to * work with immutable types as they can with beans, using getters and annotations on them. - * @deprecated consider using styles, such as {@link Style#} May be undeprecated if it will be - * usefull. + * @deprecated consider using styles, such as {@link BeanStyle.Accessors}. May be undeprecated if + * found to be useful. */ @Deprecated @Documented
deprecate @Value.Getters. may be undeprecated in future if found useful
immutables_immutables
train
java
4e395883201b4225abbcd79552c67ece13bc964d
diff --git a/lib/v1/gremlin/Gremlin.js b/lib/v1/gremlin/Gremlin.js index <HASH>..<HASH> 100644 --- a/lib/v1/gremlin/Gremlin.js +++ b/lib/v1/gremlin/Gremlin.js @@ -37,7 +37,7 @@ class Gremlin { Morphism() { const path = new Path(['M', []]); - path._query = this._query; + // path._query = this._query; return path; }
Path object should not know _query function.
lnshi_node-cayley
train
js
754558f634b22d36c29a9eeb4582553f96398670
diff --git a/Twig/EasyAdminTwigExtension.php b/Twig/EasyAdminTwigExtension.php index <HASH>..<HASH> 100644 --- a/Twig/EasyAdminTwigExtension.php +++ b/Twig/EasyAdminTwigExtension.php @@ -93,7 +93,7 @@ class EasyAdminTwigExtension extends \Twig_Extension * property doesn't exist or its value is not accessible. This ensures that * the function never generates a warning or error message when calling it. * - * @param string $view The vie in which the item is being rendered + * @param string $view The view in which the item is being rendered * @param string $entityName The name of the entity associated with the item * @param object $item The item which is being rendered * @param array $fieldMetadata The metadata of the actual field being rendered @@ -120,6 +120,11 @@ class EasyAdminTwigExtension extends \Twig_Extension 'view' => $view, ); + // if the template path doesn't start with '@EasyAdmin/' it's a custom template; use it + if ('@EasyAdmin/' !== substr($fieldMetadata['template'], 0, 11)) { + return $twig->render($fieldMetadata['template'], $templateParameters); + } + if (null === $value) { return $twig->render($entityConfiguration['templates']['label_null'], $templateParameters); }
Make sure that custom field templates are always used, regardless of the property type
EasyCorp_EasyAdminBundle
train
php
6d6c5a7631abd6271dcec7def982ebcfc1aaf9e0
diff --git a/lib/irt.rb b/lib/irt.rb index <HASH>..<HASH> 100644 --- a/lib/irt.rb +++ b/lib/irt.rb @@ -1,5 +1,6 @@ -# allows standard rails 3 console to run without loading irt -unless defined?(Rails::Console) && !ENV['IRT_COMMAND'] +# allows to skip irb overriding, so you can use the regular irb/rails console +# even if irt is required in the Gemfile +if ENV['IRT_COMMAND'] at_exit{ Dye.print_reset_colors }
fix condition to allow irb/rails console with irt required in the Gemfile
ddnexus_irt
train
rb
0217b049795f0792a81f6f128d510874e53791a4
diff --git a/lib/loader.js b/lib/loader.js index <HASH>..<HASH> 100644 --- a/lib/loader.js +++ b/lib/loader.js @@ -21,7 +21,7 @@ module.exports = function (source) { return source; } - // The following part renders the template with lodash as aminimalistic loader + // The following part renders the template with lodash as a minimalistic loader // const template = _.template(source, _.defaults(options, { interpolate: /<%=([\s\S]+?)%>/g, variable: 'data' })); // Require !!lodash - using !! will disable all loaders (e.g. babel)
Fix tiny typo Hey noticed a tiny typo in the comment. "as aminimalistic loader" => "as a minimalistic loader"
jantimon_html-webpack-plugin
train
js
7c2ae4eaf708ebceffca89caa1321470060fd2e0
diff --git a/cmd/fs-v1-multipart.go b/cmd/fs-v1-multipart.go index <HASH>..<HASH> 100644 --- a/cmd/fs-v1-multipart.go +++ b/cmd/fs-v1-multipart.go @@ -713,6 +713,11 @@ func (fs *FSObjects) AbortMultipartUpload(ctx context.Context, bucket, object, u } fs.appendFileMapMu.Lock() + // Remove file in tmp folder + file := fs.appendFileMap[uploadID] + if file != nil { + fsRemoveFile(ctx, file.filePath) + } delete(fs.appendFileMap, uploadID) fs.appendFileMapMu.Unlock() @@ -725,10 +730,14 @@ func (fs *FSObjects) AbortMultipartUpload(ctx context.Context, bucket, object, u } return toObjectErr(err, bucket, object) } + // Ignore the error returned as Windows fails to remove directory if a file in it // is Open()ed by the backgroundAppend() fsRemoveAll(ctx, uploadIDDir) + // It is safe to ignore any directory not empty error (in case there were multiple uploadIDs on the same object) + fsRemoveDir(ctx, fs.getMultipartSHADir(bucket, object)) + return nil }
Remove tmp file and multipart folder in FS mode. (#<I>) Fixes #<I>
minio_minio
train
go
6545bef799f069ee10c0cc990ec10133cffc3b8f
diff --git a/src/main/java/com/stripe/model/Subscription.java b/src/main/java/com/stripe/model/Subscription.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/stripe/model/Subscription.java +++ b/src/main/java/com/stripe/model/Subscription.java @@ -22,6 +22,7 @@ public class Subscription extends ApiResource implements MetadataStore<Subscript String billing; Long billingCycleAnchor; BillingThresholds billingThresholds; + Long cancelAt; Boolean cancelAtPeriodEnd; Long canceledAt; Long created;
Add support for `cancel_at` on `Subscription`
stripe_stripe-java
train
java
045ffc01dc5e89e753fbabf87f3ac9b10331899d
diff --git a/sieve/rules/actions.py b/sieve/rules/actions.py index <HASH>..<HASH> 100644 --- a/sieve/rules/actions.py +++ b/sieve/rules/actions.py @@ -5,18 +5,6 @@ class SieveActions(object): self.actions = [] self.implicit_keep = implicit_keep - def __str__(self): - return self.actions.__str__ - - def __len__(self): - return self.actions.__len__() - - def __getitem__(self, key): - return self.actions.__getitem__(key) - - def __iter__(self): - return self.actions.__iter__() - def append(self, action, action_args=None): self.actions.append((action, action_args)) return self @@ -24,3 +12,6 @@ class SieveActions(object): def cancel_implicit_keep(self): self.implicit_keep = False return self + + def __getattr__(self, name): + return getattr(self.actions, name)
make SieveActions delegate to a list instead of impersonate one
garyp_sifter
train
py
44be6231f43a257925f15a5a488fc98bbb0d1134
diff --git a/seqcluster/libs/tool.py b/seqcluster/libs/tool.py index <HASH>..<HASH> 100644 --- a/seqcluster/libs/tool.py +++ b/seqcluster/libs/tool.py @@ -311,7 +311,8 @@ def _add_complete_cluster(idx, meta, clusters): locilen_sorted = sorted(clus.iteritems(), key=operator.itemgetter(1), reverse=True) maxidl = locilen_sorted[0][0] c = cluster(idx) - # c.add_id_member(clusters.idmembers, maxidl) + for idc in meta: + c.add_id_member(clusters[idc].idmembers.keys(), maxidl) c.id = idx c.toomany = len(meta) return c
add all sequences to long clusters
lpantano_seqcluster
train
py
6cf1df6e28464ee4a5b791bc8f745668db274bc8
diff --git a/test/UriHelperTest.php b/test/UriHelperTest.php index <HASH>..<HASH> 100644 --- a/test/UriHelperTest.php +++ b/test/UriHelperTest.php @@ -6,7 +6,6 @@ namespace PhlyTest\Expressive\Mustache; -use ArrayObject; use Phly\Expressive\Mustache\UriHelper; use PHPUnit_Framework_TestCase as TestCase; use Zend\Expressive\Helper\UrlHelper;
Removed unneeded dependency from UriHelperTest
phly_phly-expressive-mustache
train
php
ce5533fd553992efdc1147eec69410127ea18d50
diff --git a/tests/TestCase/View/ViewTest.php b/tests/TestCase/View/ViewTest.php index <HASH>..<HASH> 100644 --- a/tests/TestCase/View/ViewTest.php +++ b/tests/TestCase/View/ViewTest.php @@ -1885,7 +1885,7 @@ TEXT; $View->element('test_element'); } $end = memory_get_usage(); - $this->assertLessThanOrEqual($start + 5000, $end); + $this->assertLessThanOrEqual($start + 15000, $end); } /**
PHPdbg uses a little bit more memory
cakephp_cakephp
train
php
33e8e593953ea1366aa1f5124652e4b13d4bd5de
diff --git a/internal/model/api/shape.go b/internal/model/api/shape.go index <HASH>..<HASH> 100644 --- a/internal/model/api/shape.go +++ b/internal/model/api/shape.go @@ -35,6 +35,7 @@ type Shape struct { Type string Exception bool Enum []string + Flattened bool refs []*ShapeRef } @@ -119,6 +120,10 @@ func (ref *ShapeRef) GoTags(toplevel bool) string { code += `" ` } + if ref.Shape.Flattened { + code += `flattened:"true" ` + } + if toplevel { if ref.Shape.Payload != "" { code += `payload:"` + ref.Shape.Payload + `" `
Add flattened traits to generated model field tags
aws_aws-sdk-go
train
go
5b86ca2a3d03133987dbfc76854b67b0d020fbe6
diff --git a/src/main/java/com/bandwidth/sdk/model/BaseEvent.java b/src/main/java/com/bandwidth/sdk/model/BaseEvent.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/bandwidth/sdk/model/BaseEvent.java +++ b/src/main/java/com/bandwidth/sdk/model/BaseEvent.java @@ -97,7 +97,8 @@ public class BaseEvent extends AbsModelObject implements Event { // } // protected BaseEvent(JSONObject json) { - eventType = EventType.getEnum((String) json.get("eventType")); + updateProperties(json); + eventType = EventType.getEnum((String) json.get("eventType")); } public Date getTime() {
fixed bug in new constructor for BaseEvent
Bandwidth_java-bandwidth
train
java
949be8624e25c9e8494de3f357e321de1a630dcf
diff --git a/src/means/tests/test_simulate.py b/src/means/tests/test_simulate.py index <HASH>..<HASH> 100644 --- a/src/means/tests/test_simulate.py +++ b/src/means/tests/test_simulate.py @@ -12,7 +12,7 @@ class ConstantDerivativesProblem(ODEProblem): right_hand_side=['c_1', 'c_2'], constants=['c_1', 'c_2']) -class TestSimulate(object): +class TestSimulate(unittest.TestCase): def test_simulation_of_simple_model(self): """
whoops, tests should inherit from unittest.TestCase
theosysbio_means
train
py
470e498e20c511fac0c43510c6ba7c47a9445870
diff --git a/dev/com.ibm.ws.concurrent.persistent/src/com/ibm/ws/concurrent/persistent/internal/InvokerTask.java b/dev/com.ibm.ws.concurrent.persistent/src/com/ibm/ws/concurrent/persistent/internal/InvokerTask.java index <HASH>..<HASH> 100644 --- a/dev/com.ibm.ws.concurrent.persistent/src/com/ibm/ws/concurrent/persistent/internal/InvokerTask.java +++ b/dev/com.ibm.ws.concurrent.persistent/src/com/ibm/ws/concurrent/persistent/internal/InvokerTask.java @@ -237,6 +237,8 @@ public class InvokerTask implements Runnable, Synchronization { Config config = persistentExecutor.configRef.get(); if (persistentExecutor.deactivated || !config.enableTaskExecution) { + if (!config.enableTaskExecution) + persistentExecutor.inMemoryTaskIds.clear(); if (trace && tc.isEntryEnabled()) Tr.exit(this, tc, "run[" + taskId + ']', persistentExecutor.deactivated ? "deactivated" : ("enableTaskExecution? " + config.enableTaskExecution)); return;
Issue #<I> server loses ability to run timer if config update hits timing window
OpenLiberty_open-liberty
train
java
a5da7c634c50586768d4b0687057f011197a532e
diff --git a/languagetool-core/src/test/java/org/languagetool/rules/LongSentenceRuleTest.java b/languagetool-core/src/test/java/org/languagetool/rules/LongSentenceRuleTest.java index <HASH>..<HASH> 100644 --- a/languagetool-core/src/test/java/org/languagetool/rules/LongSentenceRuleTest.java +++ b/languagetool-core/src/test/java/org/languagetool/rules/LongSentenceRuleTest.java @@ -41,7 +41,8 @@ public class LongSentenceRuleTest { "a a a a a a a a a a a " + "rather that short text.", rule, languageTool); - LongSentenceRule shortRule = new LongSentenceRule(TestTools.getEnglishMessages(), 6); + LongSentenceRule shortRule = new LongSentenceRule(TestTools.getEnglishMessages()); + shortRule.setDefaultValue(6); assertNoMatch("This is a rather short text.", shortRule, languageTool); assertMatch("This is also a rather short text.", shortRule, languageTool); assertNoMatch("These ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ don't count.", shortRule, languageTool);
test for LongSentenceRule fixed
languagetool-org_languagetool
train
java
286a2c893e4854282e15aeb27de81205c089b93e
diff --git a/lib/hammer_cli_katello/content_view_version.rb b/lib/hammer_cli_katello/content_view_version.rb index <HASH>..<HASH> 100644 --- a/lib/hammer_cli_katello/content_view_version.rb +++ b/lib/hammer_cli_katello/content_view_version.rb @@ -146,6 +146,12 @@ module HammerCLIKatello } ] + if params['update_systems']['included'].key?('ids') + params['update_systems'].delete('excluded') + else + params.delete('update_systems') + end + params.delete('id') params end
Fixes #<I>: Update incremental update based on server API changes.
Katello_hammer-cli-katello
train
rb
ff5cfa0e30b5d1991ddc1a1db7ff6ebbb7b3cc1d
diff --git a/src/com/startingblocktech/tcases/generator/Tuple.java b/src/com/startingblocktech/tcases/generator/Tuple.java index <HASH>..<HASH> 100755 --- a/src/com/startingblocktech/tcases/generator/Tuple.java +++ b/src/com/startingblocktech/tcases/generator/Tuple.java @@ -77,6 +77,14 @@ public class Tuple } /** + * Returns the number of variable bindings in this tuple. + */ + public int size() + { + return bindings_.size(); + } + + /** * Adds a binding to this tuple. */ public Tuple add( VarBindingDef binding) @@ -123,6 +131,7 @@ public class Tuple { boolean compatible; Iterator<VarBindingDef> bindings; + VarBindingDef binding = null; for( compatible = true, bindings = getBindings(); @@ -130,7 +139,18 @@ public class Tuple compatible && bindings.hasNext(); - compatible = bindings.next().getValueDef().getCondition().compatible( properties_)); + compatible = + (binding = bindings.next()) + .getValueDef().getCondition().compatible( properties_)); + + if( !compatible && size() == 1) + { + throw + new IllegalStateException + ( "Invalid " + binding + + ", value condition=" + binding.getValueDef().getCondition() + + " is incompatible its own properties=" + binding.getValueDef().getProperties()); + } return compatible; }
isCompatible: Fail if 1-tuple is self-inconsistent.
Cornutum_tcases
train
java
1b92c8d5d591bcd248a3012feaa894afbb6f2e92
diff --git a/spacy/cli/link.py b/spacy/cli/link.py index <HASH>..<HASH> 100644 --- a/spacy/cli/link.py +++ b/spacy/cli/link.py @@ -46,8 +46,18 @@ def symlink(model_path, link_name, force): # Add workaround for Python 2 on Windows (see issue #909) if util.is_python2() and util.is_windows(): import subprocess - command = ['mklink', '/d', link_path, model_path] - subprocess.call(command, shell=True) + command = ['mklink', '/d', unicode(link_path), unicode(model_path)] + try: + subprocess.call(command, shell=True) + except: + # This is quite dirty, but just making sure other Windows-specific + # errors are caught so users at least see a proper error message. + util.sys_exit( + "Creating a symlink in spacy/data failed. You can still import " + "the model as a Python package and call its load() method, or " + "create the symlink manually:", + "{a} --> {b}".format(a=unicode(model_path), b=unicode(link_path)), + title="Error: Couldn't link model to '{l}'".format(l=link_name)) else: link_path.symlink_to(model_path)
Use unicode paths on Windows/Python 2 and catch other errors (resolves #<I>) try/except here is quite dirty, but it'll at least make sure users see an error message that explains what's going on
explosion_spaCy
train
py
fd57a57e612c750858dfc5905600019ba0c4c39b
diff --git a/lib/rufus/scheduler/jobs.rb b/lib/rufus/scheduler/jobs.rb index <HASH>..<HASH> 100644 --- a/lib/rufus/scheduler/jobs.rb +++ b/lib/rufus/scheduler/jobs.rb @@ -612,7 +612,10 @@ module Rufus super(scheduler, cronline, opts, block) - @cron_line = cronline.is_a?(CronLine) ? cronline : opts[:_t] || CronLine.new(cronline) + @cron_line = + opts[:_t] || + (cronline.is_a?(CronLine) ? cronline : CronLine.new(cronline)) + set_next_time(nil) end
Give back its priority to opts[:_t] in CronLine#initialize
jmettraux_rufus-scheduler
train
rb
3261f7f710c151b40ad5fca88b8fb95519da0612
diff --git a/test.go b/test.go index <HASH>..<HASH> 100644 --- a/test.go +++ b/test.go @@ -176,11 +176,11 @@ func ThreadSafeAddTest(s Storage) func(*testing.T) { func BucketInstanceConsistencyTest(s Storage) func(*testing.T) { return func(t *testing.T) { // Create two bucket instances pointing to the same remote bucket - bucket1, err := s.Create("testbucket", 5, time.Millisecond) + bucket1, err := s.Create("testbucket", 5, time.Second) if err != nil { t.Fatal(err) } - bucket2, err := s.Create("testbucket", 5, time.Millisecond) + bucket2, err := s.Create("testbucket", 5, time.Second) if err != nil { t.Fatal(err) }
test: expire slower for more consistency
Clever_leakybucket
train
go
4cd33bfb5f37c5120b9a9ee9f495a44c8733e973
diff --git a/tests/shared.py b/tests/shared.py index <HASH>..<HASH> 100644 --- a/tests/shared.py +++ b/tests/shared.py @@ -22,7 +22,7 @@ def tmp_file(): def _tmp_root(): - root = '/tmp/peru/test' + root = os.path.join(tempfile.gettempdir(), 'peru', 'test') makedirs(root) return root
stop hardcoding the temp root Summary: The hardcoded value wasn't appropriate for Windows. Reviewers: sean Differential Revision: <URL>
buildinspace_peru
train
py
358467c4eb64949186568f3e91a8e01c046d6aa8
diff --git a/packages/VSSvg/InfoFillIcon.js b/packages/VSSvg/InfoFillIcon.js index <HASH>..<HASH> 100644 --- a/packages/VSSvg/InfoFillIcon.js +++ b/packages/VSSvg/InfoFillIcon.js @@ -2,18 +2,19 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Svg, { G, Path } from 'react-native-svg'; -export default class InfoFillIcon extends Component { +export default class InfoIcon extends Component { render() { return ( <Svg width={ this.props.width } height={ this.props.height } - viewBox="0 0 16 16" + viewBox="-1 -1 18 18" > <G id="Info" transform={ { translate: '(-1606 -163)' } } - fill={ this.props.color } + fill={ this.props.fill } + stroke={ this.props.stroke} > <Path fillRule="evenodd" @@ -25,14 +26,16 @@ export default class InfoFillIcon extends Component { } } -InfoFillIcon.propTypes = { +InfoIcon.propTypes = { width: PropTypes.number, height: PropTypes.number, - color: PropTypes.string, + fill: PropTypes.string, + stroke: PropTypes.string, }; -InfoFillIcon.defaultProps = { +InfoIcon.defaultProps = { width: 25, height: 26, - color: 'black', + fill: 'black', + stroke: 'none', };
feature(InfoFIllICon): add stroke and fill to props
vivintsolar-oss_react-native-components
train
js
47889237f50afd600bedadf0bafc63a6a8db5fb3
diff --git a/lib/browser.js b/lib/browser.js index <HASH>..<HASH> 100644 --- a/lib/browser.js +++ b/lib/browser.js @@ -1,4 +1,4 @@ -define(['litmus'], function (litmus) { +define(['litmus', 'formatting'], function (litmus, formatting) { /** * Namespace: litmus.browser - Litmus running in a browser @@ -17,7 +17,7 @@ define(['litmus'], function (litmus) { */ function addToBody (run) { - var formatter = new litmus.StaticHtmlFormatter(); + var formatter = new formatting.StaticHtmlFormatter(); var element = document.createElement('div'); element.setAttribute('class', 'litmus-results'); element.innerHTML = formatter.format(run); @@ -68,14 +68,19 @@ define(['litmus'], function (litmus) { for (var i = 0, l = tests.length; i < l; i++) { require([tests[i]], function (test) { - var run = test.createRun(); - run.finished.then(function () { - addToBody(run); - }); - run.start(); + ns.run(test); }); } }; + ns.run = function (test) { + console.log(test); + var run = test.createRun(); + run.finished.then(function () { + addToBody(run); + }); + run.start(); + } + return ns; });
Added dep on formatting module (like commandline). Moved test run logic to run method.
usenode_litmus.js
train
js
6002a59e96ee1ae71808a34f0dcb0526eadd1799
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,15 +11,20 @@ setup( classifiers=[ "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Internet :: WWW/HTTP", "Environment :: Web Environment", + "Topic :: Internet :: WWW/HTTP :: Site Management", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Development Status :: 3 - Alpha", ], keywords='http,cryptography,web,joyent', - author='Adam Lindsay', + author='Adam T. Lindsay', author_email='a.lindsay+github@gmail.com', - url='http://github.com/atl/py-http-signature', + url='https://github.com/atl/py-http-signature', license='MIT', packages=find_packages(), include_package_data=True, zip_safe=True, - install_requires=['setuptools','pycrypto'], + install_requires=['pycrypto'], )
more classifiers for pypi
atl_py-http-signature
train
py
6f422d8c446dd32eb2eb656367dac5ee3ea4219a
diff --git a/helper/schema/resource_diff.go b/helper/schema/resource_diff.go index <HASH>..<HASH> 100644 --- a/helper/schema/resource_diff.go +++ b/helper/schema/resource_diff.go @@ -237,7 +237,6 @@ func (d *ResourceDiff) clear(key string) error { // from ResourceDiff's own change data, in addition to existing diff, config, and state. func (d *ResourceDiff) diffChange(key string) (interface{}, interface{}, bool, bool) { old, new := d.getChange(key) - // log.Printf("\nkey:%s\n\nold:%s\n\nnew:%s\n", key, spew.Sdump(old), spew.Sdump(new)) if !old.Exists { old.Value = nil
helper/schema: Remove unused log line Meant to remove this before finalizing the PR. :P
hashicorp_terraform
train
go
6822f0f0022db8114072a5f00b38366117057d46
diff --git a/app/models/product.go b/app/models/product.go index <HASH>..<HASH> 100644 --- a/app/models/product.go +++ b/app/models/product.go @@ -96,7 +96,6 @@ func (productImage *ProductImage) GetSelectedType() string { func (productImage *ProductImage) ScanMediaOptions(mediaOption media_library.MediaOption) error { if bytes, err := json.Marshal(mediaOption); err == nil { - productImage.File.Crop = true return productImage.File.Scan(bytes) } else { return err
Don't set crop to true when ScanMediaOptions
qor_qor-example
train
go
0071eaf664cf9dee939cd8b6c825cb553b361e4a
diff --git a/bin/lib/server.js b/bin/lib/server.js index <HASH>..<HASH> 100644 --- a/bin/lib/server.js +++ b/bin/lib/server.js @@ -28,7 +28,12 @@ module.exports = function (options, callback) { serverFactoryClassName = options.serverFactoryClassName, serverInstance; - var serverModule = require(path.join(options.serverRoot, "..", "index.js")); + var serverModule; + try { + serverModule = require(path.join(options.serverRoot, "..", "index.js")); + } catch(e){ + console.warn("WARN: No index.js for server module defined. Please add a index.js file in the project directory"); + } if (path.resolve(configPath) !== configPath) { configPath = path.join(serverRoot, configPath); @@ -36,7 +41,7 @@ module.exports = function (options, callback) { var config = {}, parameter = {}, - projectRequire = serverModule.require, + projectRequire = (serverModule ? serverModule.require : null), rappidRequire = require; try {
fixed server command if no index.js file is defined
rappid_rAppid.js
train
js
8560521363bff546dfb8940da86113a3b26abff7
diff --git a/javalite-async/src/main/java/org/javalite/async/CommandListener.java b/javalite-async/src/main/java/org/javalite/async/CommandListener.java index <HASH>..<HASH> 100644 --- a/javalite-async/src/main/java/org/javalite/async/CommandListener.java +++ b/javalite-async/src/main/java/org/javalite/async/CommandListener.java @@ -39,7 +39,7 @@ public class CommandListener implements MessageListener{ } } - <T extends Command> void onCommand(T command) { + protected <T extends Command> void onCommand(T command) { if(injector != null){ injector.injectMembers(command); }
#<I> Implement Command XML serialization in JavaLite Async - added protected to onCommand()
javalite_activejdbc
train
java
8cc83cae80e4f324b59a0758a0abc4b39304f6d2
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -55,6 +55,7 @@ params = dict( 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', ], )
Added Python <I> classifier in setup.py
peopledoc_workalendar
train
py
9b313e91eb37c932d6ed4350318730c0b541fe59
diff --git a/Collection.php b/Collection.php index <HASH>..<HASH> 100644 --- a/Collection.php +++ b/Collection.php @@ -921,6 +921,23 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate } /** + * Split a collection into a certain number of groups. + * + * @param int $numberOfGroups + * @return static + */ + public function split($numberOfGroups) + { + if ($this->isEmpty()) { + return new static; + } + + $groupSize = ceil($this->count() / $numberOfGroups); + + return $this->chunk($groupSize); + } + + /** * Chunk the underlying collection array. * * @param int $size
[<I>] Add split method to collection class (#<I>) * add split function to collection * fix nitpicks * fix cs * more cs fixes * moar cs * return new instance
illuminate_support
train
php
c8367cedf2919d8ae11262b1a145a36c48a17d99
diff --git a/core/src/main/java/hudson/tasks/BuildStep.java b/core/src/main/java/hudson/tasks/BuildStep.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/tasks/BuildStep.java +++ b/core/src/main/java/hudson/tasks/BuildStep.java @@ -69,7 +69,7 @@ public interface BuildStep { Fingerprinter.DESCRIPTOR, JavadocArchiver.DESCRIPTOR, JUnitResultArchiver.DESCRIPTOR, - Mailer.DESCRIPTOR, - BuildTrigger.DESCRIPTOR + BuildTrigger.DESCRIPTOR, + Mailer.DESCRIPTOR ); }
mailer and other notifiers should come at the end so that reporting happens after everything that can go wrong went wrong. git-svn-id: <URL>
jenkinsci_jenkins
train
java
f6f4d16bc6c9c762767e1ca1172677052d92e369
diff --git a/generators/generator-constants.js b/generators/generator-constants.js index <HASH>..<HASH> 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -50,7 +50,7 @@ const DOCKER_COUCHBASE = 'couchbase:6.0.3'; // waiting for https://github.com/jh const DOCKER_CASSANDRA = 'cassandra:3.11.6'; const DOCKER_MSSQL = 'mcr.microsoft.com/mssql/server:2017-latest-ubuntu'; const DOCKER_NEO4J = 'neo4j:4.0'; -const DOCKER_HAZELCAST_MANAGEMENT_CENTER = 'hazelcast/management-center:3.12.8'; +const DOCKER_HAZELCAST_MANAGEMENT_CENTER = 'hazelcast/management-center:3.12.9'; // waiting for https://github.com/jhipster/generator-jhipster/issues/11244 const DOCKER_MEMCACHED = 'memcached:1.5.22-alpine'; const DOCKER_REDIS = 'redis:5.0.7'; const DOCKER_KEYCLOAK = 'jboss/keycloak:9.0.0'; // The version should match the attribute 'keycloakVersion' from /docker-compose/templates/realm-config/jhipster-realm.json.ejs and /server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs
Update hazelcast/management-center docker image version to <I>
jhipster_generator-jhipster
train
js
2b5f858b92997a83f015298eedd9410cbe394ff2
diff --git a/pycbc/workflow/coincidence.py b/pycbc/workflow/coincidence.py index <HASH>..<HASH> 100644 --- a/pycbc/workflow/coincidence.py +++ b/pycbc/workflow/coincidence.py @@ -606,6 +606,15 @@ def convert_trig_to_hdf(workflow, hdfbank, xml_trigger_files, out_dir, tags=[]): trig_files += trig2hdf_node.output_files return trig_files +def make_psd_file(workflow, segment_file, segment_name, out_dir, tags=None): + tags = [] if not tags else tags + node = PlotExecutable(workflow.cp, 'calculate_spectrum', ifo=segment_file.ifo, + out_dir=out_dir, tags=tags).create_node() + node.add_input_opt('--analysis-segment-file', psd_file) + node.add_opt('--segment-name', segment_name) + node.new_output_file_opt(workflow.analysis_time, '.hdf', '--output-file') + workflow += node + def setup_interval_coinc_inj(workflow, hdfbank, full_data_trig_files, inj_trig_files, background_file, veto_file, veto_name, out_dir, tags=[]): """
add workflow setup function for psd hdf file generation
gwastro_pycbc
train
py
bf2030d0b54d678b8b1d27e9d55003dd1fc38806
diff --git a/src/foremast/configs/prepare_configs.py b/src/foremast/configs/prepare_configs.py index <HASH>..<HASH> 100644 --- a/src/foremast/configs/prepare_configs.py +++ b/src/foremast/configs/prepare_configs.py @@ -42,7 +42,7 @@ def process_git_configs(git_short=''): collections.defaultdict: Configurations stored for each environment found. """ - LOG.info('Processing application.json files from GitLab.') + LOG.info('Processing application.json files from GitLab "%s".', git_short) server = gitlab.Gitlab(GIT_URL, token=GITLAB_TOKEN)
feat: Include short Git name in INFO
foremast_foremast
train
py
7b8edc8c7be1d616ed66e643a086ee06378965d6
diff --git a/lib/ripl/rc/squeeze_history.rb b/lib/ripl/rc/squeeze_history.rb index <HASH>..<HASH> 100644 --- a/lib/ripl/rc/squeeze_history.rb +++ b/lib/ripl/rc/squeeze_history.rb @@ -26,6 +26,7 @@ module Ripl::Rc::SqueezeHistory super end + # avoid double initialization for history def before_loop return super if SqueezeHistory.disabled? super if history.empty?
comment: # avoid double initialization for history
godfat_ripl-rc
train
rb
592e959b72c75487631a15ad72fd0ab87d5612fb
diff --git a/maxims/test/test_indirection.py b/maxims/test/test_indirection.py index <HASH>..<HASH> 100644 --- a/maxims/test/test_indirection.py +++ b/maxims/test/test_indirection.py @@ -34,6 +34,7 @@ class StoredLaser(item.Item): +@interface.implementer(ILaser) class Laser(object): """ A laser.
Indirection tests forget to declare implemented interface
lvh_maxims
train
py
e8306fad8162b7264be822124e61446379e34497
diff --git a/lib/silo/cli.rb b/lib/silo/cli.rb index <HASH>..<HASH> 100644 --- a/lib/silo/cli.rb +++ b/lib/silo/cli.rb @@ -106,6 +106,12 @@ module Silo puts ' or: silo remote rm <name>' end case action + when nil + repo.remotes.each_value do |remote| + info = remote.name + info += " #{remote.url}" if $VERBOSE + puts info + end when 'add' if url.nil? repo.add_remote name, url diff --git a/lib/silo/remote/base.rb b/lib/silo/remote/base.rb index <HASH>..<HASH> 100644 --- a/lib/silo/remote/base.rb +++ b/lib/silo/remote/base.rb @@ -14,6 +14,9 @@ module Silo # @return [String] The name of this remote attr_reader :name + # @return [String] The URL of this remote + attr_reader :url + # Creates a new remote with the specified name # # @param [Repository] repo The Silo repository this remote belongs to
Allow listing all remotes via CLI
koraktor_silo
train
rb,rb
923eab2984f31829e768406e999732ea72bac066
diff --git a/src/Cookie/ResponseCookie.php b/src/Cookie/ResponseCookie.php index <HASH>..<HASH> 100644 --- a/src/Cookie/ResponseCookie.php +++ b/src/Cookie/ResponseCookie.php @@ -37,6 +37,13 @@ final class ResponseCookie { list($name, $value) = $nameValue; + $name = \trim($name); + $value = \trim($value, " \t\n\r\0\x0B\""); + + if ($name === "") { + return null; + } + // httpOnly must default to false for parsing $meta = CookieAttributes::empty();
Remove leading and trailing whitespace to comply with RFC
amphp_http
train
php
dd70c5df3c08a785b3b63c066eb83efab426b54b
diff --git a/graphics/sprite.py b/graphics/sprite.py index <HASH>..<HASH> 100644 --- a/graphics/sprite.py +++ b/graphics/sprite.py @@ -104,6 +104,7 @@ class Sprite: if not y is None: y -= 1 # To get pixel next to pixel which is on. + # Get coordinates the right way around. pos = (x, y) size = [len(image), len(image[0])] for i in range(4-side): diff --git a/touchingTest.py b/touchingTest.py index <HASH>..<HASH> 100644 --- a/touchingTest.py +++ b/touchingTest.py @@ -9,7 +9,7 @@ class Car(g.shapes.Image): super(Car, self).__init__() def genImage(self): - return [[0, 1, 0], [1, 1, 1], [0, 1, 0]] + return [[0, 1, 0], [0, 0, 0], [0, 1, 0]] def main(): @@ -57,6 +57,8 @@ def main(): str_ += str(2) if mover.touching(screen, 3): str_ += str(3) + if mover.touching(screen): + str_ += 'T' touchMeter.image.text = str_
Added test for any side to touchingTest.
olls_graphics
train
py,py