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
a4f794cf20fe9f615f1c8e2d2f3ce4a133cc9170
diff --git a/middleware-public/exclusions.js b/middleware-public/exclusions.js index <HASH>..<HASH> 100644 --- a/middleware-public/exclusions.js +++ b/middleware-public/exclusions.js @@ -8,7 +8,7 @@ module.exports = function () { } var args = Array.prototype.slice.call(arguments), - exclusions = [new RegExp("^" + "/admin".replace(/\//g, '\/') + "\/(login|public)")], // TODO: change /admin to linz.get('admin path') + exclusions = [new RegExp("^" + "/admin".replace(/\//g, '\/') + "\/(login|logout|public)")], // TODO: change /admin to linz.get('admin path') middlewares = args; if (Array.isArray(args[0]) && args.length === 1) {
Linz by default will now exclude authentication checks and navigation middleware on logout route.
linzjs_linz
train
js
e46960306e0969f5806d650dd0a07148aa4aa9e7
diff --git a/lib/json_api_resource/resource.rb b/lib/json_api_resource/resource.rb index <HASH>..<HASH> 100644 --- a/lib/json_api_resource/resource.rb +++ b/lib/json_api_resource/resource.rb @@ -54,17 +54,23 @@ module JsonApiResource if match = method.to_s.match(/^(.*)=$/) self.client.send(match[1], args.first) elsif self.client.respond_to?(method.to_sym) - self.client.send(method) + is_method = self.client.methods.include?(method.to_sym) + argument_count = is_method ? self.client.method(method.to_sym).arity : 0 + if argument_count > 0 || argument_count == -1 + self.client.send(method, args.first) + else + self.client.send(method) + end else super end end def errors - error_list = JsonApiResource::ApiErrors(self.client.errors).each do | k,messages| + JsonApiResource::ApiErrors(self.client.errors).each do | k,messages| self.errors.add(k.to_sym, Array(messages).join(', ')) end - error_list || {} + self.errors end def self.method_missing(method, *args, &block)
Update the error collection defaulting and pass parameters to methods that want them. Returning self.errors is best because that has the errors already and is an initialized collection. The method_missing method does not pass arguments to methods that want them, so json_api_client's calling of update_attributes does not work because nothing is passed to it. Now we pass along an argument if a method can handle one.
avvo_json_api_resource
train
rb
cfddccc0569f3d8fe1e97b8b3481ccbca47845f7
diff --git a/core/src/main/java/lucee/runtime/regex/Perl5Util.java b/core/src/main/java/lucee/runtime/regex/Perl5Util.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/lucee/runtime/regex/Perl5Util.java +++ b/core/src/main/java/lucee/runtime/regex/Perl5Util.java @@ -100,13 +100,11 @@ final class Perl5Util { if (offset <= strInput.length()) input.setCurrentOffset(offset - 1); Array rtn = new ArrayImpl(); - if (offset <= strInput.length()) { - MatchResult result; - while (matcher.contains(input, pattern)) { - result = matcher.getMatch(); - if (!matchAll) return result.toString(); - rtn.appendEL(result.toString()); - } + MatchResult result; + while (matcher.contains(input, pattern)) { + result = matcher.getMatch(); + if (!matchAll) return result.toString(); + rtn.appendEL(result.toString()); } if (!matchAll) return ""; return rtn;
Added a fix to reMatch/reMatchNoCase regression with empty string for LDEV-<I>
lucee_Lucee
train
java
6aa301e9baf172b5f32cf598b867bf2c86b6cc85
diff --git a/examples/examples_pairwise_ttests.py b/examples/examples_pairwise_ttests.py index <HASH>..<HASH> 100644 --- a/examples/examples_pairwise_ttests.py +++ b/examples/examples_pairwise_ttests.py @@ -1,8 +1,7 @@ import pandas as pd -from pingouin import pairwise_ttests - -# Change default display format of pandas -pd.set_option('display.float_format', lambda x: '%.3f' % x) +from pingouin import pairwise_ttests, print_table +import os +os.system('mode con: cols=200 lines=40') # Load a fake dataset: the INSOMNIA study # Goal: evaluate the influence of a treatment on sleep duration in a control @@ -38,5 +37,5 @@ df = pd.read_csv('sleep_dataset.csv') stats = pairwise_ttests(dv='DV', within='Time', between='Group', effects='all', data=df, alpha=.05, tail='two-sided', padjust='fdr_by', - effsize='cohen', return_desc=True) -print(stats) + effsize='cohen', return_desc=False) +print_table(stats)
added print_table to pairwise_ttests
raphaelvallat_pingouin
train
py
399f0bbc04da4585247a86afabf59844395d682b
diff --git a/Entity/ExtendedFieldRepositoryTrait.php b/Entity/ExtendedFieldRepositoryTrait.php index <HASH>..<HASH> 100644 --- a/Entity/ExtendedFieldRepositoryTrait.php +++ b/Entity/ExtendedFieldRepositoryTrait.php @@ -265,7 +265,10 @@ trait ExtendedFieldRepositoryTrait $this->getEntityManager()->getConnection()->update( $extendedTable, $column, - ['lead_id' => $entity->getId()] + array( + 'lead_id' => $entity->getId(), + 'lead_field_id' => $values['id'], + ) ); }
better where clause on xref tables n/c of indexes
TheDMSGroup_mautic-extended-field
train
php
d8fd23eb49d5fdbd621ac5fa951fbcd6dfbe126f
diff --git a/lib/lexer_block/list.js b/lib/lexer_block/list.js index <HASH>..<HASH> 100644 --- a/lib/lexer_block/list.js +++ b/lib/lexer_block/list.js @@ -78,6 +78,7 @@ function skipOrderedListMarker(state, startLine) { module.exports = function list(state, startLine, endLine, silent) { var nextLine, indent, + oldTShift, oldIndent, oldTight, start, @@ -163,7 +164,9 @@ module.exports = function list(state, startLine, endLine, silent) { oldIndent = state.blkIndent; oldTight = state.tight; - state.blkIndent = state.tShift[startLine] = indent; + oldTShift = state.tShift[startLine]; + state.tShift[startLine] = contentStart - state.bMarks[startLine]; + state.blkIndent = indent; state.tight = true; state.lexerBlock.tokenize(state, startLine, endLine, true); @@ -176,7 +179,8 @@ module.exports = function list(state, startLine, endLine, silent) { // but we should filter last element, because it means list finish prevEmptyEnd = (state.line - startLine) > 1 && isEmpty(state, state.line - 1); - state.blkIndent = state.tShift[startLine] = oldIndent; + state.blkIndent = oldIndent; + state.tShift[startLine] = oldTShift; state.tight = oldTight; state.tokens.push({ type: 'list_item_close' });
Fix nested code blocks inside lists This is now parsed correctly: --- - test ---
markdown-it_markdown-it
train
js
3b83c4b9d88e89fe4b4b14c710c3b0465cbacc3d
diff --git a/Library/Stubs/Generator.php b/Library/Stubs/Generator.php index <HASH>..<HASH> 100644 --- a/Library/Stubs/Generator.php +++ b/Library/Stubs/Generator.php @@ -236,7 +236,7 @@ class Generator * * @return string */ - protected function buildConstant(ClassConstant $constant, $indent) + protected function buildConstant(ClassConstant $constant, string $indent): string { $source = 'const '.$constant->getName(); @@ -368,13 +368,13 @@ class Generator /** * Prepare AST default value to PHP code print. * - * @param $parameter + * @param array $parameter * * @throws Exception\NotImplementedException * * @return string */ - protected function wrapPHPValue($parameter) + protected function wrapPHPValue(array $parameter): string { switch ($parameter['default']['type']) { case 'null':
Add type hints to method signatures
phalcon_zephir
train
php
546c39763a39ec4555fd8a2fecdd47d812fb770f
diff --git a/Bundle/PageBundle/Helper/UrlHelper.php b/Bundle/PageBundle/Helper/UrlHelper.php index <HASH>..<HASH> 100644 --- a/Bundle/PageBundle/Helper/UrlHelper.php +++ b/Bundle/PageBundle/Helper/UrlHelper.php @@ -118,7 +118,10 @@ class UrlHelper $urlReferer = substr($referer, strlen($completeUrl)); //remove potential parameters - $urlReferer = substr($urlReferer, 0, stripos($urlReferer, "?") ); + $position = stripos($urlReferer, "?"); + if ($position > 0) { + $urlReferer = substr($urlReferer, 0, stripos($urlReferer, "?") ); + } return $urlReferer; }
[VICMS-<I>] migrer widgetFilterBundle
Victoire_victoire
train
php
025f4613b11ec98581785a1ba706f4f20c3ad285
diff --git a/test/util.js b/test/util.js index <HASH>..<HASH> 100644 --- a/test/util.js +++ b/test/util.js @@ -1,5 +1,19 @@ module.exports = { runIfSp: function(testFunc){ return process.env.SERIAL_PORT ? testFunc : null; + }, + mockSensorAdapter: function(cb){ + return { + readSensor: function(a,b,c,done){ + return cb(done); + } + } + }, + mockMotorAdapter: function(cb){ + return { + setMotors: function(a,b,c,d,done){ + return cb(done); + } + } } } \ No newline at end of file
added mock adapters to test utils for future use
hflw_node-robot
train
js
3688fc95fd9a1a03f4e35ec2d9c09f44824bd406
diff --git a/lib/rchardet/charsetprober.rb b/lib/rchardet/charsetprober.rb index <HASH>..<HASH> 100755 --- a/lib/rchardet/charsetprober.rb +++ b/lib/rchardet/charsetprober.rb @@ -53,13 +53,18 @@ module CharDet end def filter_high_bit_only(aBuf) - aBuf.gsub!(/([\x00-\x7F])+/, ' ') - return aBuf + # DO NOT USE `gsub!` + # It will remove all characters from the buffer that is later used by + # other probers. This is because gsub! removes data from the instance variable + # that will be passed to later probers, while gsub makes a new instance variable + # that will not. + newBuf = aBuf.gsub(/([\x00-\x7F])+/, ' ') + return newBuf end def filter_without_english_letters(aBuf) - aBuf.gsub!(/([A-Za-z])+/,' ') - return aBuf + newBuf = aBuf.gsub(/([A-Za-z])+/,' ') + return newBuf end def filter_with_english_letters(aBuf)
fixed a serious bug that caused filter_without_english_characters to affect all probers that came after the prober that called it first
jmhodges_rchardet
train
rb
3392605ee39e5e74ff5c53e70ba6b4acab36f7be
diff --git a/ArrayTraits/src/ExportInterface.php b/ArrayTraits/src/ExportInterface.php index <HASH>..<HASH> 100644 --- a/ArrayTraits/src/ExportInterface.php +++ b/ArrayTraits/src/ExportInterface.php @@ -20,9 +20,11 @@ interface ExportInterface /** * Convert object into YAML string. * + * @param int $inline + * @param int $indent * @return string */ - public function toYaml(); + public function toYaml($inline = 3, $indent = 2); /** * Convert object into JSON string.
Fix Declaration of ArrayTraits\Export::toYaml() must be compatible with ExportInterface::toYaml()
rockettheme_toolbox
train
php
8fcfe97e11510f5d552ef2ddbffbb0063e260e16
diff --git a/test/katex-spec.js b/test/katex-spec.js index <HASH>..<HASH> 100644 --- a/test/katex-spec.js +++ b/test/katex-spec.js @@ -582,10 +582,10 @@ describe("An over/brace/brack parser", function() { expect(numer.body).toHaveLength(4); }); - it("should create a demonimator from the atoms after \\over", function() { + it("should create a denominator from the atoms after \\over", function() { const parse = getParsed(complexOver)[0]; - const denom = parse.numer; + const denom = parse.denom; expect(denom.body).toHaveLength(4); });
Fix test that was checking numerator instead of denominator (#<I>) * Test was checking numerator instead of denominator * fixed a typo
KaTeX_KaTeX
train
js
3e03407c7b6fb99b9f505c523e9176eeed332c0f
diff --git a/js/cloudmine.js b/js/cloudmine.js index <HASH>..<HASH> 100644 --- a/js/cloudmine.js +++ b/js/cloudmine.js @@ -1,4 +1,4 @@ -/* CloudMine JavaScript Library v0.9.5 cloudmine.me | cloudmine.me/license */ +/* CloudMine JavaScript Library v0.9.6 cloudmine.me | cloudmine.me/license */ (function() { var version = '0.9.6';
Fixed a comment to <I>
cloudmine_CloudMineSDK-JavaScript
train
js
b860007dc0e6a062dc5f145b5e4a9b4e043cc6b9
diff --git a/lib/commander.rb b/lib/commander.rb index <HASH>..<HASH> 100644 --- a/lib/commander.rb +++ b/lib/commander.rb @@ -41,7 +41,7 @@ $terminal.wrap_at = HighLine::SystemExtensions.terminal_size.first - 10 rescue 8 # Display friendly interruption message trap 'INT' do - say program :int_message + say program(:int_message) exit end 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 @@ -3,7 +3,7 @@ require 'optparse' module Commander class Runner - + #-- # Exceptions #++ @@ -26,8 +26,7 @@ module Commander def initialize args = ARGV @args = args - @commands = {} - @options = Hash.new false + @commands, @options = {}, {} @program = { :help_formatter => Commander::HelpFormatter::Terminal, :int_message => "\nProcess interrupted",
- Silenced a warning
commander-rb_commander
train
rb,rb
3ff7de4113f0b1d2e5ab5b069887ba8392ff26e9
diff --git a/api/v1/lib/executor/config/config.go b/api/v1/lib/executor/config/config.go index <HASH>..<HASH> 100644 --- a/api/v1/lib/executor/config/config.go +++ b/api/v1/lib/executor/config/config.go @@ -2,6 +2,7 @@ package config import ( "errors" + "fmt" "os" "strconv" "time" @@ -44,7 +45,7 @@ type EnvError struct { Message string } -func (ee *EnvError) Error() string { return ee.Message } +func (ee *EnvError) Error() string { return fmt.Sprintf("%s: %v", ee.Message, ee.Reasons) } // FromEnv returns a configuration generated from MESOS_xyz environment variables. func FromEnv() (Config, error) { return fromEnv(os.Getenv) }
executor: log reasons for executor configuration error
mesos_mesos-go
train
go
01fdd0cde14310b450824c443c60cfed64531520
diff --git a/js/test/Exchange/test.orderbook.js b/js/test/Exchange/test.orderbook.js index <HASH>..<HASH> 100644 --- a/js/test/Exchange/test.orderbook.js +++ b/js/test/Exchange/test.orderbook.js @@ -36,7 +36,7 @@ module.exports = (exchange, orderbook, method, symbol) => { // 'info': {}, } - expect (orderbook).to.have.all.keys (format) + expect (orderbook).to.include.all.keys (format) const bids = orderbook.bids const asks = orderbook.asks
test.orderbook.js chai assertion on keys
ccxt_ccxt
train
js
42b5a07da8e6285113bc93c9e4d3f0db0da9e097
diff --git a/src/lib/Supra/Controller/Layout/Theme/Configuration/ThemeConfiguration.php b/src/lib/Supra/Controller/Layout/Theme/Configuration/ThemeConfiguration.php index <HASH>..<HASH> 100644 --- a/src/lib/Supra/Controller/Layout/Theme/Configuration/ThemeConfiguration.php +++ b/src/lib/Supra/Controller/Layout/Theme/Configuration/ThemeConfiguration.php @@ -52,6 +52,11 @@ class ThemeConfiguration extends ThemeConfigurationAbstraction * @var string */ public $urlBase; + + /** + * @var string + */ + public $previewUrl; /** * @var array
added previewUrl to themeConfiguration
sitesupra_sitesupra
train
php
1ad1c5e87e1d3988832833111d14754e9e7a68f7
diff --git a/stagpy/__init__.py b/stagpy/__init__.py index <HASH>..<HASH> 100644 --- a/stagpy/__init__.py +++ b/stagpy/__init__.py @@ -68,16 +68,16 @@ def load_mplstyle(): plt = importlib.import_module('matplotlib.pyplot') if conf.plot.mplstyle: for style in conf.plot.mplstyle.split(): - stfile = config.CONFIG_DIR / (style + '.mplstyle') - if stfile.is_file(): - style = str(stfile) - if ISOLATED: - break + if not ISOLATED: + stfile = config.CONFIG_DIR / (style + '.mplstyle') + if stfile.is_file(): + style = str(stfile) try: plt.style.use(style) except OSError: - print('Cannot import style {}.'.format(style), - file=sys.stderr) + if not ISOLATED or DEBUG: + print('Cannot import style {}.'.format(style), + file=sys.stderr) conf.plot.mplstyle = '' if conf.plot.xkcd: plt.xkcd()
Don't report faulty mplstyle when ISOLATED Report them anyway if DEBUG
StagPython_StagPy
train
py
71615a172cafa21ad4af0c814a3136cf1d603ce3
diff --git a/api/client.go b/api/client.go index <HASH>..<HASH> 100644 --- a/api/client.go +++ b/api/client.go @@ -15,7 +15,7 @@ var ( errRedirect = errors.New("redirect") defaultHTTPClientSetup sync.Once defaultHTTPClient = &http.Client{ - Timeout: time.Second * 5, + Timeout: time.Second * 30, } )
Increase default timeout to <I>s which should allow for any operation to complete.
hashicorp_vault
train
go
0a37a0ea367733273ec67b005a9e3f355a49ca8e
diff --git a/openid/cryptutil.py b/openid/cryptutil.py index <HASH>..<HASH> 100644 --- a/openid/cryptutil.py +++ b/openid/cryptutil.py @@ -14,7 +14,8 @@ http://www.amk.ca/python/code/crypto """ __all__ = ['randrange', 'hmacSha1', 'sha1', 'randomString', - 'binaryToLong', 'longToBinary', 'longToBase64', 'base64ToLong'] + 'binaryToLong', 'longToBinary', 'longToBase64', 'base64ToLong', + 'hmacSha256', 'sha256'] import hmac import os @@ -50,12 +51,15 @@ if sha256_module is not None: def hmacSha256(key, text): return hmac.new(key, text, sha256_module).digest() - __all__.append('hmacSha256') - def sha256(s): return sha256_module.new(s).digest() - __all__.append('sha256') +else: + def hmacSha256(unused_key, unused_text): + raise NotImplementedError + + def sha256(s): + raise NotImplementedError try: from Crypto.Util.number import long_to_bytes, bytes_to_long
[project @ Added stub functions for when sha<I> is not available]
openid_python-openid
train
py
a33e2b89c8d1f4997b4bf423951eef50ee0c4a3d
diff --git a/Doctrine/Collection.php b/Doctrine/Collection.php index <HASH>..<HASH> 100644 --- a/Doctrine/Collection.php +++ b/Doctrine/Collection.php @@ -157,7 +157,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator * @return mixed */ public function getFirst() { - return $this->data[0]; + return reset($this->data); } /** * @return mixed
[amadeus] Changed getFirst to use reset function for proper behavior on empty
doctrine_annotations
train
php
bf27435b85cf85da7e14a8a653e007a756112e8b
diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/AbstractToString.java b/core/src/main/java/com/google/errorprone/bugpatterns/AbstractToString.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/AbstractToString.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/AbstractToString.java @@ -128,14 +128,14 @@ public abstract class AbstractToString extends BugChecker if (type instanceof MethodType) { type = type.getReturnType(); } - if (!typePredicate().apply(type, state)) { - return NO_MATCH; - } Tree parent = state.getPath().getParentPath().getLeaf(); ToStringKind toStringKind = isToString(parent, tree, state); if (toStringKind == ToStringKind.NONE) { return NO_MATCH; } + if (!typePredicate().apply(type, state)) { + return NO_MATCH; + } Optional<Fix> fix; switch (toStringKind) { case IMPLICIT:
Re-order checks in AbstractToString RELNOTES: N/A ------------- Created by MOE: <URL>
google_error-prone
train
java
b2ec421ca3789075d95fc694a8f3e20c0877a336
diff --git a/plugins/jobs/server/models/job.py b/plugins/jobs/server/models/job.py index <HASH>..<HASH> 100644 --- a/plugins/jobs/server/models/job.py +++ b/plugins/jobs/server/models/job.py @@ -34,7 +34,7 @@ class Job(AccessControlledModel): ('userId', SortDir.ASCENDING), ('created', SortDir.DESCENDING) ) - self.ensureIndices([(compoundSearchIndex, {})]) + self.ensureIndices([(compoundSearchIndex, {}), 'created']) self.exposeFields(level=AccessType.READ, fields={ 'title', 'type', 'created', 'interval', 'when', 'status',
Ensure that there is an index on the created field for job. With the admin list-all-jobs option, the list will fail if the job collection is too big. This fixes that.
girder_girder
train
py
7842bda50abe0cea3490acb9363ac94d07148e54
diff --git a/rllib/train.py b/rllib/train.py index <HASH>..<HASH> 100755 --- a/rllib/train.py +++ b/rllib/train.py @@ -182,10 +182,15 @@ def run(args, parser): inputs = force_list(input_) # This script runs in the ray/rllib dir. rllib_dir = Path(__file__).parent - abs_inputs = [ - str(rllib_dir.absolute().joinpath(i)) - if not os.path.exists(i) else i for i in inputs - ] + + def patch_path(path): + if os.path.exists(path): + return path + else: + abs_path = str(rllib_dir.absolute().joinpath(path)) + return abs_path if os.path.exists(abs_path) else path + + abs_inputs = list(map(patch_path, inputs)) if not isinstance(input_, list): abs_inputs = abs_inputs[0]
[rllib] Fix to allow input strings that are not file paths (#<I>)
ray-project_ray
train
py
d75286396808d7421633108772f872a1ee68779a
diff --git a/ioc_module.js b/ioc_module.js index <HASH>..<HASH> 100644 --- a/ioc_module.js +++ b/ioc_module.js @@ -34,17 +34,17 @@ const { } = require('./dist/commonjs/index'); const { + AutoStartService, CorrelationService, + DeleteProcessModelService, + ExecuteProcessService, FlowNodeInstanceService, FlowNodePersistenceFacade, - DeleteProcessModelService, ProcessModelService, + ResumeProcessService, TimerFacade, } = require('./dist/commonjs/index'); -const {ExecuteProcessService} = require('./dist/commonjs/index'); -const {ResumeProcessService} = require('./dist/commonjs/index'); - const { BoundaryEventHandlerFactory, FlowNodeHandlerFactory, @@ -68,6 +68,11 @@ function registerServices(container) { container.register('BpmnModelParser', BpmnModelParser); container + .register('AutoStartService', AutoStartService) + .dependencies('EventAggregator','ExecuteProcessService','ProcessModelService') + .singleton(); + + container .register('ExecuteProcessService', ExecuteProcessService) .dependencies( 'CorrelationService',
:sparkles: Update ioc registrations
process-engine_process_engine_core
train
js
97c6c2520de80fc4b4f9aec30ebfb8369d2d65d5
diff --git a/pytestsalt/fixtures/daemons.py b/pytestsalt/fixtures/daemons.py index <HASH>..<HASH> 100644 --- a/pytestsalt/fixtures/daemons.py +++ b/pytestsalt/fixtures/daemons.py @@ -37,11 +37,13 @@ from tornado.process import Subprocess log = logging.getLogger(__name__) HANDLED_LEVELS = { - 2: 'warning', # logging.WARN, # -v - 3: 'info', # logging.INFO, # -vv - 4: 'debug', # logging.DEBUG, # -vvv - 5: 'trace', # logging.TRACE, # -vvvv - 6: 'garbage' # logging.GARBAGE # -vvvvv + 0: 'critical', # logging.CRITICAL # -v + 1: 'error', # logging.ERROR # -vv + 2: 'warning', # logging.WARN, # -vvv + 3: 'info', # logging.INFO, # -vvvv + 4: 'debug', # logging.DEBUG, # -vvvvv + 5: 'trace', # logging.TRACE, # -vvvvvv + 6: 'garbage' # logging.GARBAGE # -vvvvvvv }
Adapt to the new catchlog levels
saltstack_pytest-salt
train
py
2935118dab27f315907e9a769f89bb65d5f66df4
diff --git a/application/Espo/ORM/Repository/RDBRepository.php b/application/Espo/ORM/Repository/RDBRepository.php index <HASH>..<HASH> 100644 --- a/application/Espo/ORM/Repository/RDBRepository.php +++ b/application/Espo/ORM/Repository/RDBRepository.php @@ -143,11 +143,10 @@ class RDBRepository extends Repository if ($entity->isNew()) { if (empty($options['keepNew'])) { $entity->setIsNew(false); - } - } else { - if ($entity->isFetched()) { $entity->updateFetchedValues(); } + } else { + $entity->updateFetchedValues(); } $entity->setAsNotBeingSaved();
repository: calling updateFetchedValues always after save
espocrm_espocrm
train
php
3c67fd057b04f997af21dce0a8604fad31241add
diff --git a/esteid/tests.py b/esteid/tests.py index <HASH>..<HASH> 100644 --- a/esteid/tests.py +++ b/esteid/tests.py @@ -32,7 +32,7 @@ class TestParseCommonName(TestCase): class TestSigningWithMobile(TestCase): def get_example_file(self): - return urlopen('http://lorempixel.com/1920/1920/').read() + return os.urandom(4096) def get_service(self): return DigiDocService('Testimine', debug=False)
Lorempixel is dead, generate random file
thorgate_django-esteid
train
py
0130398e9f0d208ee099366c3be474aa1ec5022a
diff --git a/core/dbt/config/project.py b/core/dbt/config/project.py index <HASH>..<HASH> 100644 --- a/core/dbt/config/project.py +++ b/core/dbt/config/project.py @@ -217,7 +217,7 @@ class PartialProject: project_dict: Dict[str, Any] verify_version: bool = field( metadata=dict(description=( - 'If True, verify the dbt version matches the rquired version' + 'If True, verify the dbt version matches the required version' )) )
Update core/dbt/config/project.py
fishtown-analytics_dbt
train
py
6e40fba8e59742ff5bbca0afae6396cd803092bd
diff --git a/web/opensubmit/models/userprofile.py b/web/opensubmit/models/userprofile.py index <HASH>..<HASH> 100644 --- a/web/opensubmit/models/userprofile.py +++ b/web/opensubmit/models/userprofile.py @@ -68,14 +68,14 @@ class UserProfile(models.Model): Check if the user information is complete, or if we need to ask for more. ''' if not self.user.first_name: - return False + return False, "Missing first name." if not self.user.last_name: - return False + return False, "Missing last name." if not self.user.email: - return False + return False, "Missing eMail address." if StudyProgram.objects.count()>1 and not self.study_program: - return False - return True + return False, "Missing choice of a study program." + return True, "" def db_fixes(user): ''' diff --git a/web/opensubmit/views.py b/web/opensubmit/views.py index <HASH>..<HASH> 100644 --- a/web/opensubmit/views.py +++ b/web/opensubmit/views.py @@ -94,7 +94,9 @@ def dashboard(request): pass # if the user settings are not complete (e.f. adter OpenID registration), we MUST fix them first - if not request.user.profile.is_complete(): + is_complete, error_msg = request.user.profile.is_complete() + if not is_complete: + messages.error(request, "Please complete your user information: "+error_msg) return redirect('settings') # render dashboard
Show hint on redirection to user settings dialogue.
troeger_opensubmit
train
py,py
2087130cc688f9b01b4b601f07d2751d16bad7c3
diff --git a/bolt.py b/bolt.py index <HASH>..<HASH> 100644 --- a/bolt.py +++ b/bolt.py @@ -321,7 +321,7 @@ class BatchingBolt(Bolt): """Return the group key used to group tuples within a batch. By default, returns None, which put all tuples in a single - batch, effectively just time-based batching. Override this create + batch, effectively just time-based batching. Override this to create multiple batches based on a key. :param tup: the tuple used to extract a group key @@ -422,13 +422,15 @@ class BatchingBolt(Bolt): self.raise_exception(e, self._current_tups) if self.auto_fail: + self.failed = [] with self._batch_lock: for batch in itervalues(self._batches): for tup in batch: self.fail(tup) + self.failed.append(tup) self.exc_info = sys.exc_info() - os.kill(os.getpid(), signal.SIGUSR1) # interrupt stdin waiting + os.kill(self.pid, signal.SIGUSR1) # interrupt stdin waiting def _handle_worker_exception(self, signum, frame): """Handle an exception raised in the worker thread.
autospec all of the mocks to make sure API breakages will be noticed in the future. Attempted to make _handle_worker_exception mock work.
pystorm_pystorm
train
py
5afda75f47c131e8e0bc98fe76bb7a630b5d250d
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -52,6 +52,8 @@ setup( 'readlike>=0.1', 'requests==2.6.0', 'ReParser>=1.4', + # use alpha protobuf for official Python 3 support + 'protobuf==3.0.0a3', # use forked urwid until there's a 1.3 release with colour bugfix 'hangups-urwid==1.2.2-dev', # backport enum for python3.3:
Add protobuf to setup.py
tdryer_hangups
train
py
02d8fd0fda001a431e3fe5273bd6ed7de7e55a04
diff --git a/gocode.go b/gocode.go index <HASH>..<HASH> 100644 --- a/gocode.go +++ b/gocode.go @@ -279,10 +279,9 @@ func cmdSet(c *rpc.Client) { func tryRunServer() os.Error { path := GetExecutableFileName() - args := []string{os.Args[0], "-s", "-sock", *sock, "-addr", *addr} cwd, _ := os.Getwd() - procattr := os.ProcAttr{cwd, os.Environ(), []*os.File{nil, nil, nil}} + procattr := os.ProcAttr{Dir: cwd, Env: os.Environ(), Files: []*os.File{nil, nil, nil}} p, err := os.StartProcess(path, args, &procattr) if err != nil {
Make os.ProcAttr construction more future-proof. The attached trivial patch will make gocode compatible with upcoming changes (else <URL>).
nsf_gocode
train
go
b55335b6506ebbe335fc00283b654e0dbf772f88
diff --git a/tests/View/SummaryDoc.php b/tests/View/SummaryDoc.php index <HASH>..<HASH> 100644 --- a/tests/View/SummaryDoc.php +++ b/tests/View/SummaryDoc.php @@ -91,10 +91,7 @@ class SummaryDoc */ public function doc3() { - /* - # _ - {{ i + 1 }} - */ + // {{ i + 1 }} } /**
docs<view>: add summary doc for view component
hunzhiwange_framework
train
php
e921a5d2150e96818667d7095626ae115ab3cc25
diff --git a/h2o-py/h2o/estimators/xgboost.py b/h2o-py/h2o/estimators/xgboost.py index <HASH>..<HASH> 100644 --- a/h2o-py/h2o/estimators/xgboost.py +++ b/h2o-py/h2o/estimators/xgboost.py @@ -1290,6 +1290,20 @@ class H2OXGBoostEstimator(H2OEstimator): decreasing constraint. Type: ``dict``. + + :examples: + + >>> prostate_hex = h2o.import_file("http://s3.amazonaws.com/h2o-public-test-data/smalldata/prostate/prostate.csv.zip") + >>> prostate_hex["CAPSULE"] = prostate_hex["CAPSULE"].asfactor() + >>> response = "CAPSULE" + >>> seed=42 + >>> monotone_constraints={"AGE":1} + >>> xgb_model = H2OXGBoostEstimator(seed=seed, + ... monotone_constraints=monotone_constraints) + >>> xgb_model.train(y=response, + ... ignored_columns=["ID"], + ... training_frame=prostate_hex) + >>> xgb_model.scoring_history() """ return self._parms.get("monotone_constraints")
PUBDEV-<I>: added example
h2oai_h2o-3
train
py
0a52cbcdffe690dbce7a46991babb082d98a6093
diff --git a/babel.config.js b/babel.config.js index <HASH>..<HASH> 100644 --- a/babel.config.js +++ b/babel.config.js @@ -9,6 +9,6 @@ module.exports = { }], ], plugins: [ - '@babel/plugin-transform-react-jsx', + ['@babel/plugin-transform-react-jsx', {runtime: 'automatic'}], ], } diff --git a/test/components.js b/test/components.js index <HASH>..<HASH> 100644 --- a/test/components.js +++ b/test/components.js @@ -1,6 +1,3 @@ -import React from 'react' - - export function Index({children}) { return <div> <h1>Index</h1> diff --git a/test/router.js b/test/router.js index <HASH>..<HASH> 100644 --- a/test/router.js +++ b/test/router.js @@ -1,5 +1,4 @@ import {equal} from 'assert' -import React from 'react' import {renderToStaticMarkup} from 'react-dom/server' import {Index, Users, User, Pets, Pet, AllPets, NotFound, List} from './components' import {Router} from '..'
test: new jsx transform
tj_react-enroute
train
js,js,js
6127f785a42f40bcc818029d64f8b617d2fafc99
diff --git a/embed/config.go b/embed/config.go index <HASH>..<HASH> 100644 --- a/embed/config.go +++ b/embed/config.go @@ -36,6 +36,7 @@ import ( "github.com/coreos/pkg/capnslog" "github.com/ghodss/yaml" "google.golang.org/grpc" + "google.golang.org/grpc/grpclog" ) const ( @@ -244,6 +245,8 @@ func (cfg *Config) SetupLogging() { if cfg.Debug { capnslog.SetGlobalLogLevel(capnslog.DEBUG) grpc.EnableTracing = true + } else { + grpclog.SetLoggerV2(grpclog.NewLoggerV2(ioutil.Discard, ioutil.Discard, ioutil.Discard)) } if cfg.LogPkgLevels != "" { repoLog := capnslog.MustRepoLogger("github.com/coreos/etcd")
embed: disable grpc server logging by default
etcd-io_etcd
train
go
7b31ec4780b001e94d16ee5fee00f757eff61acd
diff --git a/src/mixins/index.js b/src/mixins/index.js index <HASH>..<HASH> 100644 --- a/src/mixins/index.js +++ b/src/mixins/index.js @@ -1,7 +1,7 @@ import Series from './series'; import XY from './xy'; import XYValues from './xy-values'; -import XYInverted from './inverted-xy'; +import XYInverted from './xy-inverted'; import Labels, { LabelsXY } from './labels'; import Hover, { HoverPoints } from './hover'; import Transition from './transition';
Fix XYInverted undefined bug
CSNW_d3.compose
train
js
8533c93505a733980406ce655372c7742dfcfdfc
diff --git a/troposphere/policies.py b/troposphere/policies.py index <HASH>..<HASH> 100644 --- a/troposphere/policies.py +++ b/troposphere/policies.py @@ -41,6 +41,7 @@ class UpdatePolicy(AWSAttribute): 'AutoScalingReplacingUpdate': (AutoScalingReplacingUpdate, False), 'CodeDeployLambdaAliasUpdate': (CodeDeployLambdaAliasUpdate, False), 'UseOnlineResharding': (boolean, False), + 'EnableVersionUpgrade': (boolean, False), }
Add update policy that allows for in place upgrade of ES cluster (#<I>)
cloudtools_troposphere
train
py
33138485a8b400f59f1843b16b72b33ebf65f554
diff --git a/lambdas/access_counts/index.py b/lambdas/access_counts/index.py index <HASH>..<HASH> 100644 --- a/lambdas/access_counts/index.py +++ b/lambdas/access_counts/index.py @@ -96,6 +96,15 @@ PACKAGE_VERSION_ACCESS_COUNTS = textwrap.dedent("""\ GROUP BY eventname, package_hashes.bucket, name, hash """) +BUCKET_ACCESS_COUNTS = textwrap.dedent("""\ + SELECT + eventname, + bucket, + CAST(histogram(date) AS JSON) AS counts + FROM object_access_log + GROUP BY eventname, bucket +""") + athena = boto3.client('athena') s3 = boto3.client('s3') @@ -184,6 +193,7 @@ def handler(event, context): ('Objects', OBJECT_ACCESS_COUNTS), ('Packages', PACKAGE_ACCESS_COUNTS), ('PackageVersions', PACKAGE_VERSION_ACCESS_COUNTS), + ('Bucket', BUCKET_ACCESS_COUNTS), ] execution_ids = [(filename, run_query(query)) for filename, query in queries]
Add access counts for the whole bucket (#<I>)
quiltdata_quilt
train
py
438d701ef1a8ea5a196cb5d23a42f173f6d29e36
diff --git a/src/MarkWilson/Test/VerbalExpressionOutputTest.php b/src/MarkWilson/Test/VerbalExpressionOutputTest.php index <HASH>..<HASH> 100644 --- a/src/MarkWilson/Test/VerbalExpressionOutputTest.php +++ b/src/MarkWilson/Test/VerbalExpressionOutputTest.php @@ -30,4 +30,4 @@ class VerbalExpressionOutputTest extends \PHPUnit_Framework_TestCase $this->assertEquals(1, preg_match($verbalExpression->toString(), 'https://www.google.com')); } -} \ No newline at end of file +}
Tiniest of amends to code style - sort of pointless
markwilson_VerbalExpressionsPhp
train
php
9592f83c0bd2f44183355533adc44b1d51f7f527
diff --git a/src/tag-cloud.js b/src/tag-cloud.js index <HASH>..<HASH> 100644 --- a/src/tag-cloud.js +++ b/src/tag-cloud.js @@ -3,7 +3,7 @@ import DefaultRenderer from "./default-renderer"; import arrayShuffle from "array-shuffle"; const omittedElemProps = { - tags: undefined, shuffle: undefined, renderer: undefined + tags: undefined, shuffle: undefined, renderer: undefined, maxSize: undefined, minSize: undefined }; const fontSizeConverter = (count, min, max, minSize, maxSize) =>
omited sizes in props
madox2_react-tagcloud
train
js
d1db63aa777b9a73e9befde6a69aea398e703fae
diff --git a/satpy/dependency_tree.py b/satpy/dependency_tree.py index <HASH>..<HASH> 100644 --- a/satpy/dependency_tree.py +++ b/satpy/dependency_tree.py @@ -185,9 +185,9 @@ class DependencyTree(Tree): """Update 'name' property of a node and any related metadata.""" old_name = node.name assert old_name in self._all_nodes + del self._all_nodes[old_name] node.update_name(new_name) self._all_nodes[new_name] = node - del self._all_nodes[old_name] def populate_with_keys(self, dataset_keys: set, query=None): """Populate the dependency tree.
Fix dependency tree node name when the new name is the same as old
pytroll_satpy
train
py
21d253df019ad70663e1f6a24a2b32169d8bc609
diff --git a/actions/ViewAction.php b/actions/ViewAction.php index <HASH>..<HASH> 100644 --- a/actions/ViewAction.php +++ b/actions/ViewAction.php @@ -16,6 +16,11 @@ class ViewAction extends Action public $view = 'view'; /** + * @var string|integer ID of object to be viewed + */ + protected $_id; + + /** * @var array|Closure additional data passed to view */ public $data = []; @@ -25,9 +30,19 @@ class ViewAction extends Action */ public $findOptions = []; + /** + * @var array configuration array for new model creation + */ + public $modelConfig = []; + + public function getId() + { + return $this->_id; + } + public function findModel($id) { - return $this->controller->findModel(array_merge(['id' => $id], $this->findOptions)); + return $this->controller->findModel(array_merge(['id' => $id], $this->findOptions), $this->modelConfig); } public function prepareData($id) @@ -41,6 +56,7 @@ class ViewAction extends Action public function run($id) { + $this->_id = $id; $model = $this->findModel($id); $this->collection->set($model);
improved ViewAction: + modelConfig and id
hiqdev_hipanel-core
train
php
cecf7c2dd5f1a6a015ed6eec4b46bf656a1ab59b
diff --git a/src/RequestFactory.php b/src/RequestFactory.php index <HASH>..<HASH> 100644 --- a/src/RequestFactory.php +++ b/src/RequestFactory.php @@ -1,5 +1,4 @@ <?php -declare(strict_types = 1); /** * Weave Zend Diactoros PSR7 Adaptor Request Factory. */ diff --git a/src/ResponseEmitter.php b/src/ResponseEmitter.php index <HASH>..<HASH> 100644 --- a/src/ResponseEmitter.php +++ b/src/ResponseEmitter.php @@ -1,5 +1,4 @@ <?php -declare(strict_types = 1); /** * Weave Zend Diactoros PSR7 Adaptor Response Emitter. */ diff --git a/src/ResponseFactory.php b/src/ResponseFactory.php index <HASH>..<HASH> 100644 --- a/src/ResponseFactory.php +++ b/src/ResponseFactory.php @@ -1,5 +1,4 @@ <?php -declare(strict_types = 1); /** * Weave Zend Diactoros PSR7 Adaptor Request Factory. */
Remove strict-types statement for improved php<I> support
weavephp_http-zenddiactoros
train
php,php,php
23ab1621c315ac8f414799ae4c9122959eef036d
diff --git a/src/Orders/OrdersStatus.php b/src/Orders/OrdersStatus.php index <HASH>..<HASH> 100644 --- a/src/Orders/OrdersStatus.php +++ b/src/Orders/OrdersStatus.php @@ -123,4 +123,28 @@ class OrdersStatus { return $result; } + + /** + * [RO] Seteaza o comanda ca fiind gata de livrare (https://github.com/celdotro/marketplace/wiki/Seteaza-gata-de-livrare) + * [EN] Set an order as ready for delivery (https://github.com/celdotro/marketplace/wiki/Set-order-as-ready-for-delivery) + * @param $cmd + * @return mixed + * @throws \Exception + */ + public function setReadyForDelivery($cmd){ + // Sanity check + if(!isset($cmd) || !is_int($cmd)) throw new \Exception('Specificati comanda'); + + // Set method and action + $method = 'orders'; + $action = 'SetReadyForDelivery'; + + // Set data + $data = array('orders_id' => $cmd); + + // Send request and retrieve response + $result = Dispatcher::send($method, $action, $data); + + return $result; + } } \ No newline at end of file
Added setReadyForDelivery method
celdotro_marketplace
train
php
baef86de7410ab5ab809b713d00eecb9293f10e6
diff --git a/treeherder/perfalert/perfalert/analyze_talos.py b/treeherder/perfalert/perfalert/analyze_talos.py index <HASH>..<HASH> 100644 --- a/treeherder/perfalert/perfalert/analyze_talos.py +++ b/treeherder/perfalert/perfalert/analyze_talos.py @@ -608,8 +608,7 @@ class AnalysisRunner: if self.config.has_option('main', 'max_email_authors') and \ self.config.getint('main', 'max_email_authors') > 0 and \ - state == 'regression' and \ - not self.isImprovement(series.test_name, last_good, d): + state == 'regression': max_email_authors = self.config.getint('main', 'max_email_authors') author_addresses = []
Bug <I> - CC patch authors on "improvement" emails [r=catlee]
mozilla_treeherder
train
py
807dd51f7578992ca9606c16062ea3af5c70451f
diff --git a/lib/correios.js b/lib/correios.js index <HASH>..<HASH> 100644 --- a/lib/correios.js +++ b/lib/correios.js @@ -19,6 +19,7 @@ module.exports = class Correios { return new Promise((resolve, reject) => { soap.createClient(this.calcPrecoUrl, (error, client) => { + if ( error ) return reject(error); client.CalcPreco(arg, (error, result) => { if (!error && result && result.CalcPrecoResult @@ -39,6 +40,7 @@ module.exports = class Correios { return new Promise((resolve, reject) => { soap.createClient(this.calcPrecoUrl, (error, client) => { + if ( error ) return reject(error); client.CalcPrecoPrazo(arg, (error, result) => { if (!error && result && result.CalcPrecoPrazoResult
reject in case of unexpected error on soap client
vitorleal_node-correios
train
js
2d7f67045b95af40f674603acb65a399a9388af5
diff --git a/lib/poolparty/monitors/stats_monitor_adaptor.rb b/lib/poolparty/monitors/stats_monitor_adaptor.rb index <HASH>..<HASH> 100644 --- a/lib/poolparty/monitors/stats_monitor_adaptor.rb +++ b/lib/poolparty/monitors/stats_monitor_adaptor.rb @@ -60,10 +60,10 @@ module Butterfly # Expand the cloud if 50+% of the votes are for expansion # Contract the cloud if 51+% of the votes are for contraction if (candidates[:expand] - candidates[:contract])/stats.keys.size > 0.5 - %x["server-expand-cloud"] unless elected_action == "expand" + %x["/usr/bin/server-expand-cloud"] unless elected_action == "expand" @elected_action = "expand" elsif (candidates[:contract] - candidates[:expand])/stats.keys.size > 0.5 - %x["server-contract-cloud"] unless elected_action == "contract" + %x["/usr/bin/server-contract-cloud"] unless elected_action == "contract" @elected_action = "contract" end @@ -112,7 +112,7 @@ module Butterfly def instances # res = PoolParty::Neighborhoods.load_default.instances - res ||= %x{"server-list-active name"}.split(" ") + res ||= %x{"/usr/bin/server-list-active name"}.split("\t") res end
Fixed call to server-list-active by name to ip and full-filepath
auser_poolparty
train
rb
9732e04c60fcaf7f9869024f7676a81af6f25359
diff --git a/indexing-hadoop/src/main/java/org/apache/druid/indexer/updater/MetadataStorageUpdaterJobSpec.java b/indexing-hadoop/src/main/java/org/apache/druid/indexer/updater/MetadataStorageUpdaterJobSpec.java index <HASH>..<HASH> 100644 --- a/indexing-hadoop/src/main/java/org/apache/druid/indexer/updater/MetadataStorageUpdaterJobSpec.java +++ b/indexing-hadoop/src/main/java/org/apache/druid/indexer/updater/MetadataStorageUpdaterJobSpec.java @@ -89,8 +89,8 @@ public class MetadataStorageUpdaterJobSpec implements Supplier<MetadataStorageCo return new MetadataStorageTablesConfig( null, null, - segmentTable, null, + segmentTable, null, null, null,
Pass in segmentTable correctly (#<I>)
apache_incubator-druid
train
java
11bd07abb297ef93e52a332d8ec9a0094e76181e
diff --git a/terraform/plan.go b/terraform/plan.go index <HASH>..<HASH> 100644 --- a/terraform/plan.go +++ b/terraform/plan.go @@ -242,6 +242,8 @@ func ReadPlan(src io.Reader) (*Plan, error) { // WritePlan writes a plan somewhere in a binary format. func WritePlan(d *Plan, dst io.Writer) error { + return fmt.Errorf("plan serialization is temporarily disabled, pending implementation of the new file format") + // Write the magic bytes so we can determine the file format later n, err := dst.Write([]byte(planFormatMagic)) if err != nil {
core: Have WritePlan be explicit that it's non-functional right now This is temporarily broken until we implement the new plan file format, since terraform.Plan is no longer serializable with gob. Rather than have an error that seems like it needs immediate fixing, we'll be explicit about it in the error message and focus our efforts on other test failures for now, and return to implement the new file format later.
hashicorp_terraform
train
go
b1dec29e6adc8ac1aefd096e8bc9900cadda34fc
diff --git a/check50.py b/check50.py index <HASH>..<HASH> 100755 --- a/check50.py +++ b/check50.py @@ -190,7 +190,7 @@ def print_results(results, log=False): cprint(" {}".format(result["rationale"]), "red") elif result["status"] == Checks.SKIP: cprint(":| {}".format(result["description"]), "yellow") - cprint(" test skipped", "yellow") + cprint(" {}".format(result.get("rationale") or "check skipped"), "yellow") if log: for line in result["test"].log: @@ -253,7 +253,7 @@ def valgrind(func): @wraps(func) def wrapper(self): if not which("valgrind"): - raise Error("Valgrind not installed", result=Checks.SKIP) + raise Error("valgrind not installed", result=Checks.SKIP) self._valgrind = True try: @@ -276,6 +276,7 @@ def check(dependency=None): # check if dependency failed if dependency and config.test_results.get(dependency) != Checks.PASS: self.result = config.test_results[func.__name__] = Checks.SKIP + self.rationale = "can't check until a frown turns upside down" return # move files into this check's directory
Added rationale to skipped tests
cs50_check50
train
py
97e775f8bb20e86020bc602aed875d2608eb061f
diff --git a/tests/org.eclipse.xtext.tests/src/org/eclipse/xtext/scoping/impl/QualifiedNameScopeProviderTest.java b/tests/org.eclipse.xtext.tests/src/org/eclipse/xtext/scoping/impl/QualifiedNameScopeProviderTest.java index <HASH>..<HASH> 100644 --- a/tests/org.eclipse.xtext.tests/src/org/eclipse/xtext/scoping/impl/QualifiedNameScopeProviderTest.java +++ b/tests/org.eclipse.xtext.tests/src/org/eclipse/xtext/scoping/impl/QualifiedNameScopeProviderTest.java @@ -148,13 +148,7 @@ public class QualifiedNameScopeProviderTest extends AbstractGeneratorTest { IScope scope = scopeProvider.getScope(datatype, propertyType); List<String> names = toListOfNames(scope.getContents()); - assertEquals(names.toString(), 0, names.size()); - scope = scope.getOuterScope(); // stuff { - names = toListOfNames(scope.getContents()); - assertEquals(names.toString(), 0, names.size()); - - scope = scope.getOuterScope(); // import stuff.* names = toListOfNames(scope.getContents()); assertEquals(names.toString(), 1, names.size()); assertTrue(names.toString(), names.contains("baz.Person"));
improved performance of qualified name scope provider (<URL>)
eclipse_xtext-extras
train
java
bb4fea25e2d412e400d76d29598ac32db799bfee
diff --git a/src/models/StyledComponent.js b/src/models/StyledComponent.js index <HASH>..<HASH> 100644 --- a/src/models/StyledComponent.js +++ b/src/models/StyledComponent.js @@ -22,9 +22,11 @@ export default (tagName: any, rules: RuleSet) => { componentWillReceiveProps(newProps: Object, newContext: ?any) { this.theme = newContext ? newContext.theme : {} // pass through theme const theme = Object.assign({}, this.theme) // copy to pass to styles so no side effects - const updateTheme = values => this.theme = Object.assign({}, this.theme, values) + const updateTheme = values => { + this.theme = Object.assign({}, this.theme, values) + } /* Execution context is props + theme + updateTheme */ - const executionContext = Object.assign({}, newProps, {theme, updateTheme}); + const executionContext = Object.assign({}, newProps, { theme, updateTheme }) this.generatedClassName = componentStyle.injectStyles(executionContext) } /* eslint-disable react/prop-types */
lint i hate you
styled-components_styled-components
train
js
2cb21e630e023044d18ca7318a3ecba3a77bd558
diff --git a/public/js/editor.js b/public/js/editor.js index <HASH>..<HASH> 100644 --- a/public/js/editor.js +++ b/public/js/editor.js @@ -659,13 +659,8 @@ function AposSchemas() { // has invoked addError(). self.scrollToError = function($el) { - var $element = self.findSafe($el, '.apos-error'); - if (!$element.length) { - return; - } - var offset = $element.offset(); - var scrollTop = offset.top - 100; - $('html, body').scrollTop(scrollTop); + // Awesome plugin + var $element = self.findSafe($el, '.apos-error').scrollintoview(); $element.find('input,select,textarea').first().focus(); };
Use the scrollintoview plugin to make aposSchemas.scrollToError() more effective
apostrophecms-legacy_apostrophe-schemas
train
js
d4537fd72de24838a3e480a1c8fba11104a17d22
diff --git a/specter/spec.py b/specter/spec.py index <HASH>..<HASH> 100644 --- a/specter/spec.py +++ b/specter/spec.py @@ -47,6 +47,10 @@ class Describe(object): self.describes = [desc_type() for desc_type in self.describe_types] @property + def doc(self): + return self.__dict__.__doc__ + + @property def __members__(self): return {key: val for key, val in vars(type(self)).items()} @@ -84,3 +88,7 @@ class Describe(object): func_name = obj.func_name return (not func_name.startswith('_') and not func_name == 'execute') + + +class Spec(Describe): + pass
Adding Spec * Also added doc to Describe
jmvrbanac_Specter
train
py
dd458823fdcc1aea6891af1564f1d9d68df034f9
diff --git a/lib/Elastica/Document.php b/lib/Elastica/Document.php index <HASH>..<HASH> 100644 --- a/lib/Elastica/Document.php +++ b/lib/Elastica/Document.php @@ -174,7 +174,7 @@ class Elastica_Document { * @param string $ttl * @return Elastica_Document */ - public function setTTL($ttl) { + public function setTtl($ttl) { return $this->add('_ttl', $ttl); } diff --git a/lib/Elastica/Type/Mapping.php b/lib/Elastica/Type/Mapping.php index <HASH>..<HASH> 100644 --- a/lib/Elastica/Type/Mapping.php +++ b/lib/Elastica/Type/Mapping.php @@ -126,7 +126,7 @@ class Elastica_Type_Mapping { * @param array $params TTL Params (enabled, default, ...) * @return Elastica_Type_Mapping */ - public function setTTL(array $params) { + public function setTtl(array $params) { return $this->setParam('_ttl', $params); }
changed setTTL for setTtl
ruflin_Elastica
train
php,php
dc14c98cabeac58a67b29b17e12c772350ef3b40
diff --git a/xchange-bitstamp/src/main/java/info/bitrich/xchangestream/bitstamp/v2/BitstampStreamingService.java b/xchange-bitstamp/src/main/java/info/bitrich/xchangestream/bitstamp/v2/BitstampStreamingService.java index <HASH>..<HASH> 100644 --- a/xchange-bitstamp/src/main/java/info/bitrich/xchangestream/bitstamp/v2/BitstampStreamingService.java +++ b/xchange-bitstamp/src/main/java/info/bitrich/xchangestream/bitstamp/v2/BitstampStreamingService.java @@ -72,7 +72,7 @@ public class BitstampStreamingService extends JsonNettyStreamingService { LOG.info("Channel {} has been successfully unsubscribed", channel); break; default: - LOG.error("Unsupported event type {} in message {}", event, message.toString()); + LOG.warn("Unsupported event type {} in message {}", event, message.toString()); } }
#<I> revew fixes - warn log level for unknown event type
knowm_XChange
train
java
7e4eec5401d946788d799a5664a43bc7babaf5d5
diff --git a/views/js/generis.tree.select.js b/views/js/generis.tree.select.js index <HASH>..<HASH> 100644 --- a/views/js/generis.tree.select.js +++ b/views/js/generis.tree.select.js @@ -96,6 +96,9 @@ define(['jquery', 'lodash', 'i18n', 'context', 'generis.tree', 'helpers', 'ui/fe if (instance.checkedNodes) { instance.check(instance.checkedNodes); } + if (instance.options.onOpenCallback) { + instance.options.onOpenCallback(TREE_OBJ); + } }, /** * Triggered actions when data was loaded
Added new callback fr onopen event
oat-sa_tao-core
train
js
415bd544bc8ba6188b380b5a65a8407c8a9cec80
diff --git a/lib/okta_saml/version.rb b/lib/okta_saml/version.rb index <HASH>..<HASH> 100644 --- a/lib/okta_saml/version.rb +++ b/lib/okta_saml/version.rb @@ -1,3 +1,3 @@ module OktaSaml - VERSION = "0.0.7" + VERSION = "0.0.8" end
[JEB/EC][<I>] bumping to version <I>
rentpath_okta_saml
train
rb
ab3fef062197155e0557fc7399ceef6c6fce7f6f
diff --git a/will/mixins/storage.py b/will/mixins/storage.py index <HASH>..<HASH> 100644 --- a/will/mixins/storage.py +++ b/will/mixins/storage.py @@ -63,3 +63,28 @@ class StorageMixin(object): return self.storage.size() except Exception: logging.exception("Failed to get the size of our storage") + + # list specific save/load/clear operations + + def remove_from_list(self, key, value): + tmp_value = self.load(key) + if tmp_value is None: + pass + else: + tmp_value.remove(value) + self.save(key, tmp_value) + + def save_to_list(self, key, value): + tmp_value = self.load(key) + if tmp_value is None: + self.save(key, [value]) + else: + tmp_value.append(value) + self.save(key, tmp_value) + + def load_as_list(self, key): + value = self.load(key) + if value is None: + return [] + else: + return value \ No newline at end of file
Extend storage operations to support lists It's pretty common to store multiple values as a list under one key. In order to reduce the duplication in my plugin I think this should go here.
skoczen_will
train
py
49a4f70fb0e0062e665ac95cc01b2701e34badc9
diff --git a/lib/fog/aws/models/storage/file.rb b/lib/fog/aws/models/storage/file.rb index <HASH>..<HASH> 100644 --- a/lib/fog/aws/models/storage/file.rb +++ b/lib/fog/aws/models/storage/file.rb @@ -6,6 +6,7 @@ module Fog class AWS class File < Fog::Model + # @see AWS Object docs http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectOps.html identity :key, :aliases => 'Key'
[docs::was::storage] added URL for list of S3 docs about Restful HTTP API
fog_fog
train
rb
5b0756f2468c88c2f10deff6705beb979d448e5d
diff --git a/binstar_client/commands/config.py b/binstar_client/commands/config.py index <HASH>..<HASH> 100644 --- a/binstar_client/commands/config.py +++ b/binstar_client/commands/config.py @@ -1,5 +1,5 @@ ''' -Bisntar configuration +Binstar configuration Get, Set, Remove or Show the binstar configuration.
Fixed typo in config.py
Anaconda-Platform_anaconda-client
train
py
6d3ae73dab8ef8cf9405bc98d67c82db201631ec
diff --git a/lib/chef/knife/cloudformation_events.rb b/lib/chef/knife/cloudformation_events.rb index <HASH>..<HASH> 100644 --- a/lib/chef/knife/cloudformation_events.rb +++ b/lib/chef/knife/cloudformation_events.rb @@ -84,7 +84,7 @@ class Chef end else ui.fatal "Failed to locate requested stack: #{ui.color(name, :bold, :red)}" - exit -1 + raise "Failed to locate stack: #{name}!" end end
Raise in place of exit to prevent nested calls returning early
sparkleformation_sfn
train
rb
3f2ce507bd43530765d4095e0f629b346807ce52
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -197,7 +197,6 @@ function responseInterceptor(response) { config.pushResponsePromise.then((pushResponse) => { const headers = omit(response.headers, illegalConnectionSpecificHeaders); // TODO that should be case-insensitive (use filter-values) - // TODO do I need to convert Content-Length header from string to int? pushResponse.writeHead(response.status, headers); response.data.pipe(pushResponse); diff --git a/test/index.js b/test/index.js index <HASH>..<HASH> 100644 --- a/test/index.js +++ b/test/index.js @@ -156,15 +156,6 @@ describe('When pushing a response', () => { responseInterceptor(apiResponse); }); - it.skip('converts Content-Length value into a number', (done) => { - // This is needed by http/2 - pushResponse.writeHead = (status, headers) => { - assert(headers['Content-Length'] === 55); - done(); - }; - responseInterceptor(apiResponse); - }); - it('pipes the api response to the push response', (done) => { apiResponse.data.pipe = function pipe(destination) { assert.equal(destination, pushResponse);
I had misread node docs; content-length value can be a string
BernzSed_axios-push
train
js,js
3aaff243787e2548383d77dc73f9acaa4ba4a35f
diff --git a/spec/scheduler_spec.rb b/spec/scheduler_spec.rb index <HASH>..<HASH> 100644 --- a/spec/scheduler_spec.rb +++ b/spec/scheduler_spec.rb @@ -782,20 +782,36 @@ describe Rufus::Scheduler do it 'waits no more than n seconds' do - job = + seen = [] + + job0 = + @scheduler.schedule_in '0s' do + seen << :job0a + sleep 100 + seen << :job0b + end + + sleep 0.300 + + job1 = @scheduler.schedule_in '0s' do + seen << :job1a sleep 4 + seen << :job1b end - wait_until { job.threads.size > 0 } + wait_until { seen.include?(:job1a) } + + expect(seen).to eq([ :job0a, :job1a ]) t0 = monow - t1 = @scheduler.shutdown(wait: 2) + @scheduler.shutdown(wait: 2) expect(monow - t0).to be_between(2.0, 3.0) - expect(job.threads.size).to eq(0) + expect(job0.threads.size).to eq(0) + expect(job1.threads.size).to eq(0) expect(@scheduler.uptime).to eq(nil) expect(@scheduler.running_jobs).to eq([])
Somehow follow gh-<I>, testing with more jobs
jmettraux_rufus-scheduler
train
rb
f056692b042c9a33be1683835b6e1397cf6d9032
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ setup(name='simplekv', version='0.3dev', description='A simple key-value storage for binary data.', long_description=read('README.rst'), - keywords='', + keywords='key-value-store storage key-value db database', author='Marc Brinkmann', author_email='[email protected]', url='http://github.com/mbr/simplekv',
Added keywords to setup.py.
mbr_simplekv
train
py
921e0e4f03ef9c1e4a1e4a4711a166f0e5d65365
diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AnnotationDriver.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AnnotationDriver.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AnnotationDriver.php @@ -101,7 +101,7 @@ class AnnotationDriver implements Driver $class->setCollection($documentAnnot->collection); } if ($documentAnnot->repositoryClass) { - $metadata->setCustomRepositoryClass($documentAnnot->repositoryClass); + $class->setCustomRepositoryClass($documentAnnot->repositoryClass); } if ($documentAnnot->indexes) { foreach($documentAnnot->indexes as $index) {
[MODM-7] Fixing issue with AnnotationDriver and custom repository classes.
doctrine_mongodb-odm
train
php
14a07667912ea07065bb9b65d207deef175be9e3
diff --git a/tests/integration/test_pipenv.py b/tests/integration/test_pipenv.py index <HASH>..<HASH> 100644 --- a/tests/integration/test_pipenv.py +++ b/tests/integration/test_pipenv.py @@ -98,7 +98,7 @@ def test_directory_with_leading_dash(PipenvInstance): prefix = '-dir-with-leading-dash' return mkdtemp(suffix, prefix, dir) - with mock.patch('pipenv._compat.mkdtemp', side_effect=mocked_mkdtemp): + with mock.patch('pipenv.vendor.vistir.compat.mkdtemp', side_effect=mocked_mkdtemp): with temp_environ(), PipenvInstance(chdir=True) as p: del os.environ['PIPENV_VENV_IN_PROJECT'] p.pipenv('--python python')
Update test to patch new mkdtemp target
pypa_pipenv
train
py
3b5b39be206239ba478205a37c4ca74394b4dcea
diff --git a/js/ui/TextWrapper.js b/js/ui/TextWrapper.js index <HASH>..<HASH> 100644 --- a/js/ui/TextWrapper.js +++ b/js/ui/TextWrapper.js @@ -39,8 +39,9 @@ define( }, _renderString: function (string, oldString) { - this.$el.innerHTML = ""; - + for(var k = 0; k < this.$el.childNodes.length; k++){ + this.$el.removeChild(this.$el.childNodes[k]); + } if (string) { var placeholders = findPlaceholders(string); var ph, start = -1; @@ -62,7 +63,6 @@ define( if (childView) { childView.$parentScope = this.$parentScope; childView.$rootScope = this.$rootScope; - this.$viewMap[key] = childView; } }
fixed removing of childNodes for IE8
rappid_rAppid.js
train
js
252cb40ad596228dde560481669c0b61a78227d0
diff --git a/master/buildbot/changes/p4poller.py b/master/buildbot/changes/p4poller.py index <HASH>..<HASH> 100644 --- a/master/buildbot/changes/p4poller.py +++ b/master/buildbot/changes/p4poller.py @@ -107,7 +107,7 @@ class P4Source(base.PollingChangeSource, util.ComparableMixin): split_file=lambda branchfile: (None, branchfile), pollInterval=60 * 10, histmax=None, pollinterval=-2, encoding='utf8', project=None, name=None, - use_tickets=False, ticket_login_interval=60 * 24, + use_tickets=False, ticket_login_interval=60 * 60 * 24, server_tz=None): # for backward compatibility; the parameter used to be spelled with 'i'
Default P4Poller's ticket fetching interval to <I> hours.
buildbot_buildbot
train
py
9689f1f9002b1bbf9622f5c6f1f43584c2d33260
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,15 +2,15 @@ from setuptools import setup with open('requirements.txt', 'rb') as f: - requirements = [i.strip().replace('==', '>=') for i in f] + requirements = [i.strip() for i in f] setup(name='nameko', version='0.1-dev', description='service framework supporting multiple' 'messaging and RPC implementations', - author='', - author_email='', + author='onefinestay', + author_email='[email protected]', packages=['nameko', ], install_requires=requirements, test_requires=['pytest>=2.2.4', 'mock>=1.0b1', ],
making setup.py treat requirements.txt without magic
nameko_nameko
train
py
db5904b8a1508ca45d98d6bea0dd347a086b89ca
diff --git a/py/h2o.py b/py/h2o.py index <HASH>..<HASH> 100644 --- a/py/h2o.py +++ b/py/h2o.py @@ -909,8 +909,21 @@ class H2O(object): raise exc_info[1], None, exc_info[2] log_rest("") - log_rest("HTTP status code: " + str(r.status_code)) - log_rest(r.text) + try: + if r is None: + log_rest("r is None") + else: + log_rest("HTTP status code: " + str(r.status_code)) + if hasattr(r, 'text'): + if r.text is None: + log_rest("r.text is None") + else: + log_rest(r.text) + else: + log_rest("r does not have attr text") + except Exception, e: + # Paranoid exception catch. Ignore logging exceptions in the case that the above error checking isn't sufficient. + pass # fatal if no response if not beta_features and not r:
Add really paranoid exception handling for log_rest.
h2oai_h2o-2
train
py
3f351eb74746bd2acf2b8dd25ec72d0f759b1806
diff --git a/jest.config.js b/jest.config.js index <HASH>..<HASH> 100644 --- a/jest.config.js +++ b/jest.config.js @@ -2,5 +2,6 @@ const jestConfig = require('kcd-scripts/jest') module.exports = Object.assign(jestConfig, { testEnvironment: 'jest-environment-jsdom', + testURL: 'http://localhost/', setupTestFrameworkScriptFile: '<rootDir>/setupTests.js', })
test: Added testURL in jest.config (#<I>) Implemented fix from @jgoz to failing TI builds: <URL>
testing-library_jest-dom
train
js
959c30e68eda614ade0eb088585f192a5c57616c
diff --git a/shutit_global.py b/shutit_global.py index <HASH>..<HASH> 100644 --- a/shutit_global.py +++ b/shutit_global.py @@ -748,7 +748,10 @@ END_""" + random_id) '===========================') self.log('Sending file to' + path) if log: - self.log('contents >>>' + contents + '<<<') + for c in contents: + if c not in string.ascii_letters: + print_contents = string.replace(contents,c,'?') + self.log('contents >>>' + print_contents + '<<<') if cfg['build']['current_environment_id'] == 'ORIGIN_ENV': f = open(path,'w') if truncate: @@ -1188,6 +1191,8 @@ c''' child = child or self.get_default_child() expect = expect or self.get_default_expect() random_id = shutit_util.random_id() + if not self.file_exists(fname): + return False # TODO: binary files? ftext = self.send_and_get_output('cat ' + fname) # Replace the file text's ^M-newlines with simple newlines
logging binaries and implement file not exists for insert text
ianmiell_shutit
train
py
cc16b6c9182b6ddadf9032aa478977988effb9d7
diff --git a/src/plugin-api.js b/src/plugin-api.js index <HASH>..<HASH> 100644 --- a/src/plugin-api.js +++ b/src/plugin-api.js @@ -257,17 +257,21 @@ export default class PluginAPI { } }; _commandErrorHandler(e) { + log('_commandErrorHandler'); process.exitCode = 1; // Only show error when not from nodemiral // since nodemiral would have already shown the error if (!(e.nodemiralHistory instanceof Array)) { + log('_commandErrorHandler: nodemiral error'); console.error(e.stack || e); } if (e.solution) { console.log(chalk.yellow(e.solution)); } + + process.exit(1); } runCommand = async function(name) { if (!name) { @@ -284,7 +288,6 @@ export default class PluginAPI { potentialPromise = commands[name].handler(this, nodemiral); } catch (e) { this._commandErrorHandler(e); - process.exit(1); } if (potentialPromise && typeof potentialPromise.then === 'function') {
Exit when command rejects a promise
zodern_meteor-up
train
js
3aa1ca112bfed8c81e2727a883be31971894ce62
diff --git a/http_backend.go b/http_backend.go index <HASH>..<HASH> 100644 --- a/http_backend.go +++ b/http_backend.go @@ -139,10 +139,10 @@ func (h *httpBackend) Cache(request *http.Request, bodySize int, cacheDir string if err != nil { return resp, err } - defer file.Close() if err := gob.NewEncoder(file).Encode(resp); err != nil { return resp, err } + file.Close() return resp, os.Rename(filename+"~", filename) }
cacheDir Windows Bug File must be closed before os.Rename or it fails on Windows with error "The process cannot access the file because it is being used by another process"
gocolly_colly
train
go
5797c913461bde4fdcda14b55773290c88db3ea5
diff --git a/src/phpDocumentor/Configuration/PathNormalizingMiddleware.php b/src/phpDocumentor/Configuration/PathNormalizingMiddleware.php index <HASH>..<HASH> 100644 --- a/src/phpDocumentor/Configuration/PathNormalizingMiddleware.php +++ b/src/phpDocumentor/Configuration/PathNormalizingMiddleware.php @@ -126,7 +126,12 @@ final class PathNormalizingMiddleware $basePath = ''; if ($uri instanceof Uri) { - $basePath = (string) Path::dirname(new Path($uri->getPath())) . '/'; + $basePath = (string) Path::dirname(new Path($uri->getPath())); + + // only add the slash in the middle if $basePath actually contains a value + if ($basePath) { + $basePath .= '/'; + } } return new Path($basePath . (string) $cachePath);
Ensure that no preceeding slash is added for the cache
phpDocumentor_phpDocumentor2
train
php
1fa0dad0839b9720eec1802ba057a9b549164f50
diff --git a/src/defaults.js b/src/defaults.js index <HASH>..<HASH> 100644 --- a/src/defaults.js +++ b/src/defaults.js @@ -130,6 +130,11 @@ export default { */ peek: 0, + /** + * Switch glide to right to left moving mode. + * + * @type {Boolean} + */ rtl: false, /**
Add comment to rtl option
glidejs_glide
train
js
5007afaae27aabe25c2a6514b013da9646ef849b
diff --git a/notifications/migrations/0004_auto_20150826_1508.py b/notifications/migrations/0004_auto_20150826_1508.py index <HASH>..<HASH> 100644 --- a/notifications/migrations/0004_auto_20150826_1508.py +++ b/notifications/migrations/0004_auto_20150826_1508.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from django.db import models, migrations -import notifications.models +from django.utils import timezone class Migration(migrations.Migration): @@ -15,6 +15,6 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='notification', name='timestamp', - field=models.DateTimeField(default=notifications.models.now), + field=models.DateTimeField(default=timezone.now), ), ]
Custom now() invocation got overlooked by PR #<I>
django-notifications_django-notifications
train
py
fd5264eb4a411d9f5741ed1dea3530264710a833
diff --git a/gui/src/main/java/org/jboss/as/console/client/shared/deployment/DeploymentTreeModel.java b/gui/src/main/java/org/jboss/as/console/client/shared/deployment/DeploymentTreeModel.java index <HASH>..<HASH> 100644 --- a/gui/src/main/java/org/jboss/as/console/client/shared/deployment/DeploymentTreeModel.java +++ b/gui/src/main/java/org/jboss/as/console/client/shared/deployment/DeploymentTreeModel.java @@ -102,7 +102,7 @@ public class DeploymentTreeModel implements TreeViewModel { public void render(final Context context, final DeploymentRecord value, final SafeHtmlBuilder sb) { ImageResource res; String name = value.getName().length() > 30 ? value.getName().substring(0, 25) + " ..." : value.getName(); - String iconTitle = name; + String iconTitle = value.getName(); if ("FAILED".equalsIgnoreCase(value.getStatus())) { res = Icons.INSTANCE.status_warn(); iconTitle += " failed to start, check log for details.";
BZ<I>: Deployments name shortened in admin console. Adding fullname to tooltip.
hal_core
train
java
8a6857a84194aa96e0ebd13aab694b953d182835
diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py index <HASH>..<HASH> 100644 --- a/tests/integration/__init__.py +++ b/tests/integration/__init__.py @@ -1110,9 +1110,10 @@ class TestDaemon(object): Clean out the tmp files ''' def remove_readonly(func, path, excinfo): - # Give full permissions to owner - os.chmod(path, stat.S_IRWXU) - func(path) + if os.path.exists(path): + # Give full permissions to owner + os.chmod(path, stat.S_IRWXU) + func(path) for dirname in (TMP, RUNTIME_VARS.TMP_STATE_TREE, RUNTIME_VARS.TMP_PILLAR_TREE, RUNTIME_VARS.TMP_PRODENV_STATE_TREE):
Don't try to change ownership on non existing paths
saltstack_salt
train
py
cbcdb483002e51bc3cc4061fd5162627bbac7699
diff --git a/lib/runner.js b/lib/runner.js index <HASH>..<HASH> 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -192,8 +192,9 @@ Runner.prototype.runCucumber_ = function(specs, done) { cucumberResolvedRequire = ConfigParser.resolveFilePatterns(self.config_.cucumberOpts.require); if (cucumberResolvedRequire && cucumberResolvedRequire.length) { - execOptions.push('-r'); - execOptions = execOptions.concat(cucumberResolvedRequire); + execOptions = cucumberResolvedRequire.reduce(function(a, fn) { + return a.concat('-r', fn); + }, execOptions); } }
fix(runner): add -r for each cucumber require
angular_protractor
train
js
f4a834f84b7d07dffa12594bf93a927b62bbff62
diff --git a/pkg/tsdb/opentsdb/opentsdb.go b/pkg/tsdb/opentsdb/opentsdb.go index <HASH>..<HASH> 100644 --- a/pkg/tsdb/opentsdb/opentsdb.go +++ b/pkg/tsdb/opentsdb/opentsdb.go @@ -1,6 +1,7 @@ package opentsdb import ( + "context" "net/http" "github.com/grafana/grafana/pkg/log" @@ -25,6 +26,6 @@ func init() { tsdb.RegisterExecutor("opentsdb", NewOpenTsdbExecutorExecutor) } -func (e *OpenTsdbExecutor) Execute(queries tsdb.QuerySlice, queryContext *tsdb.QueryContext) *tsdb.BatchResult { +func (e *OpenTsdbExecutor) Execute(ctx context.Context, queries tsdb.QuerySlice, queryContext *tsdb.QueryContext) *tsdb.BatchResult { panic("Missing implementation") }
fix(opentsdb): add context to opentsdb executor
grafana_grafana
train
go
e1776f56cc8d35f5766d5e45e648660721eeca94
diff --git a/src/main/java/com/networknt/schema/TypeValidator.java b/src/main/java/com/networknt/schema/TypeValidator.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/networknt/schema/TypeValidator.java +++ b/src/main/java/com/networknt/schema/TypeValidator.java @@ -108,7 +108,7 @@ public class TypeValidator extends BaseJsonValidator implements JsonValidator { } public static boolean isBoolean(String s) { - return Boolean.parseBoolean(s); + return "true".equals(s) || "false".equals(s); } public static boolean isNumeric(String str) {
fixes #<I> Boolean type validation for the string type is incorrect
networknt_json-schema-validator
train
java
2871bcd57d92bd3d7fed4738d3d9315773291f5c
diff --git a/utils/bisect.js b/utils/bisect.js index <HASH>..<HASH> 100755 --- a/utils/bisect.js +++ b/utils/bisect.js @@ -116,6 +116,7 @@ function runScript(scriptPath, revisionInfo) { const child = fork(scriptPath, [], { stdio: ['inherit', 'inherit', 'inherit', 'ipc'], env: { + ...process.env, PUPPETEER_EXECUTABLE_PATH: revisionInfo.executablePath, }, });
chore(bisect): inherit parent ENV when launching script (#<I>)
GoogleChrome_puppeteer
train
js
467b7f181b6997894b0bf3d2ab4b534305dc8513
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -115,7 +115,7 @@ function composeString(trace, options) { result.push(f(' at %s:%s:%s', frame.file, frame.line, frame.column)); } - if (options.excludeSource || !frame.source) { return; } + if (options.excludeSources || !frame.source) { return; } Object.keys(frame.source).forEach(function (line) { var code = frame.source[line].code; diff --git a/test/parsetrace.js b/test/parsetrace.js index <HASH>..<HASH> 100644 --- a/test/parsetrace.js +++ b/test/parsetrace.js @@ -76,6 +76,11 @@ describe('parsetrace of', function () { it('should be preppended by 11 spaces', function () { assert(this.trace.toString().indexOf(' 1:') !== -1); }); + + it('should skip sources if options say so', function () { + var string = this.trace.toString({ excludeSources: true}); + assert(string.indexOf(' 1:') === -1); + }); }); });
Added test for excludeSources - found bug :flush:
floatdrop_node-parsetrace
train
js,js
b12251d462d84eb793cceba58e590813f0732d32
diff --git a/lib/container.js b/lib/container.js index <HASH>..<HASH> 100644 --- a/lib/container.js +++ b/lib/container.js @@ -53,11 +53,14 @@ util.inherits(Container, EventEmitter); * @param {function} fn - Loader of object specifications from the source. * @public */ -Container.prototype.use = function(ns, fn) { +Container.prototype.use = function(ns, fn, options) { if (typeof ns == 'function') { + options = fn; fn = ns; ns = ''; } + options = options || {}; + if (typeof fn != 'function') { throw new Error("Container#use requires a function, was passed a '" + (typeof fn) + "'"); } @@ -67,7 +70,8 @@ Container.prototype.use = function(ns, fn) { this._sources[id] = source; this._order.unshift(id); - if (fn && fn.used) { + if (fn && fn.used && options.init !== false) { + console.log('USE IT: ' + ns); var hc = new HostingContainer(this, source); fn.used(hc); }
Add option to skip auto-wiring.
jaredhanson_electrolyte
train
js
a316512828603561d82da7016d64a1bbda95f466
diff --git a/openquake/risklib/riskinput.py b/openquake/risklib/riskinput.py index <HASH>..<HASH> 100644 --- a/openquake/risklib/riskinput.py +++ b/openquake/risklib/riskinput.py @@ -367,6 +367,8 @@ class GmfGetter(object): """ Initialize the computers. Should be called on the workers """ + if hasattr(self, 'eids'): # init already called + return self.N = len(self.sitecol.complete) self.I = I = len(self.imtls) self.R = sum(len(rlzs) for rlzs in self.rlzs_by_gsim.values())
Speedup [skip hazardlib]
gem_oq-engine
train
py
73ac8a9c130aca06daad0e5e5e347f2c9ed12ac5
diff --git a/hazelcast/src/main/java/com/hazelcast/spi/impl/operationservice/impl/InvocationMonitor.java b/hazelcast/src/main/java/com/hazelcast/spi/impl/operationservice/impl/InvocationMonitor.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/spi/impl/operationservice/impl/InvocationMonitor.java +++ b/hazelcast/src/main/java/com/hazelcast/spi/impl/operationservice/impl/InvocationMonitor.java @@ -27,7 +27,6 @@ import com.hazelcast.logging.ILogger; import com.hazelcast.nio.Address; import com.hazelcast.spi.ExecutionService; import com.hazelcast.spi.impl.operationexecutor.OperationHostileThread; -import com.hazelcast.util.Clock; import com.hazelcast.util.EmptyStatement; import com.hazelcast.internal.util.counters.SwCounter; @@ -144,7 +143,6 @@ public class InvocationMonitor { return; } - long now = Clock.currentTimeMillis(); int backupTimeouts = 0; int invocationTimeouts = 0; int invocationCount = 0;
Removed deadstore in InvocationMonitor
hazelcast_hazelcast
train
java
164764470a0a09761f5c27c7b379d8b55d536f6f
diff --git a/src/main/java/com/github/tomakehurst/wiremock/WireMockServer.java b/src/main/java/com/github/tomakehurst/wiremock/WireMockServer.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/tomakehurst/wiremock/WireMockServer.java +++ b/src/main/java/com/github/tomakehurst/wiremock/WireMockServer.java @@ -56,13 +56,17 @@ public class WireMockServer { private Server jettyServer; private RequestDelayControl requestDelayControl; private final FileSource fileSource; - private final Log4jNotifier notifier; + private final Notifier notifier; private final int port; - - public WireMockServer(int port, FileSource fileSource, boolean enableBrowserProxying) { - notifier = new Log4jNotifier(); + + public WireMockServer(int port, FileSource fileSource, boolean enableBrowserProxying) { + this(port, fileSource, enableBrowserProxying, new Log4jNotifier()); + } + + public WireMockServer(int port, FileSource fileSource, boolean enableBrowserProxying, Notifier notifier) { this.fileSource = fileSource; - this.port = port; + this.port = port; + this.notifier = notifier; requestDelayControl = new ThreadSafeRequestDelayControl();
Added ability to inject a custom notifier into WireMockServer, default remains Log4j
tomakehurst_wiremock
train
java
8e7a0d3027a247923bffe94aafc569b57943f4e7
diff --git a/squiffy.template.js b/squiffy.template.js index <HASH>..<HASH> 100644 --- a/squiffy.template.js +++ b/squiffy.template.js @@ -15,6 +15,7 @@ var squiffy = {}; var section = link.data('section'); var rotateAttr = link.attr('data-rotate'); var sequenceAttr = link.attr('data-sequence'); + var lastPass = 0 if (passage) { disableLink(link); squiffy.set('_turncount', squiffy.get('_turncount') + 1);
Update squiffy.template.js
textadventures_squiffy
train
js
df9123ff83ab8a4344215ff254e4a5f2fe3b22e4
diff --git a/cyphi/test/test_subsystem.py b/cyphi/test/test_subsystem.py index <HASH>..<HASH> 100644 --- a/cyphi/test/test_subsystem.py +++ b/cyphi/test/test_subsystem.py @@ -4,9 +4,9 @@ from pprint import pprint import numpy as np import cyphi.utils as utils -from cyphi.utils import print_repertoire, print_repertoire_horiz, a_mip, a_part +from cyphi.utils import print_repertoire, print_repertoire_horiz from .example_networks import WithExampleNetworks -from cyphi.subsystem import Subsystem +from cyphi.subsystem import Subsystem, a_cut, a_mip, a_part # TODO test against other matlab examples
Import MICE, MIP tuples, etc. from subsystem
wmayner_pyphi
train
py
e36d6839d19a669d85ad424aa722d16abd8fc219
diff --git a/salt/state.py b/salt/state.py index <HASH>..<HASH> 100644 --- a/salt/state.py +++ b/salt/state.py @@ -2505,8 +2505,8 @@ class BaseHighState(object): ''' envs = ['base'] if 'file_roots' in self.opts: - envs.extend(list(self.opts['file_roots'])) - client_envs = self.client.envs() + envs.extend([x for x in list(self.opts['file_roots']) + if x not in envs]) env_order = self.opts.get('env_order', []) client_envs = self.client.envs() if env_order and client_envs:
Two fixes in _get_envs() 1. Don't get client_envs twice. 2. Don't add 'base' more than once.
saltstack_salt
train
py
269283efecb0fd4864b1871143387863a5f34f14
diff --git a/rinoh/structure.py b/rinoh/structure.py index <HASH>..<HASH> 100644 --- a/rinoh/structure.py +++ b/rinoh/structure.py @@ -290,10 +290,11 @@ class TableOfContentsEntry(ParagraphBase): return self.flowable.level def text(self, document): - text = [Reference(self.flowable.id, type=TITLE), Tab(), - Reference(self.flowable.id, type=PAGE)] + flowable_id = self.flowable.get_id(document) + text = [Reference(flowable_id, type=TITLE), Tab(), + Reference(flowable_id, type=PAGE)] if self.get_style('show_number', document): - number_ref = Reference(self.flowable.id, type=NUMBER, quiet=True) + number_ref = Reference(flowable_id, type=NUMBER, quiet=True) text = [number_ref, Tab()] + text return MixedStyledText(text, parent=self)
Fix the ToC for sections that have no explicit ID
brechtm_rinohtype
train
py
5ee25d91824977ab4905b094f1ffe5288d3e7a01
diff --git a/bcbio/structural/validate.py b/bcbio/structural/validate.py index <HASH>..<HASH> 100644 --- a/bcbio/structural/validate.py +++ b/bcbio/structural/validate.py @@ -347,11 +347,12 @@ def _plot_evaluation_event(df_csv, svtype): if i == 0: ax.set_title(metric, size=12, y=1.2) vals, labels = _get_plot_val_labels(df, size, metric, callers) - ax.barh(np.arange(len(vals)), vals) + ax.barh(range(1,len(vals)), vals) if j == 0: ax.tick_params(axis='y', which='major', labelsize=8) - ax.locator_params(nbins=len(callers) + 2, axis="y", tight=True) - ax.set_yticklabels(callers, va="bottom") + ax.locator_params(axis="y", tight=True) + ax.set_yticks(range(1,len(callers)+1,1)) + ax.set_yticklabels(callers, va="center") ax.text(100, len(callers), size_label, fontsize=10) else: ax.get_yaxis().set_ticks([])
Fixes tick labels positions on SV validation plot
bcbio_bcbio-nextgen
train
py
7de144146bbe886db2c2f995e8296c5be534fc77
diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -1762,7 +1762,10 @@ public class Jenkins extends AbstractCIBase implements ModifiableItemGroup<TopLe public String getRootUrl() { // for compatibility. the actual data is stored in Mailer String url = Mailer.descriptor().getUrl(); - if(url!=null) return url; + if(url!=null) { + if (!url.endsWith("/")) url += '/'; + return url; + } StaplerRequest req = Stapler.getCurrentRequest(); if(req!=null)
follow the contract to have '/' in the end
jenkinsci_jenkins
train
java
33a1ed305f7938f70f2ad3bed16b5e176a6abcdd
diff --git a/zipline/gens/utils.py b/zipline/gens/utils.py index <HASH>..<HASH> 100644 --- a/zipline/gens/utils.py +++ b/zipline/gens/utils.py @@ -19,22 +19,12 @@ import numbers from hashlib import md5 from datetime import datetime -from itertools import izip_longest from zipline.protocol import ( DATASOURCE_TYPE, Event ) -def alternate(g1, g2): - """Specialized version of roundrobin for just 2 generators.""" - for e1, e2 in izip_longest(g1, g2): - if e1 is not None: - yield e1 - if e2 is not None: - yield e2 - - def hash_args(*args, **kwargs): """Define a unique string for any set of representable args.""" arg_string = '_'.join([str(arg) for arg in args])
MAINT: Removes alternate function from gens.utils This function is no longer refrenced elsewhere in the codebase.
quantopian_zipline
train
py
86a2047282850bb58af00b4468d4bc063405e939
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -209,7 +209,7 @@ class ServerlessDynamodbLocal { let dbPath = options.dbPath; if (dbPath) { - options.dbPath = path.isAbsolute(dbPath) ? dbPath : path.join(this.serverless.config.servicePath, dbPath) + options.dbPath = path.isAbsolute(dbPath) ? dbPath : path.join(this.serverless.config.servicePath, dbPath); } if (!options.noStart) {
Fixing dbPath not working with relative path issue #<I>
99xt_serverless-dynamodb-local
train
js
c837ae0491481cc6b225f7d3846ff56e9266e369
diff --git a/src/Console/Commands/SeedCommand.php b/src/Console/Commands/SeedCommand.php index <HASH>..<HASH> 100644 --- a/src/Console/Commands/SeedCommand.php +++ b/src/Console/Commands/SeedCommand.php @@ -61,6 +61,7 @@ class SeedCommand extends Command 'is_active' => true, 'username' => 'Admin', 'email_verified' => true, + 'full_name' => 'Admin User', 'email' => '[email protected]', ];
Add missing admin full name to auth seeder
rinvex_cortex-auth
train
php