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 |
|---|---|---|---|---|---|
59576faf2f1da8d6b002767894195355cda49639 | diff --git a/core-bundle/contao/dca/tl_form_field.php b/core-bundle/contao/dca/tl_form_field.php
index <HASH>..<HASH> 100644
--- a/core-bundle/contao/dca/tl_form_field.php
+++ b/core-bundle/contao/dca/tl_form_field.php
@@ -205,7 +205,7 @@ $GLOBALS['TL_DCA']['tl_form_field'] = array
'exclude' => true,
'search' => true,
'inputType' => 'textarea',
- 'eval' => array('mandatory'=>true, 'allowHtml'=>true),
+ 'eval' => array('mandatory'=>true, 'allowHtml'=>true, 'class'=>'monospace', 'rte'=>'ace|html'),
'sql' => "text NULL"
),
'options' => array | [Core] Load the code editor when editing the HTML form field | contao_contao | train | php |
709d8fd568bca23f4341e68d751127d00b98f9aa | diff --git a/pyqode/core/modes/extended_selection.py b/pyqode/core/modes/extended_selection.py
index <HASH>..<HASH> 100644
--- a/pyqode/core/modes/extended_selection.py
+++ b/pyqode/core/modes/extended_selection.py
@@ -61,7 +61,7 @@ class ExtendedSelectionMode(Mode):
self.action_select_matched.setShortcutContext(
QtCore.Qt.WidgetShortcut)
- self.line_sel_shortcut = QtGui.QKeySequence('Ctrl+Shift+R')
+ self.line_sel_shortcut = QtGui.QKeySequence('Ctrl+Shift+L')
self.action_select_line = QtWidgets.QAction(self.editor)
self.action_select_line.setText('Select line')
self.action_select_line.setShortcut(self.line_sel_shortcut)
@@ -149,4 +149,4 @@ class ExtendedSelectionMode(Mode):
"""
Performs line selection (select the entire line).
"""
- TextHelper(self.editor).select_whole_line()
+ TextHelper(self.editor).select_whole_line()
\ No newline at end of file | Fix select line shortcut which conflict with find in files (in most apps) | pyQode_pyqode.core | train | py |
23fb11f8bc0aa9e4fa5c22973bbaf875dd99d442 | diff --git a/src/models/Link.php b/src/models/Link.php
index <HASH>..<HASH> 100644
--- a/src/models/Link.php
+++ b/src/models/Link.php
@@ -432,6 +432,11 @@ class Link extends ForeignFieldModel
protected function setSerializedData(array $data) {
parent::setSerializedData($data);
+ // This should not happen, but it was reported in #225
+ if (!isset($this->_field)) {
+ return;
+ }
+
$this->_linkType = $this->_field->getEnabledLinkTypes()->getByName(
ArrayHelper::get($data, '_linkType')
); | Do not trigger errors while deserializing link fields, see #<I> | sebastian-lenz_craft-linkfield | train | php |
00ed485cd4b41010606eed8989fd896f861e62dd | diff --git a/lib/har.js b/lib/har.js
index <HASH>..<HASH> 100644
--- a/lib/har.js
+++ b/lib/har.js
@@ -19,7 +19,7 @@ function create(pages) {
};
// fill the HAR template each page info
for (const [pageIndex, page] of pages.entries()) {
- const pageId = `page_${pageIndex + 1}`;
+ const pageId = `page_${pageIndex + 1}_${String(Math.random()).slice(2)}`;
const log = parsePage(String(pageId), page.info);
har.log.pages.push(log.page);
har.log.entries.push(...log.entries); | Make the 'pageref' field random so to make it easier to merge HARs
As requested in #<I>. | cyrus-and_chrome-har-capturer | train | js |
5df3a55d39c36452c201d2883fc8798d6caac13d | diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js b/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js
index <HASH>..<HASH> 100644
--- a/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js
+++ b/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js
@@ -152,7 +152,7 @@ var exports = {};
}
};
- displayErrorOnStatus = function (error) {
+ function displayErrorOnStatus(error) {
serviceRegistry.getService("orion.page.message").then(function(progressService){
if(error.status===401 || error.status===403) | Bug <I> - [client] UI should inform the user when checkout failed - displayError function shouldn't be global | eclipse_orion.client | train | js |
950573da83106c091ca1fde8e5017eec55d68aba | diff --git a/src/Compiler/Nodes/ClassNode.php b/src/Compiler/Nodes/ClassNode.php
index <HASH>..<HASH> 100644
--- a/src/Compiler/Nodes/ClassNode.php
+++ b/src/Compiler/Nodes/ClassNode.php
@@ -155,12 +155,13 @@ class ClassNode extends Node
$compiler->indented('{');
$compiler->indent();
- if ($this->getData('self_accessed') && $method !== 'displayTemplate') {
- $compiler->indented('$oldSelf = $context->__get("_self");');
+ if ($this->getData('self_accessed')) {
+ if ($method !== 'displayTemplate') {
+ $compiler->indented('$oldSelf = $context->__get("_self");');
+ }
+ $compiler->indented('$context->__set("_self", $this);');
}
- $compiler->indented('$context->__set("_self", $this);');
$compiler->compileNode($body);
-
if ($this->getData('self_accessed') && $method !== 'displayTemplate') {
$compiler->indented('$context->__set("_self", $oldSelf);');
} | Only set the _self variable if it is accessed. | bugadani_Minty | train | php |
393b2119a730cd6c2becf410e01caf4161f9aeeb | diff --git a/app/lightblue/oad.js b/app/lightblue/oad.js
index <HASH>..<HASH> 100644
--- a/app/lightblue/oad.js
+++ b/app/lightblue/oad.js
@@ -38,16 +38,16 @@ class FirmwareUpdater {
this._fwfiles = fs.readdirSync(FW_FILES).sort() // alphabetized
this._storedFwVersion = this._fwfiles[0].split('_')[0]
- this.resetState()
+ this.resetState(true)
}
- resetState() {
+ resetState(init=false) {
/**
* Reset or instantiate all FW state
* TODO: This state is for ONE device, eventually this class should be
* capable of updating many devices simultaneously
*/
- console.log('Resetting FW State')
+
this._deviceInProgress = null
this._completionCallback = null
this._fileOfferedIndex = -1
@@ -60,6 +60,12 @@ class FirmwareUpdater {
this._stateStep = null
this._nextBlock = 0
this._blockTransferStartTime = null;
+
+ if (!init) {
+ // We don't want to log anything from the constructor
+ console.log("OAD State Machine reset!")
+ }
+
}
_fail(err) { | oad: don't log from the constructor | PunchThrough_bean-sdk-node | train | js |
577f2822afb071d033c017b7b95a01785fb92184 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -28,7 +28,6 @@ setup(
'maltego_trx',
'maltego_trx/template_dir',
'maltego_trx/template_dir/transforms',
- 'maltego_trx/protocol'
],
package_data={
'maltego_trx/template_dir': [ | fix(setup.py): remove refactored path | paterva_maltego-trx | train | py |
10e62cef7ce80c8050ffdc938dcc9a12de094176 | diff --git a/python_modules/libraries/dagster-azure/dagster_azure/adls2/resources.py b/python_modules/libraries/dagster-azure/dagster_azure/adls2/resources.py
index <HASH>..<HASH> 100644
--- a/python_modules/libraries/dagster-azure/dagster_azure/adls2/resources.py
+++ b/python_modules/libraries/dagster-azure/dagster_azure/adls2/resources.py
@@ -37,7 +37,7 @@ def adls2_resource(context):
@solid(required_resource_keys={'adls2'})
def example_adls2_solid(context):
- return list(context.resources.adls2.list_file_systems())
+ return list(context.resources.adls2.adls2_client.list_file_systems())
result = execute_solid(
example_adls2_solid, | Fix for the example (access to ADL client) (#<I>)
There was a missing step in the provided example for being able to list the files on ADL. Maybe an example showing adls2_file_manage would be useful? | dagster-io_dagster | train | py |
d9bdc93a2ddfddfa671e58461c0201a1b2969efc | diff --git a/spec/unit/network/formats_spec.rb b/spec/unit/network/formats_spec.rb
index <HASH>..<HASH> 100755
--- a/spec/unit/network/formats_spec.rb
+++ b/spec/unit/network/formats_spec.rb
@@ -26,13 +26,11 @@ class PsonTest
end
describe "Puppet Network Format" do
- require 'msgpack'
-
- it "should include a msgpack format" do
+ it "should include a msgpack format", :if => Puppet.features.msgpack? do
Puppet::Network::FormatHandler.format(:msgpack).should_not be_nil
end
- describe "msgpack" do
+ describe "msgpack", :if => Puppet.features.msgpack? do
before do
@msgpack = Puppet::Network::FormatHandler.format(:msgpack)
end | (Maint) Only execute msgpack tests if it is present | puppetlabs_puppet | train | rb |
d86ace59cc0733b7f40510a5273cf181e422c7a8 | diff --git a/state/presence/presence.go b/state/presence/presence.go
index <HASH>..<HASH> 100644
--- a/state/presence/presence.go
+++ b/state/presence/presence.go
@@ -315,7 +315,7 @@ type pingInfo struct {
func (w *Watcher) findAllBeings() (map[int64]beingInfo, error) {
beings := make([]beingInfo, 0)
err := w.beings.Find(bson.D{{}}).All(&beings)
- if err != nil && err == mgo.ErrNotFound {
+ if err != nil {
return nil, err
}
beingInfos := make(map[int64]beingInfo, len(beings)) | Remove the check for ErrNotFound.
It makes sense in the single object case, but not in the many object case. | juju_juju | train | go |
e61172beb5b639e3ad399187a2f8cfa451f428ef | diff --git a/bcbio/ngsalign/tophat.py b/bcbio/ngsalign/tophat.py
index <HASH>..<HASH> 100644
--- a/bcbio/ngsalign/tophat.py
+++ b/bcbio/ngsalign/tophat.py
@@ -29,7 +29,7 @@ def _set_quality_flag(options, config):
qual_format = config["algorithm"].get("quality_format", None)
if qual_format.lower() == "illumina":
options["solexa1.3-quals"] = True
- else:
+ elif qual_format.lower() == "solexa":
options["solexa-quals"] = True
return options | Set quality flag properly for Tophat alignment. | bcbio_bcbio-nextgen | train | py |
28a29b36846176abba870dc5591bae2e43f7eea7 | diff --git a/models/tokenize/utils.py b/models/tokenize/utils.py
index <HASH>..<HASH> 100644
--- a/models/tokenize/utils.py
+++ b/models/tokenize/utils.py
@@ -103,7 +103,8 @@ def output_predictions(output_filename, trainer, data_generator, vocab, mwt_dict
pred = [np.concatenate(p, 0) for p in pred]
for j, p in enumerate(batchparas):
- all_preds[p[0]] = pred[j]
+ len1 = len([1 for x in raw[j] if x != '<PAD>'])
+ all_preds[p[0]] = pred[j][:len1]
all_raw[p[0]] = raw[j]
offset = 0 | Make things more watertight in tokenizer | stanfordnlp_stanza | train | py |
df4635a4ba6890fca7d86dbaf72f60a5c28a117d | diff --git a/src/Command/ThanksCommand.php b/src/Command/ThanksCommand.php
index <HASH>..<HASH> 100644
--- a/src/Command/ThanksCommand.php
+++ b/src/Command/ThanksCommand.php
@@ -39,6 +39,10 @@ class ThanksCommand extends BaseCommand
'name' => 'symfony/symfony',
'url' => 'https://github.com/symfony/symfony',
],
+ 'zendframework' => [
+ 'name' => 'zendframework/zendframework',
+ 'url' => 'https://github.com/zendframework/zendframework',
+ ],
];
protected function configure() | Add ZendFramework as project main repos | symfony_thanks | train | php |
d411380d12f3bc2475b43829f0d379dca0f022dc | diff --git a/bench.py b/bench.py
index <HASH>..<HASH> 100755
--- a/bench.py
+++ b/bench.py
@@ -117,15 +117,15 @@ def compress_reuse(chunks, opts):
@bench('discrete', 'multi_compress_to_buffer() w/ buffer input',
simple=True, threads_arg=True, chunks_as_buffer=True)
def compress_multi_compress_to_buffer_buffer(chunks, opts, threads):
- zctx= zstd.ZstdCompressor(**opts)
- zctx.multi_compress_to_buffer(chunks, threads=threads)
+ zctx= zstd.ZstdCompressor(threads=threads, **opts)
+ zctx.multi_compress_to_buffer(chunks)
@bench('discrete', 'multi_compress_to_buffer() w/ list input',
threads_arg=True)
def compress_multi_compress_to_buffer_list(chunks, opts, threads):
- zctx = zstd.ZstdCompressor(**opts)
- zctx.multi_compress_to_buffer(chunks, threads=threads)
+ zctx = zstd.ZstdCompressor(threads=threads, **opts)
+ zctx.multi_compress_to_buffer(chunks)
@bench('discrete', 'write_to()') | bench: fix calls to batch compress API | indygreg_python-zstandard | train | py |
19620a504277ce9ab81473c26415bec218b01fa3 | diff --git a/lib/bagit.php b/lib/bagit.php
index <HASH>..<HASH> 100644
--- a/lib/bagit.php
+++ b/lib/bagit.php
@@ -461,6 +461,44 @@ class BagIt
$method
);
}
+
+ /**
+ * This tests whether bagInfoData has a key.
+ *
+ * @param string $key The key to test for existence of.
+ *
+ * @return bool
+ * @author Eric Rochester <erochest@virginia.edu>
+ **/
+ public function hasBagInfoData($key)
+ {
+ }
+
+ /**
+ * This inserts a value into bagInfoData.
+ *
+ * @param string $key This is the key to insert into the data.
+ * @param string $value This is the value to associate with the key.
+ *
+ * @return void
+ * @author Eric Rochester <erochest@virginia.edu>
+ **/
+ public function setBagInfoData($key, $value)
+ {
+ }
+
+ /**
+ * This returns the value for a key from bagInfoData.
+ *
+ * @param string $key This is the key to get the value associated with.
+ *
+ * @return string|null
+ * @author Eric Rochester <erochest@virginia.edu>
+ **/
+ public function getBagInfoData($key)
+ {
+ }
+
//}}}
//{{{ Private Methods | Added stub methods for bagInfoData accessors. | scholarslab_BagItPHP | train | php |
10b98ce13a517756f832e5eac1244fa643d241e3 | diff --git a/src/RestGalleries/Auth/Auth.php b/src/RestGalleries/Auth/Auth.php
index <HASH>..<HASH> 100644
--- a/src/RestGalleries/Auth/Auth.php
+++ b/src/RestGalleries/Auth/Auth.php
@@ -111,7 +111,7 @@ abstract class Auth implements AuthAdapter
}
$this->removeCredentialPrefixes('oauth_');
-
+ var_dump($this->credentials);
$protocol = ucfirst($this->protocol);
$keys = call_user_func_array([$this, 'get' . $protocol . 'Keys'], [null]);
@@ -130,7 +130,6 @@ abstract class Auth implements AuthAdapter
*/
protected function removeCredentialPrefixes($prefix)
{
- var_dump($this->credentials);
$this->credentials = array_remove_key_prefix(
$this->credentials,
$prefix
@@ -147,7 +146,6 @@ abstract class Auth implements AuthAdapter
*/
protected function getAccountData($checkUrl)
{
- var_dump($this->credentials);
$http = $this->http;
$http = $http::init($checkUrl);
$http->setAuth($this->credentials); | Dump Auth::filterCredentials | estebanmatias92_RestGalleries | train | php |
855595fb43e38ddd2db50519451468ff5a4f6480 | diff --git a/synapse/glob.py b/synapse/glob.py
index <HASH>..<HASH> 100644
--- a/synapse/glob.py
+++ b/synapse/glob.py
@@ -7,3 +7,6 @@ plex = None
# A global Sched instance for maint routines
sched = None
+
+# A host info dictionary for "thishost" API
+hostinfo = None | added hostinfo to globs for thishost code | vertexproject_synapse | train | py |
aa402ac8745b32259c91457e00799d821f1efffb | diff --git a/tests/test_git.py b/tests/test_git.py
index <HASH>..<HASH> 100644
--- a/tests/test_git.py
+++ b/tests/test_git.py
@@ -16,12 +16,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-from contextlib import (closing, contextmanager)
+from contextlib import contextmanager
from os import path
-from shutil import rmtree
from subprocess import CalledProcessError
from tarfile import open as open_tar
-from tempfile import mkdtemp
+from tempfile import TemporaryDirectory
from expecter import expect
@@ -42,13 +41,10 @@ def tarball_data(tar_name):
:see: `tar_name`
"""
data_dir = path.join(path.dirname(__file__), 'data', 'git')
- with closing(open_tar(path.join(data_dir, tar_name + '.tar'))) as tar:
- try:
- temp_dir = mkdtemp()
+ with open_tar(path.join(data_dir, tar_name + '.tar'), 'r:') as tar:
+ with TemporaryDirectory() as temp_dir:
tar.extractall(temp_dir)
yield str(path.join(temp_dir, tar_name))
- finally:
- rmtree(temp_dir)
@requires_git | Use tempfile.TemporaryDirectory
Supported since <I>. | JNRowe_jnrbase | train | py |
75437c2132e4071ebe9a61d8c58ab432457559d7 | diff --git a/elevation/cli.py b/elevation/cli.py
index <HASH>..<HASH> 100644
--- a/elevation/cli.py
+++ b/elevation/cli.py
@@ -34,8 +34,7 @@ def eio():
@eio.command(short_help='Audits your installation for common issues.')
def selfcheck():
- util.selfcheck(tools=elevation.TOOLS)
- print('Your system is ready.')
+ print(util.selfcheck(tools=elevation.TOOLS))
product_options = util.composed(
diff --git a/elevation/util.py b/elevation/util.py
index <HASH>..<HASH> 100644
--- a/elevation/util.py
+++ b/elevation/util.py
@@ -29,11 +29,13 @@ LOCKFILE_NAME = '.folder_lock'
def selfcheck(tools):
+ msg = []
for tool_name, check_cli in collections.OrderedDict(tools).items():
try:
- subprocess.check_output(check_cli, shell=True)
+ subprocess.check_output(check_cli, shell=True, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError:
- raise RuntimeError('%r not found in PATH.' % tool_name)
+ msg.append('%r not found or not usable.' % tool_name)
+ return '\n'.join(msg) if msg else 'Your system is ready.'
def composed(*funcs): | Make eio selfcheck more user friendly (show message not traceback). | bopen_elevation | train | py,py |
1c7fc442a28d2f887e8f340c03d8d19c8f9da802 | diff --git a/kxg/quickstart.py b/kxg/quickstart.py
index <HASH>..<HASH> 100644
--- a/kxg/quickstart.py
+++ b/kxg/quickstart.py
@@ -170,6 +170,9 @@ class GameStage(Stage):
def on_enter_stage(self):
self.game.start_game()
+ for actor in self.game.actors:
+ actor.on_setup_gui(self.gui)
+
def on_update_stage(self, dt):
self.game.update_game(dt) | Call Actor.on_setup_gui() in GameStage. | kxgames_kxg | train | py |
7bb74b883c454b5f32ab695a51c9f8be2cbf699d | diff --git a/src/TelegramDriver.php b/src/TelegramDriver.php
index <HASH>..<HASH> 100644
--- a/src/TelegramDriver.php
+++ b/src/TelegramDriver.php
@@ -30,7 +30,6 @@ class TelegramDriver extends HttpDriver
protected $messages = [];
-
/**
* @param Request $request
*/ | Apply fixes from StyleCI (#<I>) | botman_driver-telegram | train | php |
8c43232f66c81184485f29593e52e54308ffba7f | diff --git a/chainregistry.go b/chainregistry.go
index <HASH>..<HASH> 100644
--- a/chainregistry.go
+++ b/chainregistry.go
@@ -58,6 +58,10 @@ const (
// expressed in sat/kw.
defaultBitcoinStaticFeePerKW = chainfee.SatPerKWeight(12500)
+ // defaultBitcoinStaticMinRelayFeeRate is the min relay fee used for
+ // static estimators.
+ defaultBitcoinStaticMinRelayFeeRate = chainfee.FeePerKwFloor
+
// defaultLitecoinStaticFeePerKW is the fee rate of 200 sat/vbyte
// expressed in sat/kw.
defaultLitecoinStaticFeePerKW = chainfee.SatPerKWeight(50000)
@@ -163,7 +167,8 @@ func newChainControlFromConfig(cfg *config, chanDB *channeldb.DB,
TimeLockDelta: cfg.Bitcoin.TimeLockDelta,
}
cc.feeEstimator = chainfee.NewStaticEstimator(
- defaultBitcoinStaticFeePerKW, 0,
+ defaultBitcoinStaticFeePerKW,
+ defaultBitcoinStaticMinRelayFeeRate,
)
case litecoinChain:
cc.routingPolicy = htlcswitch.ForwardingPolicy{ | chainregistry: set static min relay fee
We need it to be set in order to properly test the sweeper handling the
dust limit on regtest. | lightningnetwork_lnd | train | go |
54c9b11ae805409a079f9900604533b28550a995 | diff --git a/pkg/api/dtos/plugins.go b/pkg/api/dtos/plugins.go
index <HASH>..<HASH> 100644
--- a/pkg/api/dtos/plugins.go
+++ b/pkg/api/dtos/plugins.go
@@ -56,7 +56,7 @@ type ImportDashboardCommand struct {
PluginId string `json:"pluginId"`
Path string `json:"path"`
Overwrite bool `json:"overwrite"`
- Dashboard *simplejson.Json `json:"dashboard" binding:"Required"`
+ Dashboard *simplejson.Json `json:"dashboard"`
Inputs []plugins.ImportDashboardInput `json:"inputs"`
FolderId int64 `json:"folderId"`
}
diff --git a/pkg/api/plugins.go b/pkg/api/plugins.go
index <HASH>..<HASH> 100644
--- a/pkg/api/plugins.go
+++ b/pkg/api/plugins.go
@@ -179,6 +179,10 @@ func GetPluginMarkdown(c *m.ReqContext) Response {
}
func ImportDashboard(c *m.ReqContext, apiCmd dtos.ImportDashboardCommand) Response {
+ if apiCmd.PluginId == "" && apiCmd.Dashboard == nil {
+ return Error(422, "Dashboard must be set", nil)
+ }
+
cmd := plugins.ImportDashboardCommand{
OrgId: c.OrgId,
User: c.SignedInUser, | Fix importing plugin dashboards (#<I>)
#<I> introduced a bug regarding import of plugin dashboards.
This should fix this and add custom validation if not importing
plugin dashboard and dashboard property is missing.
Ref #<I> | grafana_grafana | train | go,go |
d5ffb7896bc357c37f789366b60109367b856337 | diff --git a/lang/en/question.php b/lang/en/question.php
index <HASH>..<HASH> 100644
--- a/lang/en/question.php
+++ b/lang/en/question.php
@@ -386,6 +386,7 @@ $string['showmaxmarkonly'] = 'Show max mark only';
$string['showquestiontext'] = 'Show question text in the question list';
$string['shown'] = 'Shown';
$string['shownumpartscorrect'] = 'Show the number of correct responses';
+$string['shownumpartscorrectwhenfinished'] = 'Show the number of correct responses once the question has finished';
$string['specificfeedback'] = 'Specific feedback';
$string['started'] = 'Started';
$string['state'] = 'State';
diff --git a/question/type/edit_question_form.php b/question/type/edit_question_form.php
index <HASH>..<HASH> 100644
--- a/question/type/edit_question_form.php
+++ b/question/type/edit_question_form.php
@@ -348,7 +348,7 @@ abstract class question_edit_form extends question_wizard_form {
if ($withshownumpartscorrect && $feedbackname == 'partiallycorrectfeedback') {
$mform->addElement('advcheckbox', 'shownumcorrect',
get_string('options', 'question'),
- get_string('shownumpartscorrect', 'question'));
+ get_string('shownumpartscorrectwhenfinished', 'question'));
}
}
} | MDL-<I> question editing: improve working for Show num correct
AMOS BEGIN
CPY [shownumpartscorrect,question],[shownumpartscorrectwhenfinished,question]
AMOS END | moodle_moodle | train | php,php |
1d25030a1f806cef8021bdb6eed50172bdb9c1f2 | diff --git a/lib/wunderlist/api.rb b/lib/wunderlist/api.rb
index <HASH>..<HASH> 100644
--- a/lib/wunderlist/api.rb
+++ b/lib/wunderlist/api.rb
@@ -198,7 +198,9 @@ module Wunderlist
def get_list_ids(list_names = [])
- return list_names if list_names.all? {|i| i.is_a?(Integer) }
+ if list_names.is_a? Array && list_names.all? {|i| i.is_a?(Integer) }
+ return list_names
+ end
return [list_names] if list_names.is_a? Integer
list_names = [list_names] if list_names.is_a? String | Fix to check list_name is Array | sh8_wunderlist-api | train | rb |
e84a97b83cf75c5b6e0349d87b21346951a05fff | diff --git a/my/index.php b/my/index.php
index <HASH>..<HASH> 100644
--- a/my/index.php
+++ b/my/index.php
@@ -66,13 +66,26 @@
// limits the number of courses showing up
$courses_limit = 21;
- if (!empty($CFG->mycoursesperpage)) {
+ if (isset($CFG->mycoursesperpage)) {
$courses_limit = $CFG->mycoursesperpage;
}
+
+ $morecourses = false;
+ if ($courses_limit > 0) {
+ $courses_limit = $courses_limit + 1;
+ }
+
$courses = get_my_courses($USER->id, 'visible DESC,sortorder ASC', '*', false, $courses_limit);
$site = get_site();
$course = $site; //just in case we need the old global $course hack
+ if (($courses_limit > 0) && (count($courses) >= $courses_limit)) {
+ //remove the 'marker' course that we retrieve just to see if we have more than $courses_limit
+ array_pop($courses);
+ $morecourses = true;
+ }
+
+
if (array_key_exists($site->id,$courses)) {
unset($courses[$site->id]);
}
@@ -92,7 +105,7 @@
}
// if more than 20 courses
- if (count($courses) > 20) {
+ if ($morecourses) {
echo '<br />...';
} | My Moodle: MDL-<I> Course limit for My Moodle not propperly obeyed. Fixing so that it obeys mycoursesperpage and propperly displays '...' | moodle_moodle | train | php |
0d4bf54b1371631b8e88bbe6350d83a9da7ca737 | diff --git a/jawn-core/src/main/java/net/javapla/jawn/core/Crypto.java b/jawn-core/src/main/java/net/javapla/jawn/core/Crypto.java
index <HASH>..<HASH> 100644
--- a/jawn-core/src/main/java/net/javapla/jawn/core/Crypto.java
+++ b/jawn-core/src/main/java/net/javapla/jawn/core/Crypto.java
@@ -57,7 +57,7 @@ public interface Crypto {
RND = r;
}
- private static final int DEFAULT_SIZE = 32;
+ public static final int DEFAULT_SIZE = 32;
public static byte[] generate() {
return generate(DEFAULT_SIZE); | it's more of a public secret | MTDdk_jawn | train | java |
910a6b1463e0b9fa4113ae25921fc37ecef05332 | diff --git a/src/Traits/CurrentOrLtsLaravelVersion.php b/src/Traits/CurrentOrLtsLaravelVersion.php
index <HASH>..<HASH> 100644
--- a/src/Traits/CurrentOrLtsLaravelVersion.php
+++ b/src/Traits/CurrentOrLtsLaravelVersion.php
@@ -11,7 +11,7 @@ trait CurrentOrLtsLaravelVersion
}
$laravelVersion = app()->version();
- $currentOrLts = starts_with($laravelVersion, '5.3.')
+ $currentOrLts = starts_with($laravelVersion, '5.3.') || starts_with($laravelVersion, '5.4.')
? 'ForLaravelCurrent'
: (starts_with($laravelVersion, '5.1.') ? 'ForLaravelLts' : ''); | Update CurrentOrLtsLaravelVersion.php | GeneaLabs_laravel-casts | train | php |
e42cf65bd41bd89d2b940ad1391403942d5f679e | diff --git a/lib/bindings.js b/lib/bindings.js
index <HASH>..<HASH> 100644
--- a/lib/bindings.js
+++ b/lib/bindings.js
@@ -14,7 +14,8 @@ export function bindStyle(node, properties){
export function bindClass(node, classes){
// convert classes into an array
const classList = new Constraint(() => {
- const classesVal = classes.get();
+ const classesVal = classes instanceof Constraint ? classes.get()
+ : classes;
if(typeof classesVal === "string"){
// split the string into words
return classesVal.match(/\S+/g); | classBinding now supports non-constraint values. | QuentinRoy_tie | train | js |
294c52b46c5b1901818a898b28497399a4a2daa3 | diff --git a/lang/en/glossary.php b/lang/en/glossary.php
index <HASH>..<HASH> 100644
--- a/lang/en/glossary.php
+++ b/lang/en/glossary.php
@@ -154,9 +154,9 @@ $string['totalentries'] = 'Total entries';
$string['usedynalink'] = 'Automatically link glossary entries';
$string['waitingapproval'] = 'Waiting approval';
$string['warningstudentcapost'] = '(Applies only if the glossary is not the main one)';
-$string['writtenby'] = 'by';
$string['withauthor'] = 'Concepts with author';
$string['withoutauthor'] = 'Concepts without author';
+$string['writtenby'] = 'by';
$string['youarenottheauthor'] = 'You are not the author of this comment, so you are not allowed to edit it.';
?> | Opps. reordering some lines... | moodle_moodle | train | php |
16250880d812ec3cbb00122bd97a14e263e6beea | diff --git a/src/Installer/DirectoryRecursiveFilterIterator.php b/src/Installer/DirectoryRecursiveFilterIterator.php
index <HASH>..<HASH> 100644
--- a/src/Installer/DirectoryRecursiveFilterIterator.php
+++ b/src/Installer/DirectoryRecursiveFilterIterator.php
@@ -37,7 +37,7 @@ class DirectoryRecursiveFilterIterator extends RecursiveFilterIterator
public function accept()
{
foreach ($this->directoriesToSkip as $skip) {
- $skip = preg_quote(trim($skip, '/'), '/');
+ $skip = preg_quote(rtrim($skip, '/'), '/');
if (preg_match("/^${skip}(\\/|$)/", $this->current()->getPathName())) {
return false;
}
diff --git a/src/Installer/ShopInstaller.php b/src/Installer/ShopInstaller.php
index <HASH>..<HASH> 100644
--- a/src/Installer/ShopInstaller.php
+++ b/src/Installer/ShopInstaller.php
@@ -54,7 +54,7 @@ class ShopInstaller extends AbstractInstaller
{
$this->getIO()->write("Installing shop package");
- $packagePath = "$packagePath/source";
+ $packagePath = rtrim($packagePath, '/') . '/source';
$root = $this->getRootDirectory();
$directoriesToSkip = array_map( | Change shop installer to skip directories with classes from copying | OXID-eSales_oxideshop_composer_plugin | train | php,php |
1c96e07f752fcba68c1dd8b572323112e6e60b63 | diff --git a/twitter4j-core/src/test/java/twitter4j/UsersResourcesTest.java b/twitter4j-core/src/test/java/twitter4j/UsersResourcesTest.java
index <HASH>..<HASH> 100644
--- a/twitter4j-core/src/test/java/twitter4j/UsersResourcesTest.java
+++ b/twitter4j-core/src/test/java/twitter4j/UsersResourcesTest.java
@@ -155,7 +155,10 @@ public class UsersResourcesTest extends TwitterTestBase {
}
public void testBanner() throws Exception {
twitter1.updateProfileBanner(getRandomlyChosenFile(banners));
- twitter1.removeProfileBanner();
+ User user = twitter1.verifyCredentials();
+ if (user.getProfileBannerUrl() != null) {
+ twitter1.removeProfileBanner();
+ }
}
public void testAccountMethods() throws Exception {
User original = twitter1.verifyCredentials(); | TFJ-<I> fix UsersResourcesTest#testBanner
call removeProfileBanner() only when it exists.
it failed occasionally because updateProfileBanner processed asynchronously. | Twitter4J_Twitter4J | train | java |
12ee64fe26026f2d39ec10ba190e2a36a178b45f | diff --git a/gtkmvco/gtkmvc/observable.py b/gtkmvco/gtkmvc/observable.py
index <HASH>..<HASH> 100644
--- a/gtkmvco/gtkmvc/observable.py
+++ b/gtkmvco/gtkmvc/observable.py
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
-51 Franklin Street, Fifth Floor,
+# 51 Franklin Street, Fifth Floor,
# Boston, MA 02110, USA.ridge, MA 02139, USA.
#
# For more information on pygtkmvc see <http://pygtkmvc.sourceforge.net> | BUG FIX
Fixed a typo
Thanks to Roman Dobosz gryf TA elysium TOD pl for reporting | roboogle_gtkmvc3 | train | py |
4b1f81ec847f5938324b1633287b67abfdcbb6a7 | diff --git a/devices.js b/devices.js
index <HASH>..<HASH> 100755
--- a/devices.js
+++ b/devices.js
@@ -3954,6 +3954,13 @@ const devices = [
extend: generic.light_onoff_brightness_colortemp,
},
{
+ zigbeeModel: ['Neuhaus NLG-TW light'],
+ model: '100.469.65',
+ vendor: 'Paul Neuhaus',
+ description: 'Q-INIGO, LED panel, Smart-Home RGB',
+ extend: generic.light_onoff_brightness_colortemp,
+ },
+ {
zigbeeModel: ['NLG-RGBW light '],
model: '100.110.39',
vendor: 'Paul Neuhaus', | Added support for Paul Neuhaus ceiling lamp Model <I> in devices.js (#<I>)
* Updated devices.js
Added support for Paul Neuhaus ceiling lamp Model <I> in devices.js
* Update devices.js | Koenkk_zigbee-shepherd-converters | train | js |
dd92f4a211439d8bc705eb91fc1d51bbac273811 | diff --git a/lib/epuber/compiler/opf_generator.rb b/lib/epuber/compiler/opf_generator.rb
index <HASH>..<HASH> 100644
--- a/lib/epuber/compiler/opf_generator.rb
+++ b/lib/epuber/compiler/opf_generator.rb
@@ -277,7 +277,7 @@ module Epuber
case File.extname(filename)
when '.ttf', '.otf'
- 'application/font-sfnt'
+ 'application/vnd.ms-opentype'
else
MIME::Types.of(filename).first.content_type
end | [OPFGenerator] switch font mimetype to application/vnd.ms-opentype | epuber-io_epuber | train | rb |
39609fa45a258519fa9fcb4ebfbbd004e57be1d0 | diff --git a/src/foremast/consts.py b/src/foremast/consts.py
index <HASH>..<HASH> 100644
--- a/src/foremast/consts.py
+++ b/src/foremast/consts.py
@@ -23,7 +23,7 @@ def find_config():
cfg_file = config.read(config_locations)
if not cfg_file:
- LOG.error('No config found in the following locations: {0}\n'.format(CONFIG_LOCATIONS))
+ LOG.error('No config found in the following locations: {0}\n'.format(config_locations))
return config
@@ -46,5 +46,3 @@ HEADERS = {
}
LOGGING_FORMAT = ('%(asctime)s [%(levelname)s] %(name)s:%(funcName)s:'
'%(lineno)d - %(message)s')
-
- | fix: Locations was move to a local variable | foremast_foremast | train | py |
5f8f380f3e6a5f95077702d136cd449bfa73686e | diff --git a/aws/provider.go b/aws/provider.go
index <HASH>..<HASH> 100644
--- a/aws/provider.go
+++ b/aws/provider.go
@@ -683,20 +683,9 @@ func assumeRoleSchema() *schema.Schema {
},
},
},
- Set: assumeRoleToHash,
}
}
-func assumeRoleToHash(v interface{}) int {
- var buf bytes.Buffer
- m := v.(map[string]interface{})
- buf.WriteString(fmt.Sprintf("%s-", m["role_arn"].(string)))
- buf.WriteString(fmt.Sprintf("%s-", m["session_name"].(string)))
- buf.WriteString(fmt.Sprintf("%s-", m["external_id"].(string)))
- buf.WriteString(fmt.Sprintf("%s-", m["policy"].(string)))
- return hashcode.String(buf.String())
-}
-
func endpointsSchema() *schema.Schema {
return &schema.Schema{
Type: schema.TypeSet, | provider: Remove assumeRoleHash
The default hash function is good enough to use for the `assume_role` schema,
previously the custom hash function was causing a panic in the provider if the
`assume_role` configuration block was present but empty. | terraform-providers_terraform-provider-aws | train | go |
46e40eabb9ccf80cfa3082f9139ba6a67d2aff88 | diff --git a/src/consumer/offsetManager/index.js b/src/consumer/offsetManager/index.js
index <HASH>..<HASH> 100644
--- a/src/consumer/offsetManager/index.js
+++ b/src/consumer/offsetManager/index.js
@@ -316,8 +316,7 @@ module.exports = class OffsetManager {
return assign(obj, { [partition]: offset })
}
- const hasUnresolvedPartitions = () =>
- unresolvedPartitions.filter(t => t.partitions.length > 0).length > 0
+ const hasUnresolvedPartitions = () => unresolvedPartitions.some(t => t.partitions.length > 0)
let offsets = consumerOffsets
if (hasUnresolvedPartitions()) { | Use Array.prototype.some instead of filtering the complete array just for checking for non-emptiness | tulios_kafkajs | train | js |
303b78cb3f114e017b05714ee4d0f41424ff4a6f | diff --git a/src/Zofe/Rapyd/DataForm/DataForm.php b/src/Zofe/Rapyd/DataForm/DataForm.php
index <HASH>..<HASH> 100644
--- a/src/Zofe/Rapyd/DataForm/DataForm.php
+++ b/src/Zofe/Rapyd/DataForm/DataForm.php
@@ -58,10 +58,10 @@ class DataForm extends Widget
*/
public function add($name, $label, $type, $validation = '')
{
- if (strpos($type, "\\")) {
+ if (strpos($type, "\\") !== false) {
$field_class = $type;
} else {
- $field_class = '\Zofe\Rapyd\DataForm\Field' . "\\" . ucfirst($type);
+ $field_class = '\Zofe\Rapyd\DataForm\Field\\' . ucfirst($type);
}
//instancing | Fixed bug which declined to add custom NSed fields to DataForm | zofe_rapyd-laravel | train | php |
4aeb451ffdb858e8007892d65ef89a28451cddfc | diff --git a/gns3server/server.py b/gns3server/server.py
index <HASH>..<HASH> 100644
--- a/gns3server/server.py
+++ b/gns3server/server.py
@@ -252,7 +252,8 @@ class Server:
# TypeError: async() takes 1 positional argument but 3 were given
log.warning("TypeError exception in the loop {}".format(e))
finally:
- if self._handler:
+ if self._handler and self._loop.is_running():
self._loop.run_until_complete(self._handler.finish_connections())
server.close()
- self._loop.run_until_complete(app.finish())
+ if self._loop.is_running():
+ self._loop.run_until_complete(app.finish()) | Makes sure the loop is running when closing the app. | GNS3_gns3-server | train | py |
1870dc3cedc19ec55d5c67335eddc7c028b2ebd5 | diff --git a/ags_publishing_tools/api.py b/ags_publishing_tools/api.py
index <HASH>..<HASH> 100644
--- a/ags_publishing_tools/api.py
+++ b/ags_publishing_tools/api.py
@@ -39,7 +39,7 @@ class Api:
return self._request(url, params, 'GET')
def _request(self, url, params, method):
- encoded_params = urllib.quote(json.dumps(params))
+ encoded_params = urllib.urlencode(json.loads(json.dumps(params)))
request = urllib2.Request(url + '?' + encoded_params) if method == 'GET' else urllib2.Request(url, encoded_params)
request.get_method = lambda: method
response = urllib2.urlopen(request)
@@ -72,7 +72,7 @@ class Api:
folder = self.build_folder_string(folder)
url = '{0}/services/{1}{2}.{3}/edit'.format(self._ags_url, folder, service_name, service_type)
new_params = self.params.copy()
- new_params['service'] = params.copy()
+ new_params['service'] = json.dumps(params.copy())
return self.post(url, new_params)
def delete_service(self, service_name, folder='', service_type='MapServer'): | Sets edit params to string
Rather than a nested JSON object, sets the service param to a string
BPFG-<I> | lobsteropteryx_slap | train | py |
745774c56378130715f7443928b7d4befcd0bad5 | diff --git a/plugins/CoreHome/javascripts/broadcast.js b/plugins/CoreHome/javascripts/broadcast.js
index <HASH>..<HASH> 100644
--- a/plugins/CoreHome/javascripts/broadcast.js
+++ b/plugins/CoreHome/javascripts/broadcast.js
@@ -155,7 +155,8 @@ var broadcast = {
} else {
// start page
Piwik_Popover.close();
- $('#content').empty();
+
+ $('#content:not(.admin)').empty();
}
}, | refs #<I> prevent blank content is displayed after closing the popover in admin | matomo-org_matomo | train | js |
54e6a1cd8565c0130024fd68fd628d36fa0ec1c9 | diff --git a/setuptools/monkey.py b/setuptools/monkey.py
index <HASH>..<HASH> 100644
--- a/setuptools/monkey.py
+++ b/setuptools/monkey.py
@@ -4,6 +4,7 @@ Monkey patching of distutils.
import sys
import distutils.filelist
+from distutils.util import get_platform
import platform
import types
import functools
@@ -152,13 +153,13 @@ def patch_for_msvc_specialized_compiler():
Patch functions in distutils to use standalone Microsoft Visual C++
compilers.
"""
- # import late to avoid circular imports on Python < 3.5
- msvc = import_module('setuptools.msvc')
-
- if platform.system() != 'Windows':
+ if not get_platform().startswith('win'):
# Compilers only availables on Microsoft Windows
return
+ # import late to avoid circular imports on Python < 3.5
+ msvc = import_module('setuptools.msvc')
+
def patch_params(mod_name, func_name):
"""
Prepare the parameters for patch_func to patch indicated function. | Fix exception on mingw built Python 2
The exception is caused by the VCForPython<I> monkey patch. It's not needed on mingw built Python. Disable it and avoid the import by using the same function that `distutils` uses to decide it's running on a mingw built Python.
Fixes #<I> | pypa_setuptools | train | py |
bf07bfb0b134e3088d571c9c979bf1bb56b0a8a4 | diff --git a/java/client/test/org/openqa/selenium/CookieImplementationTest.java b/java/client/test/org/openqa/selenium/CookieImplementationTest.java
index <HASH>..<HASH> 100644
--- a/java/client/test/org/openqa/selenium/CookieImplementationTest.java
+++ b/java/client/test/org/openqa/selenium/CookieImplementationTest.java
@@ -53,7 +53,13 @@ public class CookieImplementationTest extends AbstractDriverTestCase {
// We go to it to ensure that cookies with /common/... paths are deleted
// Do not write test in this class which use pages other than under /common
// without ensuring that cookies are deleted on those pages as required
- driver.get(domainHelper.getUrlForFirstValidHostname("/common/animals"));
+ try {
+ driver.get(domainHelper.getUrlForFirstValidHostname("/common/animals"));
+ } catch (IllegalArgumentException e) {
+ // Ideally we would throw an IgnoredTestError or something here,
+ // but our test runner doesn't pay attention to those.
+ // Rely on the tests skipping themselves if they need to be on a useful page.
+ }
driver.manage().deleteAllCookies();
assertNoCookiesArePresent(); | DanielWagnerHall: Don't throw if we can't run the tests - rely on the tests themselves skipping themselves
r<I> | SeleniumHQ_selenium | train | java |
88421ed119eb48fc4b74698cb9bf132c2f370be1 | diff --git a/lib/html/pipeline.rb b/lib/html/pipeline.rb
index <HASH>..<HASH> 100644
--- a/lib/html/pipeline.rb
+++ b/lib/html/pipeline.rb
@@ -25,7 +25,6 @@ module HTML
# some semblance of type safety.
class Pipeline
autoload :VERSION, 'html/pipeline/version'
- autoload :Pipeline, 'html/pipeline/pipeline'
autoload :Filter, 'html/pipeline/filter'
autoload :AbsoluteSourceFilter, 'html/pipeline/absolute_source_filter'
autoload :BodyContent, 'html/pipeline/body_content' | Remove unneeded autoload
Not necessary because there is no such class to load. | jch_html-pipeline | train | rb |
34f2432c3f99c7189eedbce3b40ab1fda9c38fdf | diff --git a/octodns/provider/ns1.py b/octodns/provider/ns1.py
index <HASH>..<HASH> 100644
--- a/octodns/provider/ns1.py
+++ b/octodns/provider/ns1.py
@@ -221,11 +221,11 @@ class Ns1Provider(BaseProvider):
},
)
params['filters'] = []
+ if len(params['answers']) > 1:
+ params['filters'].append(
+ {"filter": "shuffle", "config":{}}
+ )
if has_country:
- if len(params['answers']) > 1:
- params['filters'].append(
- {"filter": "shuffle", "config":{}}
- )
params['filters'].append(
{"filter": "geotarget_country", "config": {}}
) | after discussion, we should shuffle if there's more than 1 answer | github_octodns | train | py |
367188952bcd7c464089a0a91e54a42af3cba9c2 | diff --git a/resources/views/adminarea/pages/tag.blade.php b/resources/views/adminarea/pages/tag.blade.php
index <HASH>..<HASH> 100644
--- a/resources/views/adminarea/pages/tag.blade.php
+++ b/resources/views/adminarea/pages/tag.blade.php
@@ -162,7 +162,7 @@
{{ Form::button(trans('cortex/tags::common.submit'), ['class' => 'btn btn-primary btn-flat', 'type' => 'submit']) }}
</div>
- @include('cortex/foundation::adminarea.partials.timestamps', ['model' => $tag])
+ @include('cortex/foundation::common.partials.timestamps', ['model' => $tag])
</div> | Replace form timestamps with common blade view | rinvex_cortex-tags | train | php |
0489dcc28cd943bfbdb413350eb9881445239c44 | diff --git a/python/setup.py b/python/setup.py
index <HASH>..<HASH> 100755
--- a/python/setup.py
+++ b/python/setup.py
@@ -25,7 +25,7 @@ setup(name = 'sentencepiece',
author_email='taku@google.com',
description = 'SentencePiece python wrapper',
long_description = long_description,
- version='0.0.1',
+ version='0.0.2',
url = 'https://github.com/google/sentencepiece',
license = 'Apache',
platforms = 'Unix', | Updated Python wrapper. Regenerated with the shell script | google_sentencepiece | train | py |
374f08eeb3d1fc5ff0470b9b35459beb2b2f1a60 | diff --git a/tableview.go b/tableview.go
index <HASH>..<HASH> 100644
--- a/tableview.go
+++ b/tableview.go
@@ -978,6 +978,8 @@ func (l *TableView) SetSelectedRow(row int) {
l.selectedRow = l.rowCount - 1
} else if row < -1 {
l.selectedRow = -1
+ } else {
+ l.selectedRow = row
}
if l.selectedRow != oldSelection {
@@ -996,6 +998,8 @@ func (l *TableView) SetSelectedCol(col int) {
l.selectedCol = len(l.columns) - 1
} else if col < -1 {
l.selectedCol = -1
+ } else {
+ l.selectedCol = col
}
if l.selectedCol != oldSelection { | SetSelectedRow and SetSelectedCol work on the trivial case | VladimirMarkelov_clui | train | go |
95b314d89faeae47a8e8bffd1d19328946649ff1 | diff --git a/test/run.js b/test/run.js
index <HASH>..<HASH> 100755
--- a/test/run.js
+++ b/test/run.js
@@ -126,7 +126,7 @@ exports.run = function(timeout_coefficient) {
if(timeout_coefficient)
BROWSER_TIMEOUT_COEFFICIENT = timeout_coefficient;
- if(require.isBrowser) {
+ if(require.isBrowser && process.env.synthetic_throw) {
var events = require('events');
process.exceptions = new events.EventEmitter;
} | Only do the weird throw thing if asked | jhs_cqs | train | js |
10f23859a34e294864ad67c9f763066f3a1f3423 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -71,14 +71,14 @@ if __name__ == '__main__':
'sphinx',
],
'tests': [
- 'flake8',
- 'pytest',
- 'pytest-cache',
- 'pytest-cov',
- 'pytest-flakes',
- 'pytest-pep8',
- 'freezegun',
- 'sphinx',
+ 'flake8>=3.7.7',
+ 'pytest>=4.3.1',
+ 'pytest-cache>=1.0',
+ 'pytest-cov>=2.6.1',
+ 'pytest-flakes>=4.0.0',
+ 'pytest-pep8>=1.0.6',
+ 'freezegun>=0.3.11',
+ 'sphinx>=1.8.5',
],
},
classifiers=[ | updated requirements to fix readthedocs | WoLpH_python-progressbar | train | py |
2e5a8932594620ee66d08586492b3a00a0b61eca | diff --git a/tests/helpers.py b/tests/helpers.py
index <HASH>..<HASH> 100644
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -1,26 +1,18 @@
import os
-from os import path
-import zipfile
+import shutil
def fixture(filename):
"""
Get the handle / path to the test data folder.
"""
- return path.join(path.dirname(__file__), 'fixtures', filename)
+ return os.path.join(os.path.dirname(__file__), 'fixtures', filename)
def zip_file(scenario):
"""
Get the file handle / path to the zip file.
"""
- basedir = path.dirname(__file__)
- scenario_dir = path.join(basedir, 'fixtures', scenario)
- scenario_file = path.join(basedir, 'fixtures', scenario + '.zip')
-
- with zipfile.ZipFile(scenario_file, 'w') as zipf:
- for root, dirs, files in os.walk(scenario_dir):
- for gtfs_file in files:
- zipf.write(path.join(root, gtfs_file), gtfs_file)
-
- return path.join(basedir, 'fixtures', scenario + '.zip')
+ fixture_dir = os.path.join(os.path.dirname(__file__), 'fixtures')
+ scenario_dir = os.path.join(fixture_dir, scenario)
+ return shutil.make_archive(scenario_dir, 'zip', scenario_dir) | Refactor helpers.zip_file
`shutil.make_archive` with preserve nested folders
which is needed in upcoming commits. | remix_partridge | train | py |
d930b8a07c41d390e84b0974c06b2054d4869d34 | diff --git a/examples/plotting/server/candlestick.py b/examples/plotting/server/candlestick.py
index <HASH>..<HASH> 100644
--- a/examples/plotting/server/candlestick.py
+++ b/examples/plotting/server/candlestick.py
@@ -11,7 +11,7 @@ hold()
df = pd.DataFrame(MSFT)[:50]
df['date'] = pd.to_datetime(df['date'])
-dates = df.date.astype(int)
+dates = df.date.astype(int) / 1000000 # source data was in microsec
mids = (df.open + df.close)/2
spans = abs(df.close-df.open)
@@ -20,6 +20,7 @@ dec = df.open > df.close
w = (dates[1]-dates[0])*0.7
segment(dates, df.high, dates, df.low,
+ x_axis_type = "datetime",
color='#000000', tools="pan,zoom,resize", width=1000,
name="candlestick")
rect(dates[inc], mids[inc], w, spans[inc], | sync server candlestick with file demo | bokeh_bokeh | train | py |
336ab46a2571d8bdeace1bf71ba249ca11365d87 | diff --git a/dev_tools/bash_scripts_test.py b/dev_tools/bash_scripts_test.py
index <HASH>..<HASH> 100644
--- a/dev_tools/bash_scripts_test.py
+++ b/dev_tools/bash_scripts_test.py
@@ -18,7 +18,7 @@ from typing import TYPE_CHECKING, Iterable
from dev_tools import shell_tools
if TYPE_CHECKING:
- import _pytest
+ import _pytest.tmpdir
def only_on_posix(func): | fix bad import (#<I>)
Re-adding the mistakenly removed fix for a mypy error.
Thanks for noticing @mpharrigan <URL> | quantumlib_Cirq | train | py |
16cd27711e9337cc0ccffdf7e742db8264d346e5 | diff --git a/tenant_schemas/models.py b/tenant_schemas/models.py
index <HASH>..<HASH> 100644
--- a/tenant_schemas/models.py
+++ b/tenant_schemas/models.py
@@ -33,12 +33,12 @@ class TenantMixin(models.Model):
raise Exception("Can't update tenant outside it's own schema or the public schema. Current schema is %s."
% connection.get_schema())
+ super(TenantMixin, self).save(*args, **kwargs)
+
if is_new and self.auto_create_schema:
self.create_schema(check_if_exists=True, verbosity=verbosity)
post_schema_sync.send(sender=TenantMixin, tenant=self)
- super(TenantMixin, self).save(*args, **kwargs)
-
def delete(self, *args, **kwargs):
"""
Drops the schema related to the tenant instance. Just drop the schema if the parent | fixed tenant sync failing because row doesnt exist | bernardopires_django-tenant-schemas | train | py |
714dad5ccd277f47d753b258311f0cc5ff961491 | diff --git a/lib/hashie/dash.rb b/lib/hashie/dash.rb
index <HASH>..<HASH> 100644
--- a/lib/hashie/dash.rb
+++ b/lib/hashie/dash.rb
@@ -80,7 +80,7 @@ module Hashie
attributes.each_pair do |att, value|
self.send("#{att}=", value)
- end
+ end if attributes
end
# Retrieve a value from the Dash (will return the
diff --git a/spec/hashie/dash_spec.rb b/spec/hashie/dash_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/hashie/dash_spec.rb
+++ b/spec/hashie/dash_spec.rb
@@ -70,6 +70,13 @@ describe Hashie::Dash do
DashTest.new(:first_name => 'Michael').first_name.should == 'Michael'
end
end
+
+ describe 'initializing with a nil' do
+ it 'accepts nil' do
+ lambda { DashTest.new(nil) }.should_not raise_error
+ end
+ end
+
describe ' defaults' do
before do
@dash = DashTest.new | Initializing Dash with a nil | intridea_hashie | train | rb,rb |
c53190a9047343701bb7568bace564a943bef39a | diff --git a/src/toil/test/__init__.py b/src/toil/test/__init__.py
index <HASH>..<HASH> 100644
--- a/src/toil/test/__init__.py
+++ b/src/toil/test/__init__.py
@@ -405,18 +405,23 @@ def needs_cwl(test_item):
def needs_appliance(test_item):
+ import json
test_item = _mark_test('appliance', test_item)
if next(which('docker'), None):
image = applianceSelf()
try:
- images = subprocess.check_output(['docker', 'images', image])
+ images = subprocess.check_output(['docker', 'inspect', image])
except subprocess.CalledProcessError:
- images = ''
- if image in images:
- return test_item
+ images = []
else:
+ images = {i['Id'] for i in json.loads(images) if image in i['RepoTags']}
+ if len(images) == 0:
return unittest.skip("Cannot find appliance image %s. Be sure to run 'make docker' "
"prior to running this test." % image)(test_item)
+ elif len(images) == 1:
+ return test_item
+ else:
+ assert False, 'Expected `docker inspect` to return zero or one image.'
else:
return unittest.skip('Install Docker to include this test.')(test_item) | Use `inspect` instead of `images` for @needs_appliance (fixes #<I>) | DataBiosphere_toil | train | py |
3ffca9d6e118b0695f897e199aa388e3b45c16a8 | diff --git a/lib/active_scaffold/data_structures/nested_info.rb b/lib/active_scaffold/data_structures/nested_info.rb
index <HASH>..<HASH> 100644
--- a/lib/active_scaffold/data_structures/nested_info.rb
+++ b/lib/active_scaffold/data_structures/nested_info.rb
@@ -123,19 +123,12 @@ module ActiveScaffold::DataStructures
protected
def iterate_model_associations(model)
- @constrained_fields = Set.new
+ @constrained_fields = []
constrained_fields << association.foreign_key.to_sym unless association.belongs_to?
- model.reflect_on_all_associations.each do |current|
- if association != current && association.foreign_key.to_s == current.foreign_key.to_s
- if current.belongs_to? && current.options[:polymorphic] && association.options[:as]
- @child_association = current if association.options[:as].to_sym == current.name
- elsif current.klass == @parent_model
- @child_association = current
- end
- end
+ if association.reverse
+ @child_association = model.reflect_on_association(association.reverse)
+ constrained_fields << @child_association.name unless @child_association == association
end
- constrained_fields << @child_association.name.to_sym
- @constrained_fields = @constrained_fields.to_a
end
end | simplify get child_association in nested reusing association.reverse. fixes #<I> | activescaffold_active_scaffold | train | rb |
fd96e30708fc3fff96f31395c2c297fc27286be7 | diff --git a/src/Illuminate/Validation/ValidationServiceProvider.php b/src/Illuminate/Validation/ValidationServiceProvider.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Validation/ValidationServiceProvider.php
+++ b/src/Illuminate/Validation/ValidationServiceProvider.php
@@ -38,7 +38,7 @@ class ValidationServiceProvider extends ServiceProvider
// The validation presence verifier is responsible for determining the existence of
// values in a given data collection which is typically a relational database or
// other persistent data stores. It is used to check for "uniqueness" as well.
- if (isset($app['db']) && isset($app['validation.presence'])) {
+ if (isset($app['db'], $app['validation.presence'])) {
$validator->setPresenceVerifier($app['validation.presence']);
} | No need to call isset() twice. (#<I>) | laravel_framework | train | php |
31880ab0d2ee42e7758ef1371bd6dd32d8d09dec | diff --git a/aws/model/endpoints.go b/aws/model/endpoints.go
index <HASH>..<HASH> 100644
--- a/aws/model/endpoints.go
+++ b/aws/model/endpoints.go
@@ -28,7 +28,7 @@ func (c Constraint) Condition() string {
case "equals":
return fmt.Sprintf("%s == %q", str(c[0]), str(c[2]))
case "notEquals":
- return fmt.Sprintf("%s == %q", str(c[0]), str(c[2]))
+ return fmt.Sprintf("%s != %q", str(c[0]), str(c[2]))
case "oneOf":
var values []string
for _, v := range c[2].([]interface{}) { | Fix notEquals constraint. | aws_aws-sdk-go | train | go |
9676be4b162a48cca32d4efc84b96fa81bb80f9b | diff --git a/src/resolvers/ClassNameResolver.php b/src/resolvers/ClassNameResolver.php
index <HASH>..<HASH> 100644
--- a/src/resolvers/ClassNameResolver.php
+++ b/src/resolvers/ClassNameResolver.php
@@ -50,7 +50,7 @@ class ClassNameResolver implements DependencyResolverInterface
}
// Our parameter has a class type hint
- if (isset($type) && !$type->isBuiltin()) {
+ if ($type !== null && !$type->isBuiltin()) {
return new ClassDependency($type->getName(), $type->allowsNull());
} | Update src/resolvers/ClassNameResolver.php | yiisoft_di | train | php |
a77a2a4f82eb8a45ea837003ed16aab5d8bab7f5 | diff --git a/packages/eslint-config/index.js b/packages/eslint-config/index.js
index <HASH>..<HASH> 100644
--- a/packages/eslint-config/index.js
+++ b/packages/eslint-config/index.js
@@ -36,7 +36,6 @@ module.exports = {
"jsx-a11y/no-noninteractive-element-interactions": 0,
"react/forbid-prop-types": 0,
"react/jsx-filename-extension": 0,
- "react/self-closing-comp": 0,
"redux-saga/no-yield-in-race": 2,
"redux-saga/yield-effects": 2
}, | feat(eslint-config): remove react/self-closing-comp custom rule
affects: @goldwasserexchange/eslint-config
remove react/self-closing-comp custom eslint rule to use airbnb default behavior | goldwasserexchange_public | train | js |
2f48c9fc9df4e94846a4c5961dc1d00e33b9ecfd | diff --git a/django_ulogin/templatetags/ulogin_tags.py b/django_ulogin/templatetags/ulogin_tags.py
index <HASH>..<HASH> 100644
--- a/django_ulogin/templatetags/ulogin_tags.py
+++ b/django_ulogin/templatetags/ulogin_tags.py
@@ -45,7 +45,10 @@ def ulogin_widget(context, name="default"):
'SCHEME_NOT_FOUND': True,
'NAME': name
}
- glue = lambda key: ','.join([p for p in scheme.get(key, getattr(s, key))])
+
+ def glue(key):
+ return ','.join([p for p in scheme.get(key, getattr(s, key))])
+
rand = ''.join(random.choice(string.ascii_lowercase) for x in range(5))
return { | Trying to fix pep8 E<I> bug | marazmiki_django-ulogin | train | py |
194e406b64d79a3216c4dbc0ab964eea66dfcbed | diff --git a/test/spec/modelUsage.spec.js b/test/spec/modelUsage.spec.js
index <HASH>..<HASH> 100644
--- a/test/spec/modelUsage.spec.js
+++ b/test/spec/modelUsage.spec.js
@@ -141,7 +141,7 @@ describe('A person model defined using modelFactory', function(){
$httpBackend.verifyNoOutstandingRequest();
});
- it('should return the requested resource by its id', function(){
+ it('should return the requested resource by its id (as number)', function(){
PersonModel.get(123)
.then(function(theFetchedPerson){
expect(theFetchedPerson).toBeDefined();
@@ -152,6 +152,17 @@ describe('A person model defined using modelFactory', function(){
$httpBackend.flush();
});
+ it('should return the requested resource by its id (as string)', function(){
+ PersonModel.get('123')
+ .then(function(theFetchedPerson){
+ expect(theFetchedPerson).toBeDefined();
+ expect(theFetchedPerson.name).toEqual('Juri');
+ });
+
+ $httpBackend.expectGET('/api/people/123');
+ $httpBackend.flush();
+ });
+
});
describe('when calling $save()', function(){ | adds test case for id property being strings | swimlane_angular-model-factory | train | js |
e1f7b4258a71d215e8d7661878454fdd7d816afc | diff --git a/lib/record_store/version.rb b/lib/record_store/version.rb
index <HASH>..<HASH> 100644
--- a/lib/record_store/version.rb
+++ b/lib/record_store/version.rb
@@ -1,3 +1,3 @@
module RecordStore
- VERSION = '3.1.2'
+ VERSION = '3.1.3'
end | Bump again since I'm dumb and yanked | Shopify_record_store | train | rb |
3e3ff2af3c8799907c81053f42cb676947586bcc | diff --git a/noise/functions.py b/noise/functions.py
index <HASH>..<HASH> 100644
--- a/noise/functions.py
+++ b/noise/functions.py
@@ -162,7 +162,7 @@ class KeyPair25519(_KeyPair):
def from_private_bytes(cls, private_bytes):
if len(private_bytes) != 32:
raise NoiseValueError('Invalid length of private_bytes! Should be 32')
- private = x25519.X25519PrivateKey._from_private_bytes(private_bytes)
+ private = x25519.X25519PrivateKey.from_private_bytes(private_bytes)
public = private.public_key()
return cls(private=private, public=public, public_bytes=public.public_bytes()) | fix use of x<I> private keys (#<I>)
This underscore is a typo and causes errors to be thrown. | plizonczyk_noiseprotocol | train | py |
b194939ea2b1ba6bc33419d0abaa8ec0506de773 | diff --git a/proso/release.py b/proso/release.py
index <HASH>..<HASH> 100644
--- a/proso/release.py
+++ b/proso/release.py
@@ -1 +1 @@
-VERSION = '3.21.1'
+VERSION = '3.21.2.dev' | start working on <I>.dev | adaptive-learning_proso-apps | train | py |
3ede87a3ff86d02b387aaf128285cae2b22678e1 | diff --git a/lib/conceptql/cli.rb b/lib/conceptql/cli.rb
index <HASH>..<HASH> 100644
--- a/lib/conceptql/cli.rb
+++ b/lib/conceptql/cli.rb
@@ -4,6 +4,7 @@ require 'thor'
require 'sequelizer'
require 'json'
require 'pp'
+require 'csv'
require_relative 'query'
require_relative 'knitter'
@@ -112,6 +113,20 @@ module ConceptQL
ConceptQL::Knitter.new(ConceptQL::Database.new(db), file, opts).knit
end
+ desc 'dumpit', 'Dumps out test data into CSVs'
+ def dumpit(path)
+ path = Pathname.new(path)
+ path.mkpath unless path.exist?
+ db.tables.each do |table|
+ puts "Dumping #{table}..."
+ ds = db[table]
+ rows = ds.select_map(ds.columns)
+ CSV.open(path + "#{table}.csv", "wb") do |csv|
+ rows.each { |row| csv << row }
+ end
+ end
+ end
+
private
desc 'show_and_tell_db conceptql_id', 'Fetches the ConceptQL from a DB and shows the contents as a ConceptQL graph, then executes the statement against our test database'
option :full | Add dumpit, a command to dump test data to CSVs | outcomesinsights_conceptql | train | rb |
01e9918317f0c3399a87f07e64e6a2798e83b05c | diff --git a/lib/travis/model/request.rb b/lib/travis/model/request.rb
index <HASH>..<HASH> 100644
--- a/lib/travis/model/request.rb
+++ b/lib/travis/model/request.rb
@@ -16,10 +16,10 @@ class Request < ActiveRecord::Base
class << self
# TODO clean this up
def create_from(payload, token)
- Metriks.meter("github:requests", "api").mark
+ ActiveSupport::Notifications.publish("github.requests", "received", payload)
payload = Payload::Github.new(payload, token)
unless payload.reject?
- Metriks.meter("github:requests:accepted", "api").mark
+ ActiveSupport::Notifications.publish("github.requests", "accepted", payload)
repository = repository_for(payload.repository)
commit = commit_for(payload, repository)
repository.requests.create!(payload.attributes.merge(:state => :created, :commit => commit)) | Trigger notifications instead of direct metriks. | travis-ci_travis-core | train | rb |
492bad71f384c71e7e2708d6733d69f478657613 | diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -869,13 +869,13 @@ module ActiveRecord
end
def where_unscoping(target_value)
- target_value_sym = target_value.to_sym
+ target_value = target_value.to_s
where_values.reject! do |rel|
case rel
when Arel::Nodes::In, Arel::Nodes::NotIn, Arel::Nodes::Equality, Arel::Nodes::NotEqual
subrelation = (rel.left.kind_of?(Arel::Attributes::Attribute) ? rel.left : rel.right)
- subrelation.name.to_sym == target_value_sym
+ subrelation.name == target_value
else
raise "unscope(where: #{target_value.inspect}) failed: unscoping #{rel.class} is unimplemented."
end | no need to to_sym | rails_rails | train | rb |
4ddd274b13d33ff3a5801033b7298b96a2dfd927 | diff --git a/src/com/google/javascript/jscomp/ChangeVerifier.java b/src/com/google/javascript/jscomp/ChangeVerifier.java
index <HASH>..<HASH> 100644
--- a/src/com/google/javascript/jscomp/ChangeVerifier.java
+++ b/src/com/google/javascript/jscomp/ChangeVerifier.java
@@ -183,7 +183,7 @@ public class ChangeVerifier {
if (fnName == null) {
fnName = "anonymous@" + n.getLineno() + ":" + n.getCharno();
}
- return "FUNCTION: " + "" + " in " + sourceName;
+ return "FUNCTION: " + fnName + " in " + sourceName;
default:
throw new IllegalStateException("unexpected Node type");
} | ChangeVerifier error message: Include the function name if we have it.
-------------
Created by MOE: <URL> | google_closure-compiler | train | java |
8ea1f134df46c236852c2827ad48ee93399606e6 | diff --git a/library.js b/library.js
index <HASH>..<HASH> 100644
--- a/library.js
+++ b/library.js
@@ -388,7 +388,8 @@ async function stripDisallowedFullnames(users) {
SocketPlugins.mentions.getTopicUsers = async (socket, data) => {
const uids = await Topics.getUids(data.tid);
- const users = await User.getUsers(uids);
+ let users = await User.getUsers(uids);
+ users = users.filter(u => u && u.userslug);
if (Meta.config.hideFullname) {
return users;
} | fix: #<I>, don't show delete users in topic users | julianlam_nodebb-plugin-mentions | train | js |
a8d06007573d137524fc729946f90e78419e1b6a | diff --git a/src/MadeYourDay/Contao/ThemeAssistantDataContainer.php b/src/MadeYourDay/Contao/ThemeAssistantDataContainer.php
index <HASH>..<HASH> 100644
--- a/src/MadeYourDay/Contao/ThemeAssistantDataContainer.php
+++ b/src/MadeYourDay/Contao/ThemeAssistantDataContainer.php
@@ -448,7 +448,7 @@ class ThemeAssistantDataContainer extends \DataContainer implements \listable, \
{
}
- public function save()
+ public function save($varValue)
{
}
} | Added compatibility for Contao <I> | madeyourday_contao-rocksolid-theme-assistant | train | php |
70b31393eb99390b288049a6991ac7de78cc4b19 | diff --git a/spec/dragonfly/job/fetch_url_spec.rb b/spec/dragonfly/job/fetch_url_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/dragonfly/job/fetch_url_spec.rb
+++ b/spec/dragonfly/job/fetch_url_spec.rb
@@ -25,7 +25,7 @@ describe Dragonfly::Job::FetchUrl do
end
it "should also work with https" do
- stub_request(:get, 'https://place.com').to_return(:body => 'secure result!')
+ stub_request(:get, /place.com/).to_return(:body => 'secure result!')
job.fetch_url!('https://place.com')
job.data.should == "secure result!"
end
@@ -93,7 +93,7 @@ describe Dragonfly::Job::FetchUrl do
it "follows redirects to https" do
stub_request(:get, "redirectme.com").to_return(:status => 302, :headers => {'Location' => 'https://ok.com'})
- stub_request(:get, "https://ok.com").to_return(:body => "OK!")
+ stub_request(:get, /ok.com/).to_return(:body => "OK!")
job.fetch_url('redirectme.com').data.should == 'OK!'
end | travis is failing (different version of webmock?) on a couple of specs - used less strict stub matchers | markevans_dragonfly | train | rb |
c36433830661823e1ef1e6e058711093dd7d7988 | diff --git a/lib/custom/tests/TestHelperCustom.php b/lib/custom/tests/TestHelperCustom.php
index <HASH>..<HASH> 100644
--- a/lib/custom/tests/TestHelperCustom.php
+++ b/lib/custom/tests/TestHelperCustom.php
@@ -114,7 +114,7 @@ class TestHelperCustom
$ctx->setDatabaseManager( $dbm );
- $fs = new \Aimeos\MW\Filesystem\Manager\Standard( $conf );
+ $fs = new \Aimeos\Base\Filesystem\Manager\Standard( $conf->get( 'resource' ) );
$ctx->setFilesystemManager( $fs ); | Adapt filesystem code to new aimeos-base package | aimeos_ai-client-jsonapi | train | php |
d5c3750c052649ef9d1b0fc9551c9b740f3d55dc | diff --git a/lib/koa-data-request.js b/lib/koa-data-request.js
index <HASH>..<HASH> 100644
--- a/lib/koa-data-request.js
+++ b/lib/koa-data-request.js
@@ -38,9 +38,8 @@ class KoaDataRequestInterceptor extends Interceptor {
receive(ctx, args) {
this.ec.properties = args;
- return this.connected.receive({
- data: this.ec.expand(this.data)
- }, ctx).then(response => {
+ return this.connected.receive(
+ this.ec.expand(this.data), ctx).then(response => {
ctx.body = response;
return Promise.resolve();
});
diff --git a/tests/koa-data_test.js b/tests/koa-data_test.js
index <HASH>..<HASH> 100644
--- a/tests/koa-data_test.js
+++ b/tests/koa-data_test.js
@@ -68,7 +68,7 @@ describe('interceptors', () => {
it('passing request', () => itc.receive(ctx, {
id: 1234
}).then(() => {
- assert.equal(ctx.body.data.a, 'XXX1234YYY');
+ assert.equal(ctx.body.a, 'XXX1234YYY');
}));
});
}); | feat(koa-data-request): no more { data: <<content>> } for outgoing requests
BREAKING CHANGE: remove surrounding object with data: key as default request shell | Kronos-Integration_kronos-interceptor-http-request | train | js,js |
2b964eb52ebf35fc5212bf13ff5ccf1fc70e4b42 | diff --git a/mama_cas/tests/test_utils.py b/mama_cas/tests/test_utils.py
index <HASH>..<HASH> 100644
--- a/mama_cas/tests/test_utils.py
+++ b/mama_cas/tests/test_utils.py
@@ -1,4 +1,3 @@
-from django.core.urlresolvers import NoReverseMatch
from django.test import TestCase
from django.test.utils import override_settings
@@ -87,4 +86,5 @@ class UtilsTests(TestCase):
A non-URL that does not match a view name should raise the
appropriate exception.
"""
- self.assertRaises(NoReverseMatch, redirect, 'example')
+ r = redirect('http')
+ self.assertEqual('/login', r['Location'])
diff --git a/mama_cas/utils.py b/mama_cas/utils.py
index <HASH>..<HASH> 100644
--- a/mama_cas/utils.py
+++ b/mama_cas/utils.py
@@ -76,7 +76,7 @@ def redirect(to, *args, **kwargs):
to = urlresolvers.reverse(to, args=args, kwargs=kwargs)
except urlresolvers.NoReverseMatch:
if '/' not in to and '.' not in to:
- raise
+ to = urlresolvers.reverse('cas_login')
if params:
to = add_query_params(to, params) | Change invalid redirect URLs to redirect to /login | jbittel_django-mama-cas | train | py,py |
1077fd0d1bea10bfcba416309e58380bf86aa3e0 | diff --git a/gcs/conn.go b/gcs/conn.go
index <HASH>..<HASH> 100644
--- a/gcs/conn.go
+++ b/gcs/conn.go
@@ -44,7 +44,7 @@ type OpenBucketOptions struct {
Name string
// BillingProject specifies the project to be billed when making requests.
- // This option is needed for requester pays buckets.
+ // This option is only needed for requester pays buckets and can be left empty otherwise.
// (https://cloud.google.com/storage/docs/requester-pays)
BillingProject string
} | Updates comments on BillingProject option. | jacobsa_gcloud | train | go |
959d3aed97e8d872dea13fff11ce129f382f5157 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -1,14 +1,15 @@
module.exports = function() {
- let subscribers = []
+ let subscribers = [], self
- return {
+ return self = {
// remove all subscribers
clear: (eventName) => {
subscribers = eventName != null
? subscribers.filter(subscriber => subscriber.eventName !== eventName)
: []
+ return self // return self to support chaining
},
// remove a subscriber
@@ -17,11 +18,13 @@ module.exports = function() {
if (index >= 0) {
subscribers.splice(index, 1)
}
+ return self
},
// subscribe to an event
on: (eventName, callback) => {
subscribers.push({ eventName, callback })
+ return self
},
// trigger an event; all subscribers will be called
@@ -29,6 +32,7 @@ module.exports = function() {
subscribers
.filter(subscriber => subscriber.eventName === eventName)
.forEach(subscriber => subscriber.callback(data))
+ return self
}
}
} | Return the emitter
These changes return the emitter object at the end of the `on` and `trigger` functions to allow setting multiple handlers or triggering multiple events in a row.
The line count is still <I>. | raineorshine_emitter20 | train | js |
abfb9d2a0252e30cfe70696183ac0f58e08e5eda | diff --git a/tools/benchmark/runtime/runtime_test.go b/tools/benchmark/runtime/runtime_test.go
index <HASH>..<HASH> 100644
--- a/tools/benchmark/runtime/runtime_test.go
+++ b/tools/benchmark/runtime/runtime_test.go
@@ -40,7 +40,7 @@ func TestIncreasingMonotonicTimeNowIncrease(t *testing.T) {
for i := 0; i <= 100; i++ {
tn := timeNow()
if got, old := tn, to; !got.After(old) {
- t.Fatalf("mock timeNow() should be monoticly ascending, got %d vs old %v instead", got, old)
+ t.Fatalf("mock timeNow() should be monoticly ascending, got %v vs old %v instead", got, old)
}
to = tn
} | Fix format on test failing now at TIP | google_badwolf | train | go |
beb6161080d2d82a9c9a67df51f5df708e8d2b75 | diff --git a/extensions/breadcrumb-trail.php b/extensions/breadcrumb-trail.php
index <HASH>..<HASH> 100644
--- a/extensions/breadcrumb-trail.php
+++ b/extensions/breadcrumb-trail.php
@@ -15,7 +15,7 @@
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @package BreadcrumbTrail
- * @version 0.5.1
+ * @version 0.5.2
* @author Justin Tadlock <justin@justintadlock.com>
* @copyright Copyright (c) 2008 - 2012, Justin Tadlock
* @link http://justintadlock.com/archives/2009/04/05/breadcrumb-trail-wordpress-plugin
@@ -447,7 +447,7 @@ function breadcrumb_trail_get_bbpress_items( $args = array() ) {
/* Get the queried forum ID and its parent forum ID. */
$forum_id = get_queried_object_id();
- $forum_parent_id = bbp_get_forum_parent( $forum_id );
+ $forum_parent_id = bbp_get_forum_parent_id( $forum_id );
/* If the forum has a parent forum, get its parent(s). */
if ( 0 !== $forum_parent_id) | Use bbp_get_forum_parent_id() instead of bbp_get_forum_parent(). bbPress, please deprecate functions before removing them from the code altogether. | justintadlock_hybrid-core | train | php |
627b75d945a482f4062ab6a58fc4f660a9e62128 | diff --git a/lib/vagrant/vm.rb b/lib/vagrant/vm.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant/vm.rb
+++ b/lib/vagrant/vm.rb
@@ -53,8 +53,8 @@ module Vagrant
system ||= env.config.vm.system
if system.is_a?(Class)
+ raise Errors::VMSystemError, :_key => :invalid_class, :system => system.to_s if !(system <= Systems::Base)
@system = system.new(self)
- raise Errors::VMSystemError, :_key => :invalid_class, :system => system.to_s if !@system.is_a?(Systems::Base)
elsif system.is_a?(Symbol)
# Hard-coded internal systems
mapping = { | System superclass check can be done prior to instantiating
This also fixes a <I> incompatibility. | hashicorp_vagrant | train | rb |
02eaf0d8c854a8f26f571dd11e7ad03098d15912 | diff --git a/lib/octopress-ink/assets/page.rb b/lib/octopress-ink/assets/page.rb
index <HASH>..<HASH> 100644
--- a/lib/octopress-ink/assets/page.rb
+++ b/lib/octopress-ink/assets/page.rb
@@ -39,7 +39,6 @@ module Octopress
def page
unless @page
@page = Page.new(Octopress.site, source_dir, page_dir, file, plugin.config)
- @page.data['permalink'] ||= page_dir
end
@page
end | Auto permalinks are bad, mkay | octopress_ink | train | rb |
512a7ec38eab36fe17312b34b39dd511e632cfdd | diff --git a/shinken/modules/mongodb_generic.py b/shinken/modules/mongodb_generic.py
index <HASH>..<HASH> 100644
--- a/shinken/modules/mongodb_generic.py
+++ b/shinken/modules/mongodb_generic.py
@@ -182,3 +182,25 @@ class Mongodb_generic(BaseModule):
u[key] = value
print '[Mongodb] Just saving the new key in the user pref'
self.db.ui_user_preferences.save(u)
+
+ def set_ui_common_preference(self, key, value):
+ if not self.db:
+ print "[Mongodb]: error Problem during init phase"
+ return None
+
+ # check a collection exist for this user
+ u = self.db.ui_user_preferences.find_one({'_id': 'shinken-global'})
+
+ if not u:
+ # no collection for this user? create a new one
+ print "[Mongodb] No common entry, I create a new one"
+ r = self.db.ui_user_preferences.save({'_id': 'shinken-global', key: value})
+ else:
+ # found a collection for this user
+ print "[Mongodb] common entry found. Updating"
+ r = self.db.ui_user_preferences.update({'_id': 'shinken-global'}, {'$set': {key: value}})
+
+ if not r:
+ print "[Mongodb]: error Problem during update/insert phase"
+ return None
+ | Add the function to save common prefs | Alignak-monitoring_alignak | train | py |
d129a333e1e34dbbb53d2031d7476d9f0bfbfd5f | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -23,7 +23,7 @@ def readme():
def version():
- return '0.1.9'
+ return '0.2.0'
setuptools.setup( | Update version to <I>. All tests pass on <I>+. <I> is no longer explicitly supported, but should still work. <I> is not yet fully supported, as it is still in beta. | iansf_qj | train | py |
f5332ee97af2cc935b997451f4566bb2768eb35f | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,3 +1,5 @@
+import os
+import sys
from setuptools import find_packages, setup
VERSION = "2.0.0"
@@ -63,6 +65,13 @@ Supported Django and Python Versions
+-----------------+-----+-----+-----+-----+
"""
+
+# Publish Helper.
+if sys.argv[-1] == 'publish':
+ os.system('python setup.py sdist bdist_wheel upload')
+ sys.exit()
+
+
setup(
author="Pinax Team",
author_email="team@pinaxprojects.com", | Add publish helper to setup.py | pinax_pinax-templates | train | py |
6bfb67ee5e09e65ae4a9966754aeb8f2c7923cd6 | diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/tooltip.js b/bundles/org.eclipse.orion.client.editor/web/orion/editor/tooltip.js
index <HASH>..<HASH> 100644
--- a/bundles/org.eclipse.orion.client.editor/web/orion/editor/tooltip.js
+++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/tooltip.js
@@ -750,6 +750,7 @@ function Tooltip (view, editor) {
iframe.style.border = "none"; //$NON-NLS-0$
iframe.style.width = "100%"; //$NON-NLS-0$
iframe.style.height = "100%"; //$NON-NLS-0$
+ iframe.style.overflow = "auto"; //$NON-NLS-1$
// TODO The iframe computed height is always 3px smaller than the tooltip, giving the impression of inconsistent padding
this._tooltipDiv.style.paddingBottom = "5px"; //$NON-NLS-0$
iframe.srcdoc = data.content; | [nobug] - Allow scroll bars on Safari | eclipse_orion.client | train | js |
0d7698c6599bf10392100391f2591e874b5ba015 | diff --git a/lib/connector/Connector.js b/lib/connector/Connector.js
index <HASH>..<HASH> 100644
--- a/lib/connector/Connector.js
+++ b/lib/connector/Connector.js
@@ -44,7 +44,7 @@ class Connector {
}
} else if (host != 'localhost' && /^[a-z0-9-]*$/.test(host)) {
//handle app names as hostname
- host += secure? Connector.SSL_DOMAIN: Connector.HTTP_DOMAIN;
+ host += Connector.HTTP_DOMAIN;
}
if (!port)
@@ -247,7 +247,6 @@ class Connector {
Object.assign(Connector, /** @lends connector.Connector */ {
DEFAULT_BASE_PATH: '/v1',
HTTP_DOMAIN: '.app.baqend.com',
- SSL_DOMAIN: '-bq.global.ssl.fastly.net',
/**
* An array of all exposed response headers | Change SDK secure app domain connection string | Baqend_js-sdk | train | js |
89f7d8153a2b59ee1fbce405ba265016ec960df1 | diff --git a/sources/kubelet.go b/sources/kubelet.go
index <HASH>..<HASH> 100644
--- a/sources/kubelet.go
+++ b/sources/kubelet.go
@@ -229,7 +229,7 @@ func NewKubeletProvider(uri *url.URL) (MetricsSourceProvider, error) {
// watch nodes
lw := cache.NewListWatchFromClient(kubeClient, "nodes", kube_api.NamespaceAll, fields.Everything())
nodeLister := &cache.StoreToNodeLister{Store: cache.NewStore(cache.MetaNamespaceKeyFunc)}
- reflector := cache.NewReflector(lw, &kube_api.Node{}, nodeLister.Store, 0)
+ reflector := cache.NewReflector(lw, &kube_api.Node{}, nodeLister.Store, time.Hour)
reflector.Run()
return &kubeletProvider{ | Set node list refresh to 1 hour | kubernetes-retired_heapster | train | go |
19258939295bfe543687740d5352643f2bf73b8c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -25,6 +25,15 @@ setup(
'numpy',
'scipy',
],
+ scripts=[
+ 'scripts/sv_classifier.py',
+ 'scripts/update_info.py',
+ 'scripts/vcf_allele_freq.py',
+ 'scripts/vcf_group_multiline.py',
+ 'scripts/vcf_modify_header.py',
+ 'scripts/vcf_paste.py',
+ 'scripts/lib_stats.R',
+ ],
entry_points='''
[console_scripts]
svtyper=svtyper:main | + scripts to be installed in the bin directory | hall-lab_svtyper | train | py |
76a5e6385aec557a2d0942da9135831f5b3f3b44 | diff --git a/src/visualCaptcha/Captcha.php b/src/visualCaptcha/Captcha.php
index <HASH>..<HASH> 100644
--- a/src/visualCaptcha/Captcha.php
+++ b/src/visualCaptcha/Captcha.php
@@ -277,7 +277,7 @@ class Captcha {
}
// Stream file from path
- private function utilStreamFile( $headers, $filePath ) {
+ private function utilStreamFile( &$headers, $filePath ) {
if ( !file_exists( $filePath ) ) {
return false;
} | [FIX] Adding the pointer on the functions definition:
utilStreamFile
streamAudio
streamImage | desirepath41_visualCaptcha-packagist | train | php |
0e2a018a1f0636c91567fc55a86a0f025ad0185c | diff --git a/lib/hammer_cli_katello/organization.rb b/lib/hammer_cli_katello/organization.rb
index <HASH>..<HASH> 100644
--- a/lib/hammer_cli_katello/organization.rb
+++ b/lib/hammer_cli_katello/organization.rb
@@ -18,6 +18,7 @@ module HammerCLIKatello
output do
field :label, _("Label")
field :description, _("Description")
+ field :redhat_repository_url, _("Red Hat Repository URL")
end
end | Fixes #<I> - Display redhat repo url
Added a line to display the redhat repository url
for a given org, since there is no place to determine
that after the removal of providers subcommand in hammer | Katello_hammer-cli-katello | train | rb |
5316708099df93b7de2d82b838b6647283c94ae6 | diff --git a/tsfresh/feature_extraction/settings.py b/tsfresh/feature_extraction/settings.py
index <HASH>..<HASH> 100644
--- a/tsfresh/feature_extraction/settings.py
+++ b/tsfresh/feature_extraction/settings.py
@@ -100,7 +100,8 @@ class FeatureExtractionSettings(object):
})
# default None means one procesqs per cpu
- self.n_processes = int(int(os.getenv("NUMBER_OF_CPUS") or cpu_count())/2)
+ n_cores = int(os.getenv("NUMBER_OF_CPUS") or cpu_count())
+ self.n_processes = max(1, n_cores//2)
def set_default_parameters(self, kind):
""" | fixed calculation of processes if only one core available | blue-yonder_tsfresh | train | py |
6f1d827096ad9f1044a6da7141e7ae720a64ec6b | diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb
index <HASH>..<HASH> 100644
--- a/activesupport/lib/active_support/time_with_zone.rb
+++ b/activesupport/lib/active_support/time_with_zone.rb
@@ -198,9 +198,9 @@ module ActiveSupport
end
def advance(options)
- # If we're advancing a value of variable length (i.e., years, months, days), advance from #time,
+ # If we're advancing a value of variable length (i.e., years, weeks, months, days), advance from #time,
# otherwise advance from #utc, for accuracy when moving across DST boundaries
- if options.detect {|k,v| [:years, :months, :days].include? k}
+ if options.detect {|k,v| [:years, :weeks, :months, :days].include? k}
method_missing(:advance, options)
else
utc.advance(options).in_time_zone(time_zone) | TimeWithZone#advance: treat :weeks option as variable-length | rails_rails | train | rb |
bbf1704b9f89e36991ecb7380c55175f5b6155b0 | diff --git a/bin/cli.js b/bin/cli.js
index <HASH>..<HASH> 100755
--- a/bin/cli.js
+++ b/bin/cli.js
@@ -15,6 +15,10 @@ var options = Type.coerceValues(camelcaseKeys(argv, { deep: true }), {
"middlewares": Type.Array.withTransform(toArray)
});
+if (options._.length && !options.root) {
+ options.root = options._[0];
+}
+
if (options.test) {
console.log(JSON.stringify(options));
} | adding the ability to set the root directory to whatever is passed in a single argument. e.g. `3dub .` | MiguelCastillo_3dub | train | js |
962f36d1072e405da8b8c49e610ce2aa06a07e2c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@ except ImportError:
setup(
name='mock-django',
- version='0.6.5',
+ version='0.6.6',
description='',
license='Apache License 2.0',
author='David Cramer',
@@ -19,7 +19,7 @@ setup(
url='http://github.com/dcramer/mock-django',
packages=find_packages(),
install_requires=[
- 'Django>=1.2',
+ 'Django>=1.4',
'mock',
],
tests_require=[ | Bump mock-django version | dcramer_mock-django | train | py |
5aa1e0863319f80559bd54fe7f26a44797509713 | diff --git a/python/ray/serve/backend_worker.py b/python/ray/serve/backend_worker.py
index <HASH>..<HASH> 100644
--- a/python/ray/serve/backend_worker.py
+++ b/python/ray/serve/backend_worker.py
@@ -90,6 +90,9 @@ def create_backend_replica(name: str, serialized_backend_def: bytes):
backend_config.user_config, version,
is_function, controller_handle)
+ # asyncio.Event used to signal that the replica is shutting down.
+ self.shutdown_event = asyncio.Event()
+
@ray.method(num_returns=2)
async def handle_request(
self,
@@ -112,11 +115,11 @@ def create_backend_replica(name: str, serialized_backend_def: bytes):
return self.backend.version
async def prepare_for_shutdown(self):
+ self.shutdown_event.set()
return await self.backend.prepare_for_shutdown()
async def run_forever(self):
- while True:
- await asyncio.sleep(10000)
+ await self.shutdown_event.wait()
RayServeWrappedReplica.__name__ = name
return RayServeWrappedReplica | [Serve] Exit run_forever when actor shutdown (#<I>) | ray-project_ray | train | py |
d3f82eebf78d56448be1d025ada43313773664f3 | diff --git a/emirdrp/recipes/spec/stare.py b/emirdrp/recipes/spec/stare.py
index <HASH>..<HASH> 100644
--- a/emirdrp/recipes/spec/stare.py
+++ b/emirdrp/recipes/spec/stare.py
@@ -155,7 +155,7 @@ class StareSpectraWaveRecipe(EmirRecipe):
if rinput.refine_wavecalib_mode != 0:
self.logger.info('Refining wavelength calibration')
# refine RectWaveCoeff object
- rectwv_coeff, expected_oh_lines = refine_rectwv_coeff(
+ rectwv_coeff, expected_catalog_lines = refine_rectwv_coeff(
stare_image,
rectwv_coeff,
rinput.refine_wavecalib_mode,
@@ -163,8 +163,8 @@ class StareSpectraWaveRecipe(EmirRecipe):
rinput.maximum_slitlet_width_mm,
debugplot=12
)
- self.save_intermediate_img(expected_oh_lines,
- 'expected_oh_lines.fits')
+ self.save_intermediate_img(expected_catalog_lines,
+ 'expected_catalog_lines.fits')
# re-apply rectification and wavelength calibration
stare_image = apply_rectwv_coeff(
reduced_image, | Rename output FITS file with expected catalogued lines | guaix-ucm_pyemir | train | py |
8ad1c255dfbbcfd721a918cd53c7064a7bd8bfd3 | diff --git a/modules/SS2/Record.js b/modules/SS2/Record.js
index <HASH>..<HASH> 100644
--- a/modules/SS2/Record.js
+++ b/modules/SS2/Record.js
@@ -121,6 +121,15 @@ module.exports = class Record {
this.sublists[sublistId][line][fieldId] = value
}
+ setSublistValue(options){
+ const sublistId = options.sublistId;
+ const fieldId = options.fieldId;
+ const value = options.value;
+ const line = options.line;
+
+ this.sublists[sublistId][line][fieldId] = value
+ }
+
getSublistValue(options){
const sublistId = options.sublistId;
const index = options.line;
@@ -165,6 +174,5 @@ module.exports = class Record {
setMatrixHeaderValue(options){}
setMatrixSublistValue(options){}
setSublistText(options){}
- setSublistValue(options){}
setText(options){}
} | Adding support for setSublistValue | 3EN-Cloud_netsumo | train | js |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.