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
df7bf90803a686946e09d9ec175f8ab85277e989
diff --git a/rxjava-core/src/test/java/rx/operators/OperatorGroupByTest.java b/rxjava-core/src/test/java/rx/operators/OperatorGroupByTest.java index <HASH>..<HASH> 100644 --- a/rxjava-core/src/test/java/rx/operators/OperatorGroupByTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperatorGroupByTest.java @@ -484,21 +484,16 @@ public class OperatorGroupByTest { @Override public Observable<Integer> call(GroupedObservable<Integer, Integer> group) { if (group.getKey() == 0) { - return group.observeOn(Schedulers.newThread()).map(new Func1<Integer, Integer>() { + return group.delay(100, TimeUnit.MILLISECONDS).map(new Func1<Integer, Integer>() { @Override public Integer call(Integer t) { - try { - Thread.sleep(2); - } catch (InterruptedException e) { - e.printStackTrace(); - } return t * 10; } }); } else { - return group.observeOn(Schedulers.newThread()); + return group; } } })
GroupBy Test Improvement ObserveOn was the wrong mechanism for delaying behavior as it was relying on the buffering of observeOn. Now using delay() to delay the group since observeOn no longer buffers.
ReactiveX_RxJava
train
java
b4d6181285e8808511361694343f26082b72cdda
diff --git a/cache.go b/cache.go index <HASH>..<HASH> 100644 --- a/cache.go +++ b/cache.go @@ -91,8 +91,6 @@ func (c *LRUCache) Top() []BitmapPair { } func (c *LRUCache) onEvicted(key lru.Key, _ interface{}) { delete(c.counts, key.(uint64)) } -func (c *LRUCache) Refresh() { -} // Ensure LRUCache implements Cache. var _ Cache = &LRUCache{}
no longer need to implement `Refresh()` since that was removed`
pilosa_pilosa
train
go
efdb58ce006ca3e5d0936d98dd81c3229f26fac0
diff --git a/grammpy/HashContainer.py b/grammpy/HashContainer.py index <HASH>..<HASH> 100644 --- a/grammpy/HashContainer.py +++ b/grammpy/HashContainer.py @@ -31,9 +31,13 @@ class HashContainer: def add(self, item): items = HashContainer.to_iterable(item) # iterace throught items + add = [] for t in items: - self.__items[hash(t)] = t - return items + h = hash(t) + if h not in self.__items: + self.__items[h] = t + add.append(t) + return add def remove(self, item=None): if item is None:
Reiplement HashCotnainer.add method so only elements that are newly add are return
PatrikValkovic_grammpy
train
py
063a5f7c797648fbeaac92ce6b4488231d04ceae
diff --git a/code/dispatcher/behavior/cacheable.php b/code/dispatcher/behavior/cacheable.php index <HASH>..<HASH> 100644 --- a/code/dispatcher/behavior/cacheable.php +++ b/code/dispatcher/behavior/cacheable.php @@ -62,19 +62,21 @@ class DispatcherBehaviorCacheable extends DispatcherBehaviorAbstract $response = $mixer->getResponse(); $user = $mixer->getUser(); + //Reset cache control header (if caching enabled) if(!$user->isAuthentic()) { $cache_control = (array) KObjectConfig::unbox($this->getConfig()->cache_control); + $response->headers->set('Cache-Control', $cache_control, true); + $response->setMaxAge($this->getConfig()->cache_time, $this->getConfig()->cache_time_shared); } else { $cache_control = (array) KObjectConfig::unbox($this->getConfig()->cache_control_private); + $response->headers->set('Cache-Control', $cache_control, true); + $response->setMaxAge($this->getConfig()->cache_time_private); } - - //Reset cache control header (if caching enabled) - $response->headers->set('Cache-Control', $cache_control, true); } }
#<I> Make sure we reset the cache-control first before setting max-age joomlatools/joomlatools-framework #<I>
timble_kodekit
train
php
266a570b3ca0070dfc35f48d9fff63af5154b664
diff --git a/mamba/formatters.py b/mamba/formatters.py index <HASH>..<HASH> 100644 --- a/mamba/formatters.py +++ b/mamba/formatters.py @@ -145,7 +145,7 @@ class DocumentationFormatter(Formatter): class ProgressFormatter(DocumentationFormatter): def example_passed(self, example): - puts('.', newline=False) + puts(colored.green('.'), newline=False) def example_failed(self, example): puts(colored.red('F'), newline=False)
Use green dots when a test is successful in ProgressFormatter
nestorsalceda_mamba
train
py
4f39e439500699ed704f757001acef3eb890a6d0
diff --git a/core/src/main/java/org/infinispan/affinity/KeyAffinityServiceImpl.java b/core/src/main/java/org/infinispan/affinity/KeyAffinityServiceImpl.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/infinispan/affinity/KeyAffinityServiceImpl.java +++ b/core/src/main/java/org/infinispan/affinity/KeyAffinityServiceImpl.java @@ -268,10 +268,11 @@ public class KeyAffinityServiceImpl<K> implements KeyAffinityService<K> { while (existingKeyCount.get() < maxNumberOfKeys.get() && missCount < maxMisses) { K key = keyGenerator.getKey(); Address addressForKey = getAddressForKey(key); + boolean added = false; if (interestedInAddress(addressForKey)) { - boolean added = tryAddKey(addressForKey, key); - if (!added) missCount++; + added = tryAddKey(addressForKey, key); } + if (!added) missCount++; } // if we had too many misses, just release the lock and try again
ISPN-<I> Avoid looping indefinitely in KeyAffinityServiceImpl With NBST it's possible for a node to not own (as primary owner) any keys for a while. KeyAffinityServiceImpl should pause if it can't find any keys for the nodes in its filter.
infinispan_infinispan
train
java
87f89db81fa862cf056f242607fcbcd273ae8042
diff --git a/src/Illuminate/Database/Eloquent/FactoryBuilder.php b/src/Illuminate/Database/Eloquent/FactoryBuilder.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Database/Eloquent/FactoryBuilder.php +++ b/src/Illuminate/Database/Eloquent/FactoryBuilder.php @@ -92,7 +92,7 @@ class FactoryBuilder /** * Set the states to be applied to the model. * - * @param array|dynamic $states + * @param array|mixed $states * @return $this */ public function states($states)
Update docblock on states method on FactoryBuilder (#<I>)
laravel_framework
train
php
a7918ee01f0068a0d4b4f51e26f4717355dcf61e
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -61,7 +61,7 @@ class GulpRollup extends Transform { var originalCwd = file.cwd var originalPath = file.path - var moduleName = path.basename(file.path, path.extname(file.path)) + var moduleName = _.camelCase(path.basename(file.path, path.extname(file.path))) function generateAndApplyBundle(bundle, generateOptions, targetFile) { // Sugaring the API by copying convinience objects and properties from rollupOptions
Force moduleName to have camelCase syntax. This is for files that are named with hyphens.
MikeKovarik_gulp-better-rollup
train
js
573b9821cdcf4b81ad728b9942752f484f2f0e5f
diff --git a/src/java/com/threerings/whirled/spot/data/Portal.java b/src/java/com/threerings/whirled/spot/data/Portal.java index <HASH>..<HASH> 100644 --- a/src/java/com/threerings/whirled/spot/data/Portal.java +++ b/src/java/com/threerings/whirled/spot/data/Portal.java @@ -1,5 +1,5 @@ // -// $Id: Portal.java,v 1.1 2001/11/13 02:25:35 mdb Exp $ +// $Id: Portal.java,v 1.2 2001/11/29 00:16:31 mdb Exp $ package com.threerings.whirled.spot.data; @@ -27,6 +27,11 @@ public class Portal extends Location * the target scene when they "use" this portal. */ public int targetLocationId; + /** During the offline scene creation process, a portal will have a + * huamn readable name. This is not serialized or transmitted over the + * wire. */ + public String name; + /** * Constructs a portal with the supplied values. */
Added a name for use in the editor and in XML files. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1
threerings_narya
train
java
4e288ba15f82a5614cf10bc18698cc8a8f374498
diff --git a/src/Venturecraft/Revisionable/Revision.php b/src/Venturecraft/Revisionable/Revision.php index <HASH>..<HASH> 100644 --- a/src/Venturecraft/Revisionable/Revision.php +++ b/src/Venturecraft/Revisionable/Revision.php @@ -139,7 +139,7 @@ class Revision extends Eloquent // Now we can find out the namespace of of related model if (!method_exists($main_model, $related_model)) { - $related_model = camel_case($related_model); // for cases like published_status_id + $related_model = Str::camel($related_model); // for cases like published_status_id if (!method_exists($main_model, $related_model)) { throw new \Exception('Relation ' . $related_model . ' does not exist for ' . get_class($main_model)); }
Adding in the call to camel case
VentureCraft_revisionable
train
php
504e09a2bde7e729173d0bb0d026e8f06ff42638
diff --git a/assemblerflow/generator/recipe.py b/assemblerflow/generator/recipe.py index <HASH>..<HASH> 100644 --- a/assemblerflow/generator/recipe.py +++ b/assemblerflow/generator/recipe.py @@ -408,7 +408,9 @@ class Recipe: continue final_forks.append(forks[i]) + print(final_forks) total_forks = len(final_forks) + first_fork = final_forks[0] if len(final_forks) == 1: final_forks = str(final_forks[0]) @@ -429,7 +431,8 @@ class Recipe: # Replace only names by names + process ids for key, val in self.process_to_id.items(): # Case only one process in the pipeline - if total_forks == 1: + print(total_forks) + if total_forks == 1 and len(first_fork) == 1: pipeline_string = pipeline_string \ .replace("{}".format(key), "{}={{'pid':'{}'}}".format(key, val))
add recipe check for number of forks
assemblerflow_flowcraft
train
py
45f51f7c0e0d70c859c98043ab56fd3022aec24b
diff --git a/zone_test.go b/zone_test.go index <HASH>..<HASH> 100644 --- a/zone_test.go +++ b/zone_test.go @@ -1469,29 +1469,11 @@ func TestListZonesFailingPages(t *testing.T) { } func TestListZonesContextManualPagination1(t *testing.T) { - setup() - defer teardown() - - handler := func(w http.ResponseWriter, r *http.Request) { - assert.FailNow(t, "no requests should have been made") - } - - mux.HandleFunc("/zones", handler) - _, err := client.ListZonesContext(context.Background(), WithPagination(PaginationOptions{Page: 2})) assert.EqualError(t, err, errManualPagination) } func TestListZonesContextManualPagination2(t *testing.T) { - setup() - defer teardown() - - handler := func(w http.ResponseWriter, r *http.Request) { - assert.FailNow(t, "no requests should have been made") - } - - mux.HandleFunc("/zones", handler) - _, err := client.ListZonesContext(context.Background(), WithPagination(PaginationOptions{PerPage: 30})) assert.EqualError(t, err, errManualPagination) }
refactor: no need to start useless servers during testing
cloudflare_cloudflare-go
train
go
481f09fddb6131e745344456095867fbabe06cbb
diff --git a/src/node-plop.js b/src/node-plop.js index <HASH>..<HASH> 100644 --- a/src/node-plop.js +++ b/src/node-plop.js @@ -121,18 +121,30 @@ function nodePlop(plopfilePath = '', plopCfg = {}) { // generator runner methods // const plopfileApi = { - setPrompt, renderString, inquirer, handlebars, + // main methods for setting and getting plop context things + setPrompt, setGenerator, getGenerator, getGeneratorList, - setPlopfilePath, getPlopfilePath, getDestBasePath, load, - setPartial, getPartialList, getPartial, - setHelper, getHelperList, getHelper, - setActionType, getActionTypeList, getActionType, - setDefaultInclude, getDefaultInclude, - // for backward compatibility + setPartial, getPartial, getPartialList, + setHelper, getHelper, getHelperList, + setActionType, getActionType, getActionTypeList, + + // path context methods + setPlopfilePath, getPlopfilePath, + getDestBasePath, + + // plop.load functionality + load, setDefaultInclude, getDefaultInclude, + + // render a handlebars template + renderString, + + // passthrough properties + inquirer, handlebars, + + // passthroughs for backward compatibility addPrompt: setPrompt, addPartial: setPartial, - addHelper: setHelper, - addActionType: setActionType + addHelper: setHelper }; // the runner for this instance of the nodePlop api
organize plopfileApi attributes and add comments
amwmedia_node-plop
train
js
340874808c7021fefb7b41083498115f7d13491e
diff --git a/pyjade/lexer.py b/pyjade/lexer.py index <HASH>..<HASH> 100644 --- a/pyjade/lexer.py +++ b/pyjade/lexer.py @@ -38,7 +38,7 @@ class Lexer(object): RE_INCLUDE = re.compile(r'^include +([^\n]+)') RE_ASSIGNMENT = re.compile(r'^(-\s+var\s+)?(\w+) += *([^;\n]+)( *;? *)') RE_MIXIN = re.compile(r'^mixin +([-\w]+)(?: *\((.*)\))?') - RE_CALL = re.compile(r'^\+([-\w]+)(?: *\((.*)\))?') + RE_CALL = re.compile(r'^\+\s*([-.\w]+)(?: *\((.*)\))?') RE_CONDITIONAL = re.compile(r'^(?:- *)?(if|unless|else if|elif|else)\b([^\n]*)') RE_BLANK = re.compile(r'^\n *\n') # RE_WHILE = re.compile(r'^while +([^\n]+)')
Enhancement for mixin - Enable whitespace after + - Enable using module.function as mixin
syrusakbary_pyjade
train
py
508308fb7c1edc0cfc2d0adbb869122abdb4fa67
diff --git a/mod/quiz/styles.php b/mod/quiz/styles.php index <HASH>..<HASH> 100644 --- a/mod/quiz/styles.php +++ b/mod/quiz/styles.php @@ -140,3 +140,15 @@ body#mod-quiz-report table#responses .correct { body#mod-quiz-report table#responses .partialcorrect { color: orange; } + +#mod-quiz-attempt #timer .generalbox { + width:150px +} +#mod-quiz-attempt #timer { + position:fixed !important; + top:100px !important; + left:10px !important +} +* html #mod-quiz-attempt #timer { + position:absolute !important +} \ No newline at end of file
Added CSS properties for Firefox for fixed placement of the timer. It is a preliminarily fix. Please follow Bug #<I>.
moodle_moodle
train
php
f8e1ed9bed4a5edffe2b42b6523af5befe31456b
diff --git a/src/Metadata/Driver/DriverChain.php b/src/Metadata/Driver/DriverChain.php index <HASH>..<HASH> 100644 --- a/src/Metadata/Driver/DriverChain.php +++ b/src/Metadata/Driver/DriverChain.php @@ -22,10 +22,15 @@ final class DriverChain implements AdvancedDriverInterface { private $drivers; - public function __construct(array $drivers) + public function __construct(array $drivers = array()) { $this->drivers = $drivers; } + + public function addDriver(DriverInterface $driver) + { + $this->drivers[] = $driver; + } public function loadMetadataForClass(\ReflectionClass $class) {
Allow to add drivers to a driver chain
schmittjoh_metadata
train
php
a45f724216f24a6cf06eb42f54350e10f42da94a
diff --git a/src/HttpHandler.php b/src/HttpHandler.php index <HASH>..<HASH> 100644 --- a/src/HttpHandler.php +++ b/src/HttpHandler.php @@ -183,6 +183,30 @@ class HttpHandler extends AbstractProcessingHandler } /** + * Handles a set of records at once. + * + * @param array $records The records to handle (an array of record arrays) + * @return bool + */ + public function handleBatch(array $records) + { + foreach ($records as $key => $record) { + if ($this->isHandling($record)) { + $record = $this->processRecord($record); + $records['records'][] = $record; + } + + unset($records[$key]); + } + + $records['formatted'] = $this->getFormatter()->formatBatch($records['records'] ?? []); + + $this->write($records); + + return false === $this->bubble; + } + + /** * Gets the default formatter. * * @return \Monolog\Formatter\JsonFormatter
Added an own implementation of the handleBatch function
msschl_monolog-http-handler
train
php
bded59aa5f57ec139c655060deb1fbe6cf57dc4c
diff --git a/src/main/java/com/intalio/bpmn2/impl/Bpmn2JsonUnmarshaller.java b/src/main/java/com/intalio/bpmn2/impl/Bpmn2JsonUnmarshaller.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/intalio/bpmn2/impl/Bpmn2JsonUnmarshaller.java +++ b/src/main/java/com/intalio/bpmn2/impl/Bpmn2JsonUnmarshaller.java @@ -500,6 +500,9 @@ public class Bpmn2JsonUnmarshaller { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else if (incoming > 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.MIXED); + } else if (incoming == 1 && outgoing == 1) { + // this handles the 1:1 case of the diverging gateways + gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); }
JBPM-<I>: Oryx integration - gateway direction is unspecified in case of one incoming and one outgoing connections for a gateway
kiegroup_jbpm-designer
train
java
ae9d340cfa1cfd081eb4bb356e14993865ee32b1
diff --git a/lib/lyber_core/robot.rb b/lib/lyber_core/robot.rb index <HASH>..<HASH> 100644 --- a/lib/lyber_core/robot.rb +++ b/lib/lyber_core/robot.rb @@ -105,8 +105,9 @@ module LyberCore def item_queued?(druid) status = workflow_service.workflow_status(druid: druid, workflow: @workflow_name, process: @step_name) return true if status =~ /queued/i - - LyberCore::Log.warn "Item #{druid} is not queued, but has status of '#{status}'. Will skip processing" + msg = "Item #{druid} is not queued for #{@step_name} (#{@workflow_name}), but has status of '#{status}'. Will skip processing" + Honeybadger.notify(msg) if defined? Honeybadger + LyberCore::Log.warn msg false end end
HB notifies if workflow step is not queued.
sul-dlss_lyber-core
train
rb
6139de868021f2c6626230a69628de74dc8f03d7
diff --git a/src/Control/Email/Email.php b/src/Control/Email/Email.php index <HASH>..<HASH> 100644 --- a/src/Control/Email/Email.php +++ b/src/Control/Email/Email.php @@ -621,6 +621,12 @@ class Email extends ViewableData */ public function setBody($body) { + $plainPart = $this->findPlainPart(); + if ($plainPart) { + $this->getSwiftMessage()->detach($plainPart); + } + unset($plainPart); + $body = HTTP::absoluteURLs($body); $this->getSwiftMessage()->setBody($body); @@ -856,6 +862,12 @@ class Email extends ViewableData */ public function generatePlainPartFromBody() { + $plainPart = $this->findPlainPart(); + if ($plainPart) { + $this->getSwiftMessage()->detach($plainPart); + } + unset($plainPart); + $this->getSwiftMessage()->addPart( Convert::xml2raw($this->getBody()), 'text/plain',
FIX Make sure plain parts are rendered when re-rendering emails
silverstripe_silverstripe-framework
train
php
516699081de33cce33aae58659604202a2b654f2
diff --git a/hwt/interfaces/std.py b/hwt/interfaces/std.py index <HASH>..<HASH> 100644 --- a/hwt/interfaces/std.py +++ b/hwt/interfaces/std.py @@ -294,11 +294,15 @@ class RegCntrl(Interface): def _config(self): self.DATA_WIDTH = Param(8) + self.USE_IN = Param(True) + self.USE_OUT = Param(True) def _declr(self): - self.din = VectSignal(self.DATA_WIDTH, masterDir=D.IN) - with self._paramsShared(): - self.dout = VldSynced() + if self.USE_IN: + self.din = VectSignal(self.DATA_WIDTH, masterDir=D.IN) + if self.USE_OUT: + with self._paramsShared(): + self.dout = VldSynced() def _initSimAgent(self, sim: HdlSimulator): self._ag = RegCntrlAgent(sim, self)
RegCntrl: USE_IN/OUT params to dissable r/w channel
Nic30_hwt
train
py
9cee7edda13f0c83ef857bebb06b83a864d0bb1f
diff --git a/src/RegexMatcher.php b/src/RegexMatcher.php index <HASH>..<HASH> 100644 --- a/src/RegexMatcher.php +++ b/src/RegexMatcher.php @@ -19,7 +19,7 @@ */ public function match($content) { foreach ($this->_regexes as $regex) { - if (preg_match('/^' . $regex . '/', $content, $matches)) { + if (preg_match('/^' . $regex . '/ms', $content, $matches)) { return $matches[0]; } } diff --git a/tests/RegexMatcherTest.php b/tests/RegexMatcherTest.php index <HASH>..<HASH> 100644 --- a/tests/RegexMatcherTest.php +++ b/tests/RegexMatcherTest.php @@ -29,4 +29,9 @@ $this->assertEquals('aa', $regexMatcher->match('aa|')); $this->assertNull($regexMatcher->match('|')); } + + public function testMultilineRegex() { + $regexMatcher = new RegexMatcher('.*'); + $this->assertEquals("a\nb", $regexMatcher->match("a\nb")); + } }
Added support for multi-line regex
HippoPHP_Tokenizer
train
php,php
f611d278a7c991e180b82665f94f7e43d0580b6c
diff --git a/keymap/emacs.js b/keymap/emacs.js index <HASH>..<HASH> 100644 --- a/keymap/emacs.js +++ b/keymap/emacs.js @@ -369,7 +369,7 @@ "Ctrl-/": repeated("undo"), "Shift-Ctrl--": repeated("undo"), "Ctrl-Z": repeated("undo"), "Cmd-Z": repeated("undo"), "Shift-Alt-,": "goDocStart", "Shift-Alt-.": "goDocEnd", - "Ctrl-S": "findNext", "Ctrl-R": "findPrev", "Ctrl-G": quit, "Shift-Alt-5": "replace", + "Ctrl-S": "findPersistentNext", "Ctrl-R": "findPersistentPrev", "Ctrl-G": quit, "Shift-Alt-5": "replace", "Alt-/": "autocomplete", "Enter": "newlineAndIndent", "Ctrl-J": repeated(function(cm) { cm.replaceSelection("\n", "end"); }),
[emacs keymap] Bind ctrl-s/r to persistent search Issue #<I>
codemirror_CodeMirror
train
js
b4ace2d7e86c44428353995ba146de0e1aeaef00
diff --git a/spyderlib/ipythonconfig.py b/spyderlib/ipythonconfig.py index <HASH>..<HASH> 100644 --- a/spyderlib/ipythonconfig.py +++ b/spyderlib/ipythonconfig.py @@ -16,6 +16,7 @@ from spyderlib.baseconfig import _ # Constants IPYTHON_REQVER = '>=1.0' ZMQ_REQVER = '>=2.1.11' +QTCONSOLE_REQVER = '>=4.0' # Dependencies @@ -25,12 +26,18 @@ dependencies.add("zmq", _("IPython Console integration"), required_version=ZMQ_REQVER) +# Jupyter 4.0 requirements +ipy4_installed = programs.is_module_installed('IPython', '>=4.0') +if ipy4_installed: + dependencies.add("qtconsole", _("IPython Console integration"), + required_version=QTCONSOLE_REQVER) + + # Auxiliary functions def is_qtconsole_installed(): pyzmq_installed = programs.is_module_installed('zmq') pygments_installed = programs.is_module_installed('pygments') ipyqt_installed = programs.is_module_installed('IPython.qt') - ipy4_installed = programs.is_module_installed('IPython', '>=4.0') if ipyqt_installed and pyzmq_installed and pygments_installed: if ipy4_installed:
IPython Console: Add qtconsole as a dependency if IPython <I> is found
spyder-ide_spyder
train
py
328c0f9ce2ac5496015bdafd6738a69ea53fc7ac
diff --git a/spec/dummy/db/schema.rb b/spec/dummy/db/schema.rb index <HASH>..<HASH> 100644 --- a/spec/dummy/db/schema.rb +++ b/spec/dummy/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20121102151448) do +ActiveRecord::Schema.define(:version => 20121102183150) do create_table "task_manager_assignables", :force => true do |t| t.integer "plan_id" @@ -37,6 +37,8 @@ ActiveRecord::Schema.define(:version => 20121102151448) do t.hstore "data" t.datetime "last_task_created_at" t.boolean "autocompletable" + t.string "plan_type" + t.integer "ahead_of_time" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false end
Added `plan_type` and `ahead_of_time`
menglifang_task-manager
train
rb
8c1779d6712f102f2844621508e9f445540be7d2
diff --git a/lib/php/lib/Thrift/Transport/TBufferedTransport.php b/lib/php/lib/Thrift/Transport/TBufferedTransport.php index <HASH>..<HASH> 100644 --- a/lib/php/lib/Thrift/Transport/TBufferedTransport.php +++ b/lib/php/lib/Thrift/Transport/TBufferedTransport.php @@ -156,8 +156,13 @@ class TBufferedTransport extends TTransport { public function flush() { if (TStringFuncFactory::create()->strlen($this->wBuf_) > 0) { - $this->transport_->write($this->wBuf_); + $out = $this->wBuf_; + + // Note that we clear the internal wBuf_ prior to the underlying write + // to ensure we're in a sane state (i.e. internal buffer cleaned) + // if the underlying write throws up an exception $this->wBuf_ = ''; + $this->transport_->write($out); } $this->transport_->flush(); }
THRIFT-<I> TBufferedTransport doesn't clear it's buffer on a failed flush call Patch: Chris Trotman
limingxinleo_thrift
train
php
d14cc9e768dd9337aaed83dd6a5f217181e38278
diff --git a/peerplaysbase/chains.py b/peerplaysbase/chains.py index <HASH>..<HASH> 100644 --- a/peerplaysbase/chains.py +++ b/peerplaysbase/chains.py @@ -12,13 +12,11 @@ known_chains = { "core_symbol": "PPYTEST", "prefix": "PPYTEST"}, "CHARLIE": { - "chain_id": "7fc0555c880b2df4c5a79f084fc5cb659b112b9b70ff41a3c5cda65e9cf1e177", + "chain_id": "789de55e9d6472a04c51df9a0bbdf3ada5e3c84fbd00b7c758108b337ab18dde", "core_symbol": "PPY", - "prefix": "PPY" - }, + "prefix": "PPY"}, "ELIZABETH": { "chain_id": "95e08774554ed5139854d0aa930b3952192b0fb795445113a23bdead730749cd", "core_symbol": "PPY", - "prefix": "PPY" - } + "prefix": "PPY"} }
New chain-id for charlie
peerplays-network_python-peerplays
train
py
e59962f4feb20cc1da016abc2db3c1fb6cb1ab66
diff --git a/Entity/Product.php b/Entity/Product.php index <HASH>..<HASH> 100755 --- a/Entity/Product.php +++ b/Entity/Product.php @@ -84,7 +84,7 @@ class Product implements ProductInterface protected $reviews; /** - * @var float + * @var int */ protected $stock; diff --git a/Entity/ProductInterface.php b/Entity/ProductInterface.php index <HASH>..<HASH> 100755 --- a/Entity/ProductInterface.php +++ b/Entity/ProductInterface.php @@ -59,12 +59,12 @@ interface ProductInterface extends public function setSku($sku); /** - * @return float + * @return int */ public function getStock(); /** - * @param float $stock + * @param int $stock */ public function setStock($stock);
Fixed wrong doc for stock (cherry picked from commit eee<I>e<I>c<I>e<I>e9cc8eb9f<I>bd4ac<I>)
WellCommerce_WishlistBundle
train
php,php
ca75d86150463d082e85d6edafe0d23d3bf411c3
diff --git a/apps/crashing.go b/apps/crashing.go index <HASH>..<HASH> 100644 --- a/apps/crashing.go +++ b/apps/crashing.go @@ -54,18 +54,13 @@ var _ = AppsDescribe("Crashing", func() { ).Wait(Config.CfPushTimeoutDuration())).To(Exit(0)) }) - Context("crash events", func() { - SkipOnK8s("remove this skip and the enclosing Context() once we bump to eirini 1.9") - It("shows crash events", func() { - helpers.CurlApp(Config, appName, "/sigterm/KILL") - - Eventually(func() string { - return string(cf.Cf("events", appName).Wait().Out.Contents()) - }).Should(MatchRegexp("app.crash")) - }) + It("shows crash events", func() { + helpers.CurlApp(Config, appName, "/sigterm/KILL") + Eventually(func() string { + return string(cf.Cf("events", appName).Wait().Out.Contents()) + }).Should(MatchRegexp("app.crash")) }) - It("recovers", func() { const idChecker = "^[0-9a-zA-Z]+(?:-[0-9a-zA-z]+)+$"
Test app.crash events on cf-for-k8s * Waited for cf-for-k8s to bump to eirini <I> where app.crash permissions were fixed [#<I>](<URL>)
cloudfoundry_cf-acceptance-tests
train
go
99a5cd78ec4e07330b94befdd7c35704407736c2
diff --git a/admin/tool/dbtransfer/database_transfer_form.php b/admin/tool/dbtransfer/database_transfer_form.php index <HASH>..<HASH> 100644 --- a/admin/tool/dbtransfer/database_transfer_form.php +++ b/admin/tool/dbtransfer/database_transfer_form.php @@ -39,7 +39,7 @@ class database_transfer_form extends moodleform { 'pgsql/native', 'mssql/native', 'oci/native', - 'sqlite3/pdo', + 'sqlsrv/native', ); $drivers = array(); foreach($supported as $driver) {
MDL-<I> add sqlsrv to list dbtransfer targets, remove unfinished sqlite support
moodle_moodle
train
php
40be9715bc697b99a6abe06421ed1eceb7cd134a
diff --git a/auxiliary-storage/client/src/main/java/org/talend/esb/auxiliary/storage/client/rest/AbstractAuxiliaryStorageClientRest.java b/auxiliary-storage/client/src/main/java/org/talend/esb/auxiliary/storage/client/rest/AbstractAuxiliaryStorageClientRest.java index <HASH>..<HASH> 100644 --- a/auxiliary-storage/client/src/main/java/org/talend/esb/auxiliary/storage/client/rest/AbstractAuxiliaryStorageClientRest.java +++ b/auxiliary-storage/client/src/main/java/org/talend/esb/auxiliary/storage/client/rest/AbstractAuxiliaryStorageClientRest.java @@ -37,11 +37,11 @@ public abstract class AbstractAuxiliaryStorageClientRest<E> extends AuxiliarySto private WebClient cachedClient = null; private ReentrantLock lock = new ReentrantLock(); - + public AbstractAuxiliaryStorageClientRest() { super(); } - + public AbstractAuxiliaryStorageClientRest(Properties props) { super(props); } @@ -53,9 +53,6 @@ public abstract class AbstractAuxiliaryStorageClientRest<E> extends AuxiliarySto return cachedClient; } - protected String urlEncode(String param) throws UnsupportedEncodingException { - return URLEncoder.encode(param, "UTF-8"); - } public void switchServerURL(String usedUrl) {
Aux. storage service - removed unused method
Talend_tesb-rt-se
train
java
c702e4d32cc84d3527eabe72e16e2229b86fa086
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ extras_require['dev'] = [ 'python-coveralls==2.9.1', 'vcrpy==1.13.0', 'mock==2.0.0', - 'pylint==2.1.1', + 'pylint<2.0.0', # Can pass to 2.x branch when support for Python 2.x in Lexicon is dropped ] setup( diff --git a/tests/pylint_quality_gate.py b/tests/pylint_quality_gate.py index <HASH>..<HASH> 100644 --- a/tests/pylint_quality_gate.py +++ b/tests/pylint_quality_gate.py @@ -56,7 +56,7 @@ def main(): os.path.join(repo_dir, 'lexicon'), os.path.join(repo_dir, 'tests'), os.path.join(repo_dir, 'tests', 'providers'), '--persistent=n'], - do_exit=False) + exit=False) stats = results.linter.stats sys.exit(quality_gate(stats))
Give full support of python <I>
AnalogJ_lexicon
train
py,py
9aa8f3ababe570c387a0cad172864e39eca88d6f
diff --git a/DependencyInjection/GifExceptionExtension.php b/DependencyInjection/GifExceptionExtension.php index <HASH>..<HASH> 100644 --- a/DependencyInjection/GifExceptionExtension.php +++ b/DependencyInjection/GifExceptionExtension.php @@ -58,6 +58,10 @@ class GifExceptionExtension extends Extension implements CompilerPassInterface */ public function process(ContainerBuilder $container) { + if (!$container->getParameter('kernel.debug')) { + return; + } + $definition = $container->getDefinition('gif_exception.listener.replace_image'); $definition->addArgument($container->getParameter('twig.exception_listener.controller'));
Do not process anything is debug is not activated The extension load is not run if the kernel debug is not activated. We have to do the same on GifExceptionExtension::process method or we will get an error like below. You have requested a non-existent service "gif_exception.listener.replace_image".
jolicode_GifExceptionBundle
train
php
ec2df963985559cb843d055b6a457abde1b480eb
diff --git a/lib/erector/rails/extensions/rails_widget.rb b/lib/erector/rails/extensions/rails_widget.rb index <HASH>..<HASH> 100644 --- a/lib/erector/rails/extensions/rails_widget.rb +++ b/lib/erector/rails/extensions/rails_widget.rb @@ -33,12 +33,10 @@ module Erector process_output_buffer || @output end - def capture_with_parent(&block) - parent ? parent.capture(&block) : capture_without_parent(&block) + def capture(&block) + parent ? parent.capture(&block) : super end - alias_method_chain :capture, :parent - # This is here to force #parent.capture to return the output def __in_erb_template; end
We're subclassing, don't need alias_method_chain.
erector_erector
train
rb
1386906f025630a4201365ffb5018fcc3cccbde8
diff --git a/salt/runner.py b/salt/runner.py index <HASH>..<HASH> 100644 --- a/salt/runner.py +++ b/salt/runner.py @@ -65,9 +65,11 @@ class RunnerClient(mixins.SyncClientMixin, mixins.AsyncClientMixin, object): # Support old style calls where arguments could be specified in 'low' top level if not low.get('args') and not low.get('kwargs'): # not specified or empty verify_fun(self.functions, fun) + merged_args_kwargs = salt.utils.args.condition_input([], low) + parsed_input = salt.utils.args.parse_input(merged_args_kwargs) args, kwargs = salt.minion.load_args_and_kwargs( self.functions[fun], - salt.utils.args.condition_input([], low), + parsed_input, self.opts, ignore_invalid=True )
Ensure kwargs properly parsed in RunnerClient Apply salt.utils.args.parse_input to kwargs in low data within RunnerClient._reformat_low before calling salt.minion.load_args_and_kwargs according to its requirements The salt.utils.args.parse_input is responsible for 'yamlifying' input arguments hence missing call leads to un-parsed argument values
saltstack_salt
train
py
79d29f63140caccf8afc54772053de851fceb177
diff --git a/eppy/runner/run_functions.py b/eppy/runner/run_functions.py index <HASH>..<HASH> 100644 --- a/eppy/runner/run_functions.py +++ b/eppy/runner/run_functions.py @@ -1,4 +1,5 @@ # Copyright (c) 2016 Jamie Bull +# Copyright (c) 2021 Johan Tibell # ======================================================================= # Distributed under the MIT License. # (See accompanying file LICENSE or copy at
Update run_functions.py Add Johan Tibell to (c) due to additions in <URL>
santoshphilip_eppy
train
py
49e8ed411c8b17861a5795a140059a510bb2b1ca
diff --git a/lib/le_ssl/manager.rb b/lib/le_ssl/manager.rb index <HASH>..<HASH> 100644 --- a/lib/le_ssl/manager.rb +++ b/lib/le_ssl/manager.rb @@ -93,14 +93,16 @@ module LeSSL private def private_key=(key) - if key.is_a?(OpenSSL::PKey::RSA) - @private_key = key - elsif key.is_a?(String) - @private_key = OpenSSL::PKey::RSA.new(key) - elsif key.nil? - nil # Return silently - else - raise LeSSL::PrivateKeyInvalidFormat + @private_key = begin + if key.is_a?(OpenSSL::PKey::RSA) + key + elsif key.is_a?(String) + OpenSSL::PKey::RSA.new(key) + elsif key.nil? + nil + else + raise LeSSL::PrivateKeyInvalidFormat + end end end
Set private key to nil if nil is given
tobiasfeistmantl_LeSSL
train
rb
fa5aea7631e7cdb84a5f38264f6ecff32212affe
diff --git a/parsecsv.lib.php b/parsecsv.lib.php index <HASH>..<HASH> 100644 --- a/parsecsv.lib.php +++ b/parsecsv.lib.php @@ -405,7 +405,7 @@ class parseCSV { $this->conditions = $conditions; } - if (is_readable($input)) { + if (strlen($input) <= PHP_MAXPATHLEN && is_readable($input)) { $this->data = $this->parse_file($input); } else { $this->file_data = &$input;
Suppress file name too long warning Suppress Warning: "File name is longer than the maximum allowed path length on this platform (<I>)"
parsecsv_parsecsv-for-php
train
php
4aa6eff9cb3520f1b4e67549496f997d073268e8
diff --git a/src/sos/step_executor.py b/src/sos/step_executor.py index <HASH>..<HASH> 100755 --- a/src/sos/step_executor.py +++ b/src/sos/step_executor.py @@ -128,8 +128,12 @@ def expand_input_files(value, *args, **kwargs): args = [x.resolve() if isinstance(x, dynamic) else x for x in args] kwargs = {x:(y.resolve() if isinstance(y, dynamic) else y) for x,y in kwargs.items()} + # if no input, if not args and not kwargs: return env.sos_dict['step_input'] + # if only group_by ... + elif not args and len(kwargs) == 1 and list(kwargs.keys())[0] == 'group_by': + return sos_targets(env.sos_dict['step_input'], **kwargs) else: return sos_targets(*args, **kwargs, _verify_existence=True, _undetermined=False, _source=env.sos_dict['step_name'])
Fix cases with no input but a single group_by
vatlab_SoS
train
py
eec8f9e1c7b250c68ca1d50c31e066e8d3fe0ccd
diff --git a/lib/gen-remote.js b/lib/gen-remote.js index <HASH>..<HASH> 100644 --- a/lib/gen-remote.js +++ b/lib/gen-remote.js @@ -20,10 +20,7 @@ function mapDeps(config) { } /** - * Generates file that fetch the remote script asynchronously and call back with the object it exports - * Expected to be called during initialization and therefore uses sync IO - * TODO: make async and take array of configs to generate remotes for - * call back with list of paths of remotes + * Generates file that fetch the remote script asynchronously and call back with the object it exports. * * @name genRemote * @function
updating gen remote comment to current status
thlorenz_bromote
train
js
21be5cb54a4d1611e6c277c4024b2c80d6b85023
diff --git a/montblanc/version.py b/montblanc/version.py index <HASH>..<HASH> 100644 --- a/montblanc/version.py +++ b/montblanc/version.py @@ -1,2 +1,2 @@ # Do not edit this file, pipeline versioning is governed by git tags -__version__='0.4.0-alpha2' \ No newline at end of file +__version__="0.4.0-alpha2" \ No newline at end of file diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ except: version_msg = "# Do not edit this file, pipeline versioning is governed by git tags" with open(version_py, 'w') as fh: - fh.write(version_msg + os.linesep + "__version__='" + version_git + "'") + fh.write(version_msg + os.linesep + "__version__=\"" + version_git +"\"") def readme(): with open('README.md') as f:
Surround version string with double rather than single quotes. Update the version file.
ska-sa_montblanc
train
py,py
21437a1cb493ef4472dbba2773c767adaf48dc83
diff --git a/s2/shapeindex.go b/s2/shapeindex.go index <HASH>..<HASH> 100644 --- a/s2/shapeindex.go +++ b/s2/shapeindex.go @@ -1169,7 +1169,7 @@ func (s *ShapeIndex) makeIndexCell(p *PaddedCell, edges []*clippedEdge, t *track if eNext != len(edges) { eshapeID = edges[eNext].faceEdge.shapeID } - if cNextIdx != len(cshapeIDs) { + if cNextIdx < len(cshapeIDs) { cshapeID = cshapeIDs[cNextIdx] } eBegin := eNext
s2: Fix a ShapeIndex bounds check that was off by one. It broke code coming in a later change.
golang_geo
train
go
8540e969092bd70b05cdb2c31b7dcf869470dace
diff --git a/spec/hash_redactor_spec.rb b/spec/hash_redactor_spec.rb index <HASH>..<HASH> 100644 --- a/spec/hash_redactor_spec.rb +++ b/spec/hash_redactor_spec.rb @@ -111,6 +111,20 @@ describe HashRedactor do result = subj.redact(data2, redact: subhash(redact, :email)) expect(result[:unspecified]).to eq('leave me alone') end + + it "iv should vary by instance" do + result = subj.redact(data, redact: subhash(redact, :address)) + data2 = { address: 'Somewhere over the rainbow' } + result2 = subj.redact(data2, redact: subhash(redact, :address)) + expect(result[:encrypted_address_iv]).not_to eq(result2[:encrypted_address_iv]) + end + + it "encrypted text should vary by instance" do + result = subj.redact(data, redact: subhash(redact, :address)) + data2 = { address: 'Somewhere over the rainbow' } + result2 = subj.redact(data2, redact: subhash(redact, :address)) + expect(result[:encrypted_address]).not_to eq(result2[:encrypted_address]) + end end describe "#decrypt" do
Test that IV get's changed on each instance
chrisjensen_hash_redactor
train
rb
581261d311133de77d48bd7378dac0de6c43b511
diff --git a/stored_messages/tests/settings.py b/stored_messages/tests/settings.py index <HASH>..<HASH> 100644 --- a/stored_messages/tests/settings.py +++ b/stored_messages/tests/settings.py @@ -41,6 +41,23 @@ MIDDLEWARE_CLASSES = ( 'django.middleware.security.SecurityMiddleware', ) +# Django 1.10 requires the TEMPLATES settings. Deprecated since Django 1.8 +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + SITE_ID = 1 MESSAGE_STORAGE = 'stored_messages.storage.PersistentStorage'
adding default TEMPLATES setting, required in Django <I> (tests)
evonove_django-stored-messages
train
py
871124c252b0209cff5bdc1cf3d2ac6f1dcff6dc
diff --git a/src/VR.js b/src/VR.js index <HASH>..<HASH> 100644 --- a/src/VR.js +++ b/src/VR.js @@ -676,6 +676,10 @@ function getGamepads(window) { } }; GlobalContext.getGamepads = getGamepads; +function clearGamepads() { + gamepads = null; +} +GlobalContext.clearGamepads = clearGamepads; module.exports = { VRDisplay, diff --git a/src/Window.js b/src/Window.js index <HASH>..<HASH> 100644 --- a/src/Window.js +++ b/src/Window.js @@ -1378,6 +1378,7 @@ const _normalizeUrl = utils._makeNormalizeUrl(options.baseUrl); }); vrPresentState.hmdType = hmdType; + GlobalContext.clearGamepads(); } }; const _onmakeswapchain = context => { @@ -1451,6 +1452,7 @@ const _normalizeUrl = utils._makeNormalizeUrl(options.baseUrl); }); vrPresentState.hmdType = null; + GlobalContext.clearGamepads(); } };
Clear gamepads on request/exit present
exokitxr_exokit
train
js,js
a128f5650bf33df08f92c5b82890076b163b9ec7
diff --git a/lib/alchemy/i18n.rb b/lib/alchemy/i18n.rb index <HASH>..<HASH> 100644 --- a/lib/alchemy/i18n.rb +++ b/lib/alchemy/i18n.rb @@ -29,7 +29,7 @@ module Alchemy # def self.t(msg, *args) options = args.extract_options! - options[:default] = options[:default] ? options[:default] : msg + options[:default] = options[:default] ? options[:default] : msg.to_s.humanize scope = ['alchemy'] case options[:scope].class.name when "Array"
Fixes translation of element and cell names
AlchemyCMS_alchemy_cms
train
rb
34a5adf0075168a0f46adef585bb28c38848e69f
diff --git a/src/jquery-ui-datepicker.js b/src/jquery-ui-datepicker.js index <HASH>..<HASH> 100644 --- a/src/jquery-ui-datepicker.js +++ b/src/jquery-ui-datepicker.js @@ -74,6 +74,7 @@ function init(Survey, $) { if (!!question.maxDate) { config.maxDate = question.maxDate; } + config.disabled = question.isReadOnly; if (config.onSelect === undefined) { config.onSelect = function (dateText) { isSelecting = true;
datepicker is not disabled if question is read-only #<I>
surveyjs_widgets
train
js
753784258bd7768d9047eb27b5425071d69453d7
diff --git a/cumulusci/tasks/bulkdata/generate_from_yaml.py b/cumulusci/tasks/bulkdata/generate_from_yaml.py index <HASH>..<HASH> 100644 --- a/cumulusci/tasks/bulkdata/generate_from_yaml.py +++ b/cumulusci/tasks/bulkdata/generate_from_yaml.py @@ -67,6 +67,7 @@ class GenerateDataFromYaml(BaseGenerateDataTask): self.generate_mapping_file = os.path.abspath(self.generate_mapping_file) num_records = self.options.get("num_records") if num_records is not None: + num_records = int(num_records) num_records_tablename = self.options.get("num_records_tablename") if not num_records_tablename:
Convert num_records to a number if provided as str
SFDO-Tooling_CumulusCI
train
py
795c89aa165ddd92a3e33388aaa00bf696bb7d60
diff --git a/client/state/site-settings/actions.js b/client/state/site-settings/actions.js index <HASH>..<HASH> 100644 --- a/client/state/site-settings/actions.js +++ b/client/state/site-settings/actions.js @@ -14,7 +14,6 @@ import { } from 'calypso/state/action-types'; import { normalizeSettings } from './utils'; -import 'calypso/state/data-layer/wpcom/sites/homepage'; import 'calypso/state/site-settings/init'; import 'calypso/state/ui/init'; diff --git a/client/state/sites/actions.js b/client/state/sites/actions.js index <HASH>..<HASH> 100644 --- a/client/state/sites/actions.js +++ b/client/state/sites/actions.js @@ -29,6 +29,8 @@ import { } from 'calypso/state/action-types'; import { SITE_REQUEST_FIELDS, SITE_REQUEST_OPTIONS } from 'calypso/state/sites/constants'; +import 'calypso/state/data-layer/wpcom/sites/homepage'; + /** * Returns an action object to be used in signalling that a site has been * deleted.
Data Layer: Move the home settings import to sites (#<I>) Move the site's homepage settings data layer import from `site-settings` to `sites`.
Automattic_wp-calypso
train
js,js
a04f2e47f89b84072c39c024d3fecbe7e57d5e4c
diff --git a/pepper8/pepper8.py b/pepper8/pepper8.py index <HASH>..<HASH> 100644 --- a/pepper8/pepper8.py +++ b/pepper8/pepper8.py @@ -11,9 +11,9 @@ from generator import HtmlGenerator from parser import Parser -def main(args=None): +def main(arguments=None): - args = args or argv + args = arguments or argv fileparser = None argparser = argparse.ArgumentParser( @@ -42,7 +42,7 @@ def main(args=None): ) # Fetch the provided arguments from sys.argv - args = argparser.parse_args(args) + args = argparser.parse_args() if args.filename: try: @@ -56,7 +56,7 @@ def main(args=None): else: # We need to check if stdin is piped or read from file, since we dont want # stdin to hang at terminal input - mode = fstat(stdin.fileno()).st_mode + mode = fstat(0).st_mode if S_ISFIFO(mode) or S_ISREG(mode): fileparser = Parser(stdin)
Revert some changes with unwanted side-effects
myth_pepper8
train
py
b2923d41fd05e6cffe8b01c4b7516f40ffc21a42
diff --git a/tests/test_sqlview.py b/tests/test_sqlview.py index <HASH>..<HASH> 100644 --- a/tests/test_sqlview.py +++ b/tests/test_sqlview.py @@ -62,18 +62,7 @@ name,code,attr\n assert isinstance(row, dict) assert row == expected[index] - -def test_get_sqlview_criteria(api, sql_view_view): - with pytest.raises(exceptions.ClientException): - for _ in api.get_sqlview(SQL_VIEW, True, criteria="code:name"): - continue - - -def test_get_sqlview_criteria_none(api, sql_view_view): - for _ in api.get_sqlview(SQL_VIEW, True): - continue - - + @responses.activate def test_get_sqlview_variable_query(api, sql_view_query):
Remove sql view e2e test ... as it can let the build fail due to people modifying the play servers
davidhuser_dhis2.py
train
py
47fab42883733c883f012b6eaef6fb6ed0c2069e
diff --git a/desktop/npm-helper.js b/desktop/npm-helper.js index <HASH>..<HASH> 100644 --- a/desktop/npm-helper.js +++ b/desktop/npm-helper.js @@ -134,7 +134,7 @@ const commands = { env: {HOT: 'true', USING_DLL: 'true'}, nodeEnv: 'development', nodePathDesktop: true, - shell: `webpack-dashboard -- ${nodeCmd} server.js`, + shell: process.env['NO_DASHBOARD'] ? `${nodeCmd} server.js` : `webpack-dashboard -- ${nodeCmd} server.js`, help: 'Start the webpack hot reloading code server (needed by npm run start-hot)', }, 'inject-sourcemaps-prod': {
Add flag to disable webpack-dashboard
keybase_client
train
js
0eb358784d31560f583b9d25ebe1378e22a6c564
diff --git a/lib/viiite/bdb/cached.rb b/lib/viiite/bdb/cached.rb index <HASH>..<HASH> 100644 --- a/lib/viiite/bdb/cached.rb +++ b/lib/viiite/bdb/cached.rb @@ -1,14 +1,13 @@ module Viiite class BDB - class Cached < Delegator + class Cached < SimpleDelegator include Utils - attr_reader :__getobj__ attr_reader :cache_folder attr_reader :cache_mode def initialize(delegate, cache_folder, cache_mode = "w") - @__getobj__ = delegate + super delegate @cache_folder = cache_folder @cache_mode = cache_mode end @@ -18,7 +17,7 @@ module Viiite end def benchmark(name) - bench = __getobj__.benchmark(name) + bench = super(name) cache = cache_file(name) Proxy.new(bench, cache, cache_mode) end
Here comes super delegate ! * SimpleDelegator is, well, simpler than Delegator * We are inheriting, so super is nice
blambeau_viiite
train
rb
b09f3286a1f6caa874cc2e5367f8b1f5aa9cb9b9
diff --git a/lib/fileUtils.js b/lib/fileUtils.js index <HASH>..<HASH> 100644 --- a/lib/fileUtils.js +++ b/lib/fileUtils.js @@ -51,7 +51,13 @@ fileUtils.mkpath = function mkpath(dir, permissions, cb) { var parentDir = path.normalize(dir + "/.."); if (parentDir !== '/' && parentDir !== '') { fileUtils.mkpath(parentDir, permissions, error.passToFunction(cb, function () { - fs.mkdir(dir, permissions, cb); + fs.mkdir(dir, permissions, function (err) { + if (!err || err.errno === process.EEXIST) { + // Success! + return cb(); + } + cb(err); + }); })); return; }
fileUtils.mkpath: Attempt to fix async race condition.
assetgraph_assetgraph
train
js
de67c88b92719746b0a3ca09008010562bf325df
diff --git a/lib/activation.php b/lib/activation.php index <HASH>..<HASH> 100644 --- a/lib/activation.php +++ b/lib/activation.php @@ -15,7 +15,7 @@ function roots_theme_activation_options_init() { } add_action('admin_init', 'roots_theme_activation_options_init'); -function roots_activation_options_page_capability($capability) { +function roots_activation_options_page_capability() { return 'edit_theme_options'; } add_filter('option_page_capability_roots_activation_options', 'roots_activation_options_page_capability'); @@ -24,7 +24,7 @@ function roots_theme_activation_options_add_page() { $roots_activation_options = roots_get_theme_activation_options(); if (!$roots_activation_options) { - $theme_page = add_theme_page( + add_theme_page( __('Theme Activation', 'roots'), __('Theme Activation', 'roots'), 'edit_theme_options', @@ -141,7 +141,7 @@ function roots_theme_activation_action() { 'post_type' => 'page' ); - $result = wp_insert_post($add_default_pages); + wp_insert_post($add_default_pages); } $home = get_page_by_title(__('Home', 'roots'));
Removing dead variables in activation
roots_sage
train
php
05ec9fa64395e67c054451cab1c0b1a8f70ea7f1
diff --git a/ph-commons/src/main/java/com/helger/commons/io/watchdir/WatchDir.java b/ph-commons/src/main/java/com/helger/commons/io/watchdir/WatchDir.java index <HASH>..<HASH> 100644 --- a/ph-commons/src/main/java/com/helger/commons/io/watchdir/WatchDir.java +++ b/ph-commons/src/main/java/com/helger/commons/io/watchdir/WatchDir.java @@ -366,9 +366,24 @@ public class WatchDir implements AutoCloseable */ public void runAsync () { + runAsyncAndReturn (); + } + + /** + * Call this method to process events. This method creates a background thread + * than runs {@link #processEvents()} and performs the heavy lifting. + * + * @return The created {@link Thread} that can also be stopped again if not + * needed anymore. + * @since 10.1.5 + */ + @Nonnull + public Thread runAsyncAndReturn () + { final Thread aThread = new Thread (this::processEvents, "WatchDir-" + m_aStartDir + "-" + ThreadLocalRandom.current ().nextInt ()); aThread.setDaemon (true); aThread.start (); + return aThread; } /**
Added runAsyncAndReturn
phax_ph-commons
train
java
75a4ad39cf43a0fb79bd718ecc6f40ef39c30c87
diff --git a/plugins/fontsize/trumbowyg.fontsize.js b/plugins/fontsize/trumbowyg.fontsize.js index <HASH>..<HASH> 100644 --- a/plugins/fontsize/trumbowyg.fontsize.js +++ b/plugins/fontsize/trumbowyg.fontsize.js @@ -86,24 +86,18 @@ value: '48px' } }, - // callback function (values) { - console.log("Got value back", values); - //trumbowyg.execCmd('fontSize', values.size, true); - var text = trumbowyg.range.startContainer.parentElement var selectedText = trumbowyg.getRangeText(); if($(text).html() == selectedText) { $(text).css('font-size', values.size); } else { - console.log("Creating new span for selected text"); trumbowyg.range.deleteContents(); var html = '<span style="font-size: ' + values.size + ';">' + selectedText + '</span>'; var node = $(html)[0]; trumbowyg.range.insertNode(node); } trumbowyg.saveRange(); - console.log(text, trumbowyg); return true; } );
Removed console.logs and comments
Alex-D_Trumbowyg
train
js
132268d4d6a1422fe9659561047fdb8718c2cb60
diff --git a/bin/php-cs-fixer-config.php b/bin/php-cs-fixer-config.php index <HASH>..<HASH> 100644 --- a/bin/php-cs-fixer-config.php +++ b/bin/php-cs-fixer-config.php @@ -57,6 +57,7 @@ return 'single_blank_line_before_namespace', 'single_quotes', 'standardize_not_equal', + 'ternary_spaces', 'short_array_syntax', 'unused_use', @@ -64,6 +65,7 @@ return 'elseif', 'eof_ending', 'function_call_space', + //'function_declaration', 'indentation', 'line_after_namespace',
Added 'ternary_spaces'
sabre-io_cs
train
php
bc02c15fd1f0e003fa512d89662c7cdff2d71359
diff --git a/cli/container.go b/cli/container.go index <HASH>..<HASH> 100644 --- a/cli/container.go +++ b/cli/container.go @@ -145,11 +145,14 @@ func createContainer(options runvOptions, vm *hypervisor.Vm, container, bundle, } func deleteContainer(vm *hypervisor.Vm, root, container string, force bool, spec *specs.Spec, state *State) error { - - // todo: check the container from vm.ContainerList() - // non-force killing can only be performed when at least one of the realProcess and shimProcess exited - exitedVM := vm.SignalProcess(container, "init", syscall.Signal(0)) != nil // todo: is this check reliable? + exitedVM := true + for _, c := range vm.ContainerList() { + if c == container { + exitedVM = vm.SignalProcess(container, "init", syscall.Signal(0)) != nil // todo: is this check reliable? + break + } + } exitedHost := !containerShimAlive(state) if !exitedVM && !exitedHost && !force { // don't perform deleting
check container from vm.ContainerList in delete
hyperhq_runv
train
go
9764c40735d9e7c61d6577e81780e214116a2f66
diff --git a/tests/lib/cli/FlagTest.php b/tests/lib/cli/FlagTest.php index <HASH>..<HASH> 100644 --- a/tests/lib/cli/FlagTest.php +++ b/tests/lib/cli/FlagTest.php @@ -90,8 +90,9 @@ class FlagTest extends PHPUnit_Framework_TestCase public function testToString() { $this->object = new Flag('-f', 'Flag'); - $this->assertEquals('-f'."t"."t"."t"."t".'Flag'.PHP_EOL, strval($this->object)); - $this->assertNotEquals('', strval($this->object)); + $this->assertContains('-f', strval($this->object)); + $this->assertContains('Flag', strval($this->object)); + $this->assertStringEndsWith(PHP_EOL, strval($this->object)); } } ?>
Fix flag string form test Output formatting now depends on the environment and not a fixed number of tabs. Consequently we only test to assure that the values are actually present and will correspond to a line in the console.
wsdl2phpgenerator_wsdl2phpgenerator
train
php
d2785fae74533d69e430ae0bd893297d45263301
diff --git a/wepay.php b/wepay.php index <HASH>..<HASH> 100755 --- a/wepay.php +++ b/wepay.php @@ -116,7 +116,7 @@ class WePay { $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, 'WePay v2 PHP SDK v' . self::VERSION); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_TIMEOUT, 5); // 5-second timeout, adjust to taste + curl_setopt($ch, CURLOPT_TIMEOUT, 30); // 30-second timeout, adjust to taste curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_URL, $uri); curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
increase CURLOPT_TIMEOUT to <I> seconds so that CC tokenization /checkout/create calls have time to do synchronous credit card authorization
wepay_PHP-SDK
train
php
26d982ae54f11348e1ef14ae5506709ff17f6ab7
diff --git a/src/java/com/threerings/presents/data/PermissionPolicy.java b/src/java/com/threerings/presents/data/PermissionPolicy.java index <HASH>..<HASH> 100644 --- a/src/java/com/threerings/presents/data/PermissionPolicy.java +++ b/src/java/com/threerings/presents/data/PermissionPolicy.java @@ -35,6 +35,10 @@ public class PermissionPolicy * Returns null if the specified client has the specified permission, an error code explaining * the lack of access if they do not. {@link InvocationCodes#ACCESS_DENIED} should be returned * if no more specific explanation is available. + * + * @param clobj the client + * @param perm what permission they'd like to know if they have + * @param context potential context for the request, if that matters */ public String checkAccess (ClientObject clobj, Permission perm, Object context) {
Document those so eclipse with strict docbook warnings doesn't get cranky that they're never used. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1
threerings_narya
train
java
d504d130ca5119e2d22abf79e3a87e9a47255aed
diff --git a/src/collectors/memory/memory.py b/src/collectors/memory/memory.py index <HASH>..<HASH> 100644 --- a/src/collectors/memory/memory.py +++ b/src/collectors/memory/memory.py @@ -103,8 +103,14 @@ class MemoryCollector(diamond.collector.Collector): self.log.error('No memory metrics retrieved') return None - phymem_usage = psutil.phymem_usage() - virtmem_usage = psutil.virtmem_usage() + # psutil.phymem_usage() and psutil.virtmem_usage() are deprecated. + if hasattr(psutil, "phymem_usage"): + phymem_usage = psutil.phymem_usage() + virtmem_usage = psutil.virtmem_usage() + else: + phymem_usage = psutil.virtual_memory() + virtmem_usage = psutil.swap_memory() + units = 'B' for unit in self.config['byte_unit']:
Use psutil.virtual_memory() and psutil.swap_memory() to monitor the actual system memory usage psutil.phymem_usage() and psutil.virtmem_usage() are deprecated. Instead we now have psutil.virtual_memory() and psutil.swap_memory(), which should provide all the necessary pieces to monitor the actual system memory usage, both physical and swap/disk related.
python-diamond_Diamond
train
py
4f6113ab68bf3f02fab19994e385f28680de68c7
diff --git a/lib/devise/controllers/helpers.rb b/lib/devise/controllers/helpers.rb index <HASH>..<HASH> 100644 --- a/lib/devise/controllers/helpers.rb +++ b/lib/devise/controllers/helpers.rb @@ -96,13 +96,13 @@ module Devise # # map.user_root '/users', :controller => 'users' # creates user_root_path # - # map.resources :users do |users| - # users.root # creates user_root_path + # map.namespace :user do |user| + # user.root :controller => 'users' # creates user_root_path # end # # - # If none of these are defined, root_path is used. However, if this default - # is not enough, you can customize it, for example: + # If the resource root path is not defined, root_path is used. However, + # if this default is not enough, you can customize it, for example: # # def after_sign_in_path_for(resource) # if resource.is_a?(User) && resource.can_publish?
Fix docs about after_sign_in_path_for and routes
plataformatec_devise
train
rb
f51d27f0b3d69a993b42dcf7f34b9a6f478a5c5d
diff --git a/flask_googlelogin.py b/flask_googlelogin.py index <HASH>..<HASH> 100644 --- a/flask_googlelogin.py +++ b/flask_googlelogin.py @@ -72,16 +72,17 @@ class GoogleLogin(object): # TODO: Proper exception handling return - return userinfo + return userinfo, credentials def oauth2callback(self, view_func): """Decorator for OAuth2 callback. Calls `GoogleLogin.login` then passes results to `view_func`.""" @wraps(view_func) def decorated(*args, **kwargs): - userinfo = self.login() + userinfo, credentials = self.login() if userinfo: kwargs.setdefault('userinfo', userinfo) + kwargs.setdefault('credentials', credentials) return view_func(*args, **kwargs) else: return self.login_manager.unauthorized()
Include credentials in oauth2callback kwargs
insynchq_flask-googlelogin
train
py
ddb4d64165fb6fecbb85dcbcf6640583a95005c4
diff --git a/sonar-batch/src/main/java/org/sonar/batch/DefaultProfileLoader.java b/sonar-batch/src/main/java/org/sonar/batch/DefaultProfileLoader.java index <HASH>..<HASH> 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/DefaultProfileLoader.java +++ b/sonar-batch/src/main/java/org/sonar/batch/DefaultProfileLoader.java @@ -65,6 +65,9 @@ public class DefaultProfileLoader implements ProfileLoader { for (Language language : languages.all()) { String languageKey = language.getKey(); + if (settings.hasKey("sonar.profile")) { + throw new SonarException("Property sonar.profile should not be used in a multi-language project"); + } String profileName = settings.getString("sonar.profile." + languageKey); RulesProfile profile = dao.getProfile(languageKey, profileName);
SONAR-<I> Fail when sonar.profile is used in a multi-language project
SonarSource_sonarqube
train
java
815c48cc9e31c3d4edcf67fb22063a853b8a58ce
diff --git a/mousedb/data/api.py b/mousedb/data/api.py index <HASH>..<HASH> 100644 --- a/mousedb/data/api.py +++ b/mousedb/data/api.py @@ -238,6 +238,7 @@ The response (in either JSON or XML) provides the following fields for each obje from tastypie.resources import ModelResource from tastypie.authentication import ApiKeyAuthentication from tastypie import fields +from tastypie.constants import ALL, ALL_WITH_RELATIONS from mousedb.data.models import Measurement, Assay, Experiment, Study @@ -260,7 +261,10 @@ class MeasurementResource(ModelResource): detail_allowed_methods = ['get'] include_resource_uri = False authentication = ApiKeyAuthentication() - + filtering = {"assay":ALL_WITH_RELATIONS, + "animal":ALL_WITH_RELATIONS} + + class AssayResource(ModelResource): '''This generates the API resource for :class:`~mousedb.data.models.Assay` objects.
Added filtering to data API. Part of issue #3
davebridges_mousedb
train
py
0ab275eb357d2ec75f3eec9fae185b810312a096
diff --git a/spec/cases/graph_api_spec.rb b/spec/cases/graph_api_spec.rb index <HASH>..<HASH> 100644 --- a/spec/cases/graph_api_spec.rb +++ b/spec/cases/graph_api_spec.rb @@ -60,10 +60,6 @@ describe 'Koala::Facebook::GraphAPIMethods' do end describe "the appsecret_proof argument" do - after do - Koala.instance_variable_set(:@config, nil) - end - let(:path) { 'path' } it "should be passed to #api if a value is provided" do diff --git a/spec/support/koala_test.rb b/spec/support/koala_test.rb index <HASH>..<HASH> 100644 --- a/spec/support/koala_test.rb +++ b/spec/support/koala_test.rb @@ -60,11 +60,7 @@ module KoalaTest config.after :each do # Clean up Koala config - Koala.configure do |config| - Koala::HTTPService::DEFAULT_SERVERS.each_pair do |k, v| - config.send("#{k}=", v) - end - end + Koala.instance_variable_set(:@config, nil) # if we're working with a real user, clean up any objects posted to Facebook # no need to do so for test users, since they get deleted at the end
Clean up full config after each testcase
arsduo_koala
train
rb,rb
f83fb5843473df49c7fb3cf1cd28502ad6d9800f
diff --git a/node_modules/generator-xtc/app/index.js b/node_modules/generator-xtc/app/index.js index <HASH>..<HASH> 100644 --- a/node_modules/generator-xtc/app/index.js +++ b/node_modules/generator-xtc/app/index.js @@ -326,6 +326,7 @@ XtcGenerator.prototype.copyFiles = function copyFiles() { // Helpers this.mkdir(projectPath('lib')); + this.copy('lib/helpers.js', projectPath('lib/helpers.js')); this.copy('lib/handlebars-helpers.js', projectPath('lib/handlebars-helpers.js')); }
Need to create local helpers.js file in project.
MarcDiethelm_xtc
train
js
9584e81f9057eb176968290de73deb66a98aa6db
diff --git a/pylti/flask.py b/pylti/flask.py index <HASH>..<HASH> 100644 --- a/pylti/flask.py +++ b/pylti/flask.py @@ -85,7 +85,7 @@ class LTI(object): def _verify_any(self): """ - Verify is request is in session or initial request + Verify that request is in session or initial request :raises: LTIException """ @@ -97,7 +97,7 @@ class LTI(object): def _verify_session(self): """ - Verify is session was already created + Verify that session was already created :raises: LTIException """ @@ -125,7 +125,7 @@ class LTI(object): def message_identifier_id(self): """ - Message identifier to use to XML callback + Message identifier to use for XML callback :return: non-empty string """ @@ -134,7 +134,7 @@ class LTI(object): @property def lis_result_sourcedid(self): """ - lis_result_sourcedid to use to XML callback + lis_result_sourcedid to use for XML callback :return: LTI lis_result_sourcedid """ @@ -169,7 +169,7 @@ class LTI(object): def _check_role(self): """ - Check is user is in role specified as wrapper attribute + Check that user is in role specified as wrapper attribute :exception: LTIException if user is not in roles """
removed contents.rst, moved its toc to index.rst. Removed multiple additional files that we don't use. Moved the license.rst file to the docs directory.
mitodl_pylti
train
py
71ec6e398122b6bd5ea271d44c46b99564a34d5b
diff --git a/tests/Whoops/RunTest.php b/tests/Whoops/RunTest.php index <HASH>..<HASH> 100755 --- a/tests/Whoops/RunTest.php +++ b/tests/Whoops/RunTest.php @@ -79,6 +79,26 @@ class RunTest extends TestCase } /** + * @expectedException InvalidArgumentException + * @covers Whoops\Run::pushHandler + */ + public function testPushInvalidHandler() + { + $run = $this->getRunInstance(); + $run->pushHandler($banana = 'actually turnip'); + } + + /** + * @covers Whoops\Run::pushHandler + */ + public function testPushClosureBecomesHandler() + { + $run = $this->getRunInstance(); + $run->pushHandler(function() {}); + $this->assertInstanceOf('Whoops\\Handler\\CallbackHandler', $run->popHandler()); + } + + /** * @covers Whoops\Run::popHandler * @covers Whoops\Run::getHandlers */
Improve Whoops\Run test coverage
filp_whoops
train
php
446acdcdb56220f326cf372c8aff39e7c2b117b6
diff --git a/commands/http/parse.go b/commands/http/parse.go index <HASH>..<HASH> 100644 --- a/commands/http/parse.go +++ b/commands/http/parse.go @@ -1,6 +1,7 @@ package http import ( + "errors" "net/http" "strings" @@ -9,7 +10,11 @@ import ( // Parse parses the data in a http.Request and returns a command Request object func Parse(r *http.Request, root *cmds.Command) (cmds.Request, error) { - path := strings.Split(r.URL.Path, "/")[3:] + if !strings.HasPrefix(r.URL.Path, ApiPath) { + return nil, errors.New("Unexpected path prefix") + } + path := strings.Split(strings.TrimPrefix(r.URL.Path, ApiPath+"/"), "/") + stringArgs := make([]string, 0) cmd, err := root.Get(path[:len(path)-1])
commands/http: Ensure request URLs start with expected prefix
ipfs_go-ipfs
train
go
0688176886684b11282cfff1fce89b4e7428ad8b
diff --git a/lib/Auth/Basic.php b/lib/Auth/Basic.php index <HASH>..<HASH> 100644 --- a/lib/Auth/Basic.php +++ b/lib/Auth/Basic.php @@ -318,13 +318,16 @@ class Auth_Basic extends AbstractController { } elseif (strlen($hash)==40) { $this->password_encryption='sha1'; } else { - $this->debug('Unable to identify password hash'); + $this->password_encryption=false; + $this->debug('Unable to identify password hash type, using plain-text matching'); + /* $this->password_encryption='php'; $data->unload(); if (!$password_existed) { $data->getElement($this->password_field)->destroy(); } return false; + */ } // Convert password hash
improve compatibility in new Auth implementation
atk4_atk4
train
php
3bbf672936533d564542e2bb28c3e91a243b5096
diff --git a/src/Kunstmaan/MediaBundle/Helper/File/FileHandler.php b/src/Kunstmaan/MediaBundle/Helper/File/FileHandler.php index <HASH>..<HASH> 100644 --- a/src/Kunstmaan/MediaBundle/Helper/File/FileHandler.php +++ b/src/Kunstmaan/MediaBundle/Helper/File/FileHandler.php @@ -115,10 +115,19 @@ class FileHandler extends AbstractMediaHandler */ public function canHandle($object) { - if ($object instanceof File || - ($object instanceof Media && - (is_file($object->getContent()) || $object->getLocation() == 'local')) - ) { + if ($object instanceof File) { + return true; + } + + if (!$object instanceof Media) { + return false; + } + + if ($object->getLocation() === 'local') { + return true; + } + + if ($object->getContent() !== null && is_file($object->getContent())) { return true; }
[MediaBundle] avoid passing null to php method
Kunstmaan_KunstmaanBundlesCMS
train
php
516238cf7207f346e092993173762eba2ea47941
diff --git a/src/directives/ripple.js b/src/directives/ripple.js index <HASH>..<HASH> 100644 --- a/src/directives/ripple.js +++ b/src/directives/ripple.js @@ -43,8 +43,8 @@ function showRipple (evt, el, stopPropagation) { function shouldAbort ({mat, ios}) { return ( - (mat && __THEME__ === 'mat') || - (ios && __THEME__ === 'ios') + (mat && __THEME__ !== 'mat') || + (ios && __THEME__ !== 'ios') ) }
fix: Ripple shouldAbort
quasarframework_quasar
train
js
9ed54d2d46975436da8a656c8a3acf4510722133
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -47,7 +47,7 @@ function merge (dest, src, redefine) { Object.getOwnPropertyNames(src).forEach(function forEachOwnPropertyName (name) { if (!redefine && hasOwnProperty.call(dest, name)) { - // Skip desriptor + // Skip descriptor return }
Fix typo in code comment closes #6
component_merge-descriptors
train
js
40cbc26643242483b04d39f1261623162c934600
diff --git a/admin/config.php b/admin/config.php index <HASH>..<HASH> 100644 --- a/admin/config.php +++ b/admin/config.php @@ -109,6 +109,7 @@ print_simple_box_start('center'); echo '<form method="post" action="config.php" name="form">'; + echo '<center><input type="submit" value="'.get_string('savechanges').'" /></center>'; /// Cycle through each section of the configuration foreach ($configvars as $sectionname=>$section) {
Merged from MOODLE_<I>_STABLE.
moodle_moodle
train
php
8a35b37d6885a03fad4ec88a4595c31c5731ad58
diff --git a/components/select/select.gemini.js b/components/select/select.gemini.js index <HASH>..<HASH> 100644 --- a/components/select/select.gemini.js +++ b/components/select/select.gemini.js @@ -1,5 +1,7 @@ /* global gemini: false */ +const TOLERANCE_OVERRIDE_BECAUSE_OF_EDGE = 3.5; + gemini.suite('Select', () => { gemini.suite('Input based select', child => { child. @@ -33,6 +35,8 @@ gemini.suite('Select', () => { gemini.suite('Multi-value select with options descriptions', child => { child. setUrl('/select/multiple-select-with-a-description.html'). + //We often have a waird render artefact here + setTolerance(TOLERANCE_OVERRIDE_BECAUSE_OF_EDGE). setCaptureElements('[data-test=ring-popup]'). capture('selectPopup', (actions, find) => { actions.click(find('.ring-button'));
Increase tolerance for select popup test to (hopefully) get rid of flakiness
JetBrains_ring-ui
train
js
f10eb1bf9dd3466a14d0f6cd425985658eb88533
diff --git a/src/main/java/com/bladecoder/ink/runtime/StoryState.java b/src/main/java/com/bladecoder/ink/runtime/StoryState.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/bladecoder/ink/runtime/StoryState.java +++ b/src/main/java/com/bladecoder/ink/runtime/StoryState.java @@ -106,7 +106,7 @@ public class StoryState { } copy.callStack = new CallStack(callStack); - copy.originalCallstack = originalCallstack; + copy.originalCallstack = new CallStack(originalCallstack); copy.variablesState = new VariablesState(copy.callStack, story.getListDefinitions()); copy.variablesState.copyFrom(variablesState);
C# ref. commit: Better cloning of the original callstack
bladecoder_blade-ink
train
java
de4b774134ed671451a6b44c5d8628a227bf25c4
diff --git a/thefuck/rules/sudo.py b/thefuck/rules/sudo.py index <HASH>..<HASH> 100644 --- a/thefuck/rules/sudo.py +++ b/thefuck/rules/sudo.py @@ -3,7 +3,8 @@ patterns = ['permission denied', 'pkg: Insufficient privileges', 'you cannot perform this operation unless you are root', 'non-root users cannot', - 'Operation not permitted'] + 'Operation not permitted', + 'This command has to be run under the root user.'] def match(command, settings):
Added a string which could be thrown by Fedora's new dnf package manager.
nvbn_thefuck
train
py
ec0bf541b74b63dc29fcd96408c42c41402798d6
diff --git a/singularity/package/build.py b/singularity/package/build.py index <HASH>..<HASH> 100644 --- a/singularity/package/build.py +++ b/singularity/package/build.py @@ -27,8 +27,9 @@ SOFTWARE. from singularity.logger import bot +from .utils import calculate_folder_size + from singularity.utils import ( - calculate_folder_size, format_container_name, read_file, zip_up
modified: singularity/package/build.py
singularityhub_singularity-python
train
py
5d0313e4e002e4a555f4deebdbd698dffc85f3cd
diff --git a/tests/integration/adapters/pouch-basics-test.js b/tests/integration/adapters/pouch-basics-test.js index <HASH>..<HASH> 100644 --- a/tests/integration/adapters/pouch-basics-test.js +++ b/tests/integration/adapters/pouch-basics-test.js @@ -407,6 +407,25 @@ test('eventually consistency - deleted', function (assert) { .finally(done); }); +test('_init should work', function (assert) { + let db = this.db(); + + assert.ok(db.rel == undefined, "should start without schema"); + + let promises = []; + + let adapter = this.adapter(); + promises.push(adapter._init(this.store(), this.store().modelFor('taco-soup'))); + +//this tests _init synchronously by design, as re-entry and infitinite loop detection works this way + assert.ok(db.rel != undefined, "_init should set schema"); + assert.equal(this.adapter()._schema.length, 2, "should have set all relationships on the schema"); + + promises.push(adapter._init(this.store(), this.store().modelFor('taco-soup'))); + + return Ember.RSVP.all(promises); +}); + //TODO: only do this for async or dontsavehasmany? test('delete cascade null', function (assert) { assert.timeout(5000);
test re-entrant _init
pouchdb-community_ember-pouch
train
js
7e58506edb7641e80fe23c1aec45ae3f051a7cb7
diff --git a/NavigationReactNative/src/android/app/src/main/java/com/navigation/reactnative/NavigationStackView.java b/NavigationReactNative/src/android/app/src/main/java/com/navigation/reactnative/NavigationStackView.java index <HASH>..<HASH> 100644 --- a/NavigationReactNative/src/android/app/src/main/java/com/navigation/reactnative/NavigationStackView.java +++ b/NavigationReactNative/src/android/app/src/main/java/com/navigation/reactnative/NavigationStackView.java @@ -179,6 +179,12 @@ public class NavigationStackView extends ViewGroup { } @Override + protected void onAttachedToWindow() { + super.onAttachedToWindow(); + onAfterUpdateTransaction(); + } + + @Override public void onDetachedFromWindow() { if (keys.size() > 0) { Intent mainIntent = mainActivity.getIntent(); @@ -232,7 +238,6 @@ public class NavigationStackView extends ViewGroup { @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { - onAfterUpdateTransaction(); } static class SceneItem {
Started when attached to window Doesn't seem right to put in onLayout because that can be calleed multiple times?
grahammendick_navigation
train
java
c3a699ecc8a014d1a36c1a21c5468f55bec56ee3
diff --git a/lib/geocoder/stores/active_record.rb b/lib/geocoder/stores/active_record.rb index <HASH>..<HASH> 100644 --- a/lib/geocoder/stores/active_record.rb +++ b/lib/geocoder/stores/active_record.rb @@ -183,7 +183,7 @@ module Geocoder::Store ## # Generate the SELECT clause. # - def select_clause(columns, distance, bearing) + def select_clause(columns, distance, bearing = nil) if columns == :geo_only clause = "" else
Allow bearing to be omitted.
alexreisner_geocoder
train
rb
a29bd4a04d29f5cf5d0288961d0e515fff0d910c
diff --git a/DataFixtures/ORM/LoadProducerData.php b/DataFixtures/ORM/LoadProducerData.php index <HASH>..<HASH> 100755 --- a/DataFixtures/ORM/LoadProducerData.php +++ b/DataFixtures/ORM/LoadProducerData.php @@ -13,8 +13,8 @@ namespace WellCommerce\Bundle\ProducerBundle\DataFixtures\ORM; use Doctrine\Common\Persistence\ObjectManager; -use WellCommerce\Bundle\DoctrineBundle\DataFixtures\AbstractDataFixture; use WellCommerce\Bundle\CoreBundle\Helper\Sluggable; +use WellCommerce\Bundle\DoctrineBundle\DataFixtures\AbstractDataFixture; use WellCommerce\Bundle\ProducerBundle\Entity\Producer; /**
Insight fixes (cherry picked from commit <I>ad<I>b<I>bbccd<I>a9eaf2f<I>dab<I>e<I>a)
WellCommerce_WishlistBundle
train
php
8add30cfe406cc38d83318d187b62eea971015ae
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -31,9 +31,8 @@ multiKeyValue.SHIBA = { describe('file loading methods', function() { it('should load as a Buffer', function() { - fs.readFile('./test/files/basic_keyvalue.xlsx', 'utf8', function(err, file) { - assert.deepEqual(copytext(file), basicKeyValue); - }); + var file = fs.readFileSync('./test/files/basic_keyvalue.xlsx'); + assert.deepEqual(copytext(file), basicKeyValue); }); it('should open the file via path', function() {
Wasn't actually testing for Buffer (<I>)
rdmurphy_node-copytext
train
js
367db80cf6cae1bd488074d5a3967a7f0b162532
diff --git a/src/layer/vector/MultiPoly.js b/src/layer/vector/MultiPoly.js index <HASH>..<HASH> 100644 --- a/src/layer/vector/MultiPoly.js +++ b/src/layer/vector/MultiPoly.js @@ -10,10 +10,18 @@ for (var i = 0, len = latlngs.length; i < len; i++) { this.addLayer(new klass(latlngs[i], options)); } + }, + + setStyle: function(style) { + for (var i in this._layers) { + if (this._layers.hasOwnProperty(i) && this._layers[i].setStyle) { + this._layers[i].setStyle(style); + } + } } }); } L.MultiPolyline = createMulti(L.Polyline); L.MultiPolygon = createMulti(L.Polygon); -}()); \ No newline at end of file +}());
Added setStyle method for MultiPolyLine and MultiPolygon.
axyjo_leaflet-rails
train
js
092dcfa4183fd977a5b838ffe6d0f80c09125cc2
diff --git a/my/index.php b/my/index.php index <HASH>..<HASH> 100644 --- a/my/index.php +++ b/my/index.php @@ -18,7 +18,7 @@ print_header($mymoodlestr); notice_yesno(get_string('noguest', 'my').'<br /><br />'.get_string('liketologin'), - $wwwroot, $_SERVER['HTTP_REFERER']); + $wwwroot, $CFG->wwwroot); print_footer(); die(); }
In the case of my moodle we don't want to redirect to referrer on 'no', referrer will <I>% of the time be the my moodle page. Redirect to wwwroot instead
moodle_moodle
train
php
aa2878607a9d5b26dd0dc2309b70c04c5ed679ee
diff --git a/src/Helpers/functions.php b/src/Helpers/functions.php index <HASH>..<HASH> 100644 --- a/src/Helpers/functions.php +++ b/src/Helpers/functions.php @@ -1,20 +1,20 @@ <?php if (! function_exists('class_uses_trait')) { + /** + * @param $class + * @param $trait + * + * @return bool + */ function class_uses_trait($class, $trait) : bool { - $uses = class_uses($class); + $uses = array_flip(class_uses_recursive($class)); - if (! $uses) { - return false; + if (is_object($trait)) { + $trait = get_class($trait); } - $trait = is_object($trait) ? get_class($trait) : $trait; - - if (! in_array($trait, array_values($uses), true)) { - return false; - } - - return true; + return isset($uses[$trait]); } }
Optimize class_uses_trait method
sebastiaanluca_laravel-router
train
php
4c926493cf6a7f6825a891b0f377fcf6c2c9b1cb
diff --git a/core/java/com/google/census/MetricMap.java b/core/java/com/google/census/MetricMap.java index <HASH>..<HASH> 100644 --- a/core/java/com/google/census/MetricMap.java +++ b/core/java/com/google/census/MetricMap.java @@ -19,7 +19,7 @@ import java.util.Iterator; /** * A map from Census metric names to metric values. */ -public class MetricMap implements Iterable<Metric> { +public final class MetricMap implements Iterable<Metric> { /** * Constructs a {@link MetricMap} from the given metrics. */ @@ -114,7 +114,7 @@ public class MetricMap implements Iterable<Metric> { } // Provides an unmodifiable Iterator over this instance's metrics. - private class MetricMapIterator implements Iterator<Metric> { + private final class MetricMapIterator implements Iterator<Metric> { @Override public boolean hasNext() { return position < length; }
Makes MetricMap and its builder final. Fixes #<I>.
census-instrumentation_opencensus-java
train
java
4fd6bdeaf24b9478cf4d4bf9f8fd3f8c19ba78cf
diff --git a/salt/pillar/mysql.py b/salt/pillar/mysql.py index <HASH>..<HASH> 100644 --- a/salt/pillar/mysql.py +++ b/salt/pillar/mysql.py @@ -59,7 +59,6 @@ from contextlib import contextmanager import logging # Import Salt libs -import salt.utils from salt.pillar.sql_base import SqlBaseExtPillar # Set up logging @@ -129,16 +128,6 @@ class MySQLExtPillar(SqlBaseExtPillar): This function normalizes the config block into a set of queries we can use. The return is a list of consistently laid out dicts. ''' - # Handle legacy query specification - if 'mysql_query' in kwargs: - salt.utils.warn_until( - 'Boron', - 'The legacy mysql_query configuration parameter is deprecated.' - 'See the docs for the new style of configuration.' - 'This functionality will be removed in Salt Boron.' - ) - args.insert(0, kwargs.pop('mysql_query')) - return super(MySQLExtPillar, self).extract_queries(args, kwargs)
Removed deprecated pillar/mysql.py code
saltstack_salt
train
py
2f49e023969a1382b6162c199cb94485af3a2c02
diff --git a/src/stylelint-config-recommended/index.js b/src/stylelint-config-recommended/index.js index <HASH>..<HASH> 100644 --- a/src/stylelint-config-recommended/index.js +++ b/src/stylelint-config-recommended/index.js @@ -12,6 +12,5 @@ module.exports = { true, { "ignore": [ "consecutive-duplicates-with-different-values" ] }, ], - "declaration-block-no-ignored-properties" : true, }, }
Removed: ``declaration-block-no-ignored-properties`` has been removed from our ``stylelint`` preset because this rule is not reliable (and deprecated) Closes #<I>
phenomic_phenomic
train
js
78d04c1e75f4b6ca8a4f7ebb363edc47eec645f8
diff --git a/addon/components/file-dropzone/component.js b/addon/components/file-dropzone/component.js index <HASH>..<HASH> 100644 --- a/addon/components/file-dropzone/component.js +++ b/addon/components/file-dropzone/component.js @@ -1,12 +1,13 @@ import Ember from 'ember'; import layout from './template'; import DataTransfer from '../../system/data-transfer'; +import uuid from '../../system/uuid'; const { $, get, set, computed } = Ember; const { bind } = Ember.run; const { service } = Ember.inject; -const DATA_TRANSFER = Symbol(); +const DATA_TRANSFER = 'DATA_TRANSFER' + uuid.short(); let supported = (function () { return 'draggable' in document.createElement('span');
use uuid instead of symbol
adopted-ember-addons_ember-file-upload
train
js
4839c3c82aef2aff1961c229a7ab66e74a0e03a2
diff --git a/src/test/java/org/mapdb/StoreArchiveTest.java b/src/test/java/org/mapdb/StoreArchiveTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/mapdb/StoreArchiveTest.java +++ b/src/test/java/org/mapdb/StoreArchiveTest.java @@ -147,6 +147,7 @@ public class StoreArchiveTest { assertTrue(source.entrySet().containsAll(m.entrySet())); assertTrue(m.entrySet().containsAll(source.entrySet())); - + db.close(); + f.delete(); } } \ No newline at end of file
StoreArchiveTest: delete testing files
jankotek_mapdb
train
java
47556a441b052da48a29881b98ff76fefe7b6e76
diff --git a/test/integration/assets_test.js b/test/integration/assets_test.js index <HASH>..<HASH> 100644 --- a/test/integration/assets_test.js +++ b/test/integration/assets_test.js @@ -16,7 +16,7 @@ describe('Configuration assets:', function() { var testCWD = "test/integration/fixtures/assets_test"; afterEach(function() { - // return fs.remove(path.resolve(testResults)); + return fs.remove(path.resolve(testResults)); }); describe('with a styleguide default assets', function () {;
USXP-<I> added result clearing after test
Galeria-Kaufhof_stylegen
train
js
cd49148d80a3bae6c600b18ce11f8a6263ab9bad
diff --git a/lib/Pingpp/WxpubOAuth.php b/lib/Pingpp/WxpubOAuth.php index <HASH>..<HASH> 100644 --- a/lib/Pingpp/WxpubOAuth.php +++ b/lib/Pingpp/WxpubOAuth.php @@ -3,7 +3,8 @@ /** * 用于微信公众号OAuth2.0鉴权,用户授权后获取授权用户唯一标识openid - * WxpubOAuth中的方法都是可选的,开发者也可根据实际情况自行开发相关功能 + * WxpubOAuth中的方法都是可选的,开发者也可根据实际情况自行开发相关功能, + * 详细内容可参考http://mp.weixin.qq.com/wiki/17/c0f37d5704f0b64713d5d2c37b468d75.html */ class WxpubOAuth {
Add comment in WxpubOAuth
PingPlusPlus_pingpp-php
train
php
273d2cf52c53f7ae6630ae50336bdfa4a015c4e2
diff --git a/controller/RestTest.php b/controller/RestTest.php index <HASH>..<HASH> 100644 --- a/controller/RestTest.php +++ b/controller/RestTest.php @@ -109,11 +109,17 @@ class RestTest extends RestController */ private function getParameter(string $name, $default = null): ?string { - if (!isset($this->body)) { - $this->body = $this->getPsrRequest()->getParsedBody(); + $bodyParameters = $this->getPsrRequest()->getParsedBody(); + + if (is_array($bodyParameters) && isset($bodyParameters[$name])) { + return $bodyParameters[$name]; + } + + if (is_object($bodyParameters) && property_exists($bodyParameters, $name)) { + return $bodyParameters->$name; } - return $this->body[$name] ?? $default; + return $default; } /**
Update controller/RestTest.php
oat-sa_extension-tao-delivery-rdf
train
php
490426a1b7eaaf982b12b8a2228773bd3b3877e2
diff --git a/structr-core/src/main/java/org/structr/core/entity/LinkedListNode.java b/structr-core/src/main/java/org/structr/core/entity/LinkedListNode.java index <HASH>..<HASH> 100644 --- a/structr-core/src/main/java/org/structr/core/entity/LinkedListNode.java +++ b/structr-core/src/main/java/org/structr/core/entity/LinkedListNode.java @@ -37,7 +37,7 @@ import org.structr.core.property.StringProperty; * * @author Christian Morgner */ -public abstract class LinkedListNode extends AbstractNode { +public abstract class LinkedListNode extends ValidatedNode { // this is not used for the node itself but for the relationship(s) this node maintains public static final PropertyKey<String> keyProperty = new StringProperty("key");
inherit from new ValidatedNode class
structr_structr
train
java
78b8353d51ebb54195e68112076840be93a30704
diff --git a/salt/modules/match.py b/salt/modules/match.py index <HASH>..<HASH> 100644 --- a/salt/modules/match.py +++ b/salt/modules/match.py @@ -36,6 +36,15 @@ def compound(tgt, minion_id=None): .. code-block:: bash salt '*' match.compound 'L@cheese,foo and *' + + delimiter + Pillar Example: + + .. code-block:: yaml + '172.16.0.0/12': + - match: ipcidr + - nodeclass: internal + ''' opts = {'grains': __grains__} if minion_id is not None:
Document how to use ipcidr in pillar
saltstack_salt
train
py
04319b3c1c48f33200598a7729df56112619f56a
diff --git a/version.php b/version.php index <HASH>..<HASH> 100644 --- a/version.php +++ b/version.php @@ -7,7 +7,7 @@ $version = 2003082800; // The current version is a date (YYYYMMDDXX) -$release = "1.1 -"; // User-friendly version number +$release = "1.1"; // User-friendly version number ?>
Not quite ready, but anyone trying the Beta at this stage will probably not need to upgrade.
moodle_moodle
train
php