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 |
|---|---|---|---|---|---|
b3371c6117c8963ee219508a565d61bc00c6b035 | diff --git a/lib/ember-cli/app.rb b/lib/ember-cli/app.rb
index <HASH>..<HASH> 100644
--- a/lib/ember-cli/app.rb
+++ b/lib/ember-cli/app.rb
@@ -99,15 +99,15 @@ module EmberCLI
end
def lockfile
- tmp_path.join("build.lock")
+ @lockfile ||= tmp_path.join("build.lock")
end
def check_for_build_error!
- raise_build_error! if build_error_file.exist?
+ raise_build_error! if build_error?
end
def build_error_file
- tmp_path.join("error.txt")
+ @build_error_file ||= tmp_path.join("error.txt")
end
def reset_build_error! | Cache build error and lockfile paths
This saves two Pathname#join calls per middleware request. | thoughtbot_ember-cli-rails | train | rb |
419783a250d00726d07738f6c3b69ae964e7c65a | diff --git a/src/main/java/com/sdl/selenium/web/table/SimpleTable.java b/src/main/java/com/sdl/selenium/web/table/SimpleTable.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/sdl/selenium/web/table/SimpleTable.java
+++ b/src/main/java/com/sdl/selenium/web/table/SimpleTable.java
@@ -282,6 +282,8 @@ public class SimpleTable extends WebLocator implements ITable <TableRow, TableCe
public boolean waitToPopulate(int seconds) {
Row row = getRowLocator(1).setInfoMessage("first row");
+ WebLocator body = new WebLocator(this).setTag("tbody"); // TODO see if must add for all rows
+ row.setContainer(body);
return row.waitToRender(seconds);
} | fix waitToPopulate when table has thead (add tbody as container) | sdl_Testy | train | java |
94db2503c3a39c93201493e6fb6b8690dfd278c8 | diff --git a/cobra/core/Gene.py b/cobra/core/Gene.py
index <HASH>..<HASH> 100644
--- a/cobra/core/Gene.py
+++ b/cobra/core/Gene.py
@@ -81,7 +81,7 @@ class Gene(Species):
for the_reaction in self._reaction:
the_reaction.gene_reaction_rule = the_gene_re.sub(gene_state,
the_reaction.gene_reaction_rule)
- the_reaction._genes.pop(self)
+ the_reaction._genes.remove(self)
#Now deactivate the reaction if its gene association evaluates to False
the_gene_reaction_relation = the_reaction.gene_reaction_rule
for other_gene in the_reaction._genes: | Fixed a bug in remove gene.
Replaced pop() with the correct function, remove(). | opencobra_cobrapy | train | py |
2fc9bef6e2571f8a656e1a5e2eb65ef766b6e42d | diff --git a/code/Subsite.php b/code/Subsite.php
index <HASH>..<HASH> 100644
--- a/code/Subsite.php
+++ b/code/Subsite.php
@@ -557,9 +557,10 @@ JS;
}
static function get_from_all_subsites($className, $filter = "", $sort = "", $join = "", $limit = "") {
+ $oldState = self::$disable_subsite_filter;
self::$disable_subsite_filter = true;
$result = DataObject::get($className, $filter, $sort, $join, $limit);
- self::$disable_subsite_filter = false;
+ self::$disable_subsite_filter = $oldState;
return $result;
} | BUGFIX reset subsite filter to false (from r<I>) | silverstripe_silverstripe-subsites | train | php |
70f60f22f3ffeeb31d75e4a110c35aefa5b44719 | diff --git a/pypot/primitive/primitive.py b/pypot/primitive/primitive.py
index <HASH>..<HASH> 100644
--- a/pypot/primitive/primitive.py
+++ b/pypot/primitive/primitive.py
@@ -196,7 +196,6 @@ class MockupRobot(object):
m = getattr(self, motor_name)
m.goto_position(position, duration, control, wait=w)
-
@property
def motors(self):
""" List of all attached :class:`~pypot.primitive.primitive.MockupMotor`. """
diff --git a/pypot/utils/stoppablethread.py b/pypot/utils/stoppablethread.py
index <HASH>..<HASH> 100644
--- a/pypot/utils/stoppablethread.py
+++ b/pypot/utils/stoppablethread.py
@@ -51,10 +51,8 @@ class StoppableThread(object):
if self.started:
self._running.clear()
- if wait:
- if threading.current_thread() == self._thread:
- raise RuntimeError('Cannot wait for current thread')
-
+ # We cannot wait for ourself
+ if wait and (threading.current_thread != self._thread):
self._thread.join()
self._started.clear() | Change the behaviour of the stop method in the stoppable thread. Now when you try to stop from within the thread it will not wait by default. | poppy-project_pypot | train | py,py |
35134c2f6521cf6108ec57b9b15872aad9ef0b7c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,7 @@ with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
setup(
name='nyaalib',
- version='0.0.6',
+ version='0.0.7',
description='Python library for Nyaa',
long_description=readme,
url='https://github.com/kennydo/nyaalib', | bumping version to <I> | kennydo_nyaalib | train | py |
a9c2f73e801dc16f27e10c93efac692623b94772 | diff --git a/salt/states/file.py b/salt/states/file.py
index <HASH>..<HASH> 100644
--- a/salt/states/file.py
+++ b/salt/states/file.py
@@ -625,7 +625,8 @@ def recurse(name, source, __env__='base'):
os.path.join(
__opts__['cachedir'],
'files',
- __env__
+ __env__,
+ source[7:]
)
)
) | fix path issue in recurse function for deep dirs on the salt master | saltstack_salt | train | py |
7ee8c8e2757c389b03765565b900b0929094b778 | diff --git a/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java b/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java
index <HASH>..<HASH> 100644
--- a/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java
+++ b/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java
@@ -3143,7 +3143,7 @@ public abstract class DevUtil extends AbstractContainerSupportUtil {
// force run tests across all modules in multi module scenario
File[] buildFiles = getAllBuildFiles();
runTestThread(false, executor, -1, skipUTs, true, buildFiles);
- } else if (testSourceDirectory.exists()) {
+ } else {
runTestThread(false, executor, -1, skipUTs, false, buildFile);
}
} | Always run tests on startup for hotTests scenario (#<I>) | WASdev_ci.common | train | java |
d16986484add8d9f234650f588fe04fad25ce76d | diff --git a/commands/browse.go b/commands/browse.go
index <HASH>..<HASH> 100644
--- a/commands/browse.go
+++ b/commands/browse.go
@@ -77,7 +77,9 @@ func browse(command *Command, args *Args) {
utils.Check(err)
} else {
currentBranch, err := localRepo.CurrentBranch()
- utils.Check(err)
+ if err != nil {
+ currentBranch = localRepo.MasterBranch()
+ }
branch, project, _ = localRepo.RemoteBranchAndProject("", currentBranch.IsMaster())
if branch == nil { | Fix `browse` command when on detached HEAD | github_hub | train | go |
d84f8688ff38b0382d29fcc57c2ed7db8c8fdf21 | diff --git a/src/Carousel.js b/src/Carousel.js
index <HASH>..<HASH> 100644
--- a/src/Carousel.js
+++ b/src/Carousel.js
@@ -90,6 +90,9 @@ class Carousel extends Base {
list: {
attributes: {
tabindex: ''
+ },
+ style: {
+ outline: 'none'
}
},
stage: { | Suppress carousel strip's focus indicator for Firefox. | elix_elix | train | js |
38bc4aee06b0896b000ec87a831af871400912ad | diff --git a/concrete/src/Updater/Migrations/Migrations/Version20180628101509.php b/concrete/src/Updater/Migrations/Migrations/Version20180628101509.php
index <HASH>..<HASH> 100644
--- a/concrete/src/Updater/Migrations/Migrations/Version20180628101509.php
+++ b/concrete/src/Updater/Migrations/Migrations/Version20180628101509.php
@@ -57,5 +57,25 @@ class Version20180628101509 extends AbstractMigration implements RepeatableMigra
$category = Category::getByHandle('event')->getController();
$category->associateAttributeKeyType($type);
}
+
+ $db = $this->connection;
+ if ($db->tableExists('atUserSelector')) {
+ // This is the name of the user selector attribute table in some implementations of the user selector attribute
+ // We need to take this data and place it into atNumber.
+ $db->query(<<<EOT
+insert into atNumber (avID, value)
+ select
+ atUserSelector.avID, atUserSelector.value
+ from
+ atUserSelector
+ inner join
+ AttributeValues on atUserSelector.avID = AttributeValues.avID
+ left join
+ atNumber on atUserSelector.avID = atNumber.avID
+ where
+ atNumber.avID is null
+EOT
+ );
+ }
}
} | update migration to include potential existing data in atUserSelector | concrete5_concrete5 | train | php |
ffb771a6b91330c03ca2c09e57f5eff1e2e3d862 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -146,7 +146,7 @@ module.exports.parseTintString = function(str) {
module.exports.upgradeTintString = function(old,round) {
if (!old || !old.length) return old;
- if(old.match(/^#?([0-9a-f]{6})$/i)) return old;
+ if (old.match(/^#?([0-9a-f]{6})$/i) || old.indexOf('x') !== -1) return old;
var new_tint = '';
var parts = old.split(';');
if (parts.length > 0) { | Pass-thru on upgrade attempts of new-style tintstrings. | mapbox_node-blend | train | js |
1ef0d9acc4631f65a2af8df37660bd44bdc9f244 | diff --git a/examples/change_topic_status.rb b/examples/change_topic_status.rb
index <HASH>..<HASH> 100644
--- a/examples/change_topic_status.rb
+++ b/examples/change_topic_status.rb
@@ -7,7 +7,7 @@ client.api_key = "YOUR_API_KEY"
client.api_username = "YOUR_USERNAME"
response = client.create_topic(
- category: "Boing Boing",
+ category: 1,
skip_validations: true,
auto_track: false,
title: "Concert Master: A new way to choose",
diff --git a/examples/create_topic.rb b/examples/create_topic.rb
index <HASH>..<HASH> 100644
--- a/examples/create_topic.rb
+++ b/examples/create_topic.rb
@@ -7,7 +7,7 @@ client.api_key = "YOUR_API_KEY"
client.api_username = "YOUR_USERNAME"
client.create_topic(
- category: "Boing Boing",
+ category: 1,
skip_validations: true,
auto_track: false,
title: "Concert Master: A new way to choose",
@@ -16,7 +16,7 @@ client.create_topic(
# create Poll topic
client.create_topic(
- category: "general",
+ category: 2,
skip_validations: false,
auto_track: false,
title: "Your Favorite Color?", | Fix examples that create topic using category name strings
Only category id is supported as argument after this change:
<URL> | discourse_discourse_api | train | rb,rb |
810ed0b7475d813e734ae05ed76bf49ffac206ed | diff --git a/documentation/manual/tutorial/code/javaguide/hello/HelloController.java b/documentation/manual/tutorial/code/javaguide/hello/HelloController.java
index <HASH>..<HASH> 100644
--- a/documentation/manual/tutorial/code/javaguide/hello/HelloController.java
+++ b/documentation/manual/tutorial/code/javaguide/hello/HelloController.java
@@ -17,11 +17,15 @@ public class HelloController extends Controller {
// #hello-world-index-action
public Result index() {
<<<<<<< HEAD
+<<<<<<< HEAD
// ###replace: return ok(views.html.index.render("Your new application is
// ready."));
return ok(javaguide.hello.html.index.render("Your new application is ready."));
=======
// ###replace: return ok(views.html.index.render("Your new application is ready.", assetsFinder));
+=======
+// ###replace: return ok(views.html.index.render("Your new application is ready.", assetsFinder));
+>>>>>>> 6a56b9b225 (moved comment left)
return ok(javaguide.hello.html.index.render("Your new application is ready.", assetsFinder));
>>>>>>> e3c37f9ed1 (Fixed `###replace:` tag that led to incorrect docs)
} | moved comment left
Hopefully, the comment has been moved left enough that it won't be split by the formatter. Let's see what the build says
(cherry picked from commit 6a<I>b9b<I>c1c1e5d<I>e<I>cb0c<I>b4cf<I>)
# Conflicts:
# documentation/manual/tutorial/code/javaguide/hello/HelloController.java | playframework_playframework | train | java |
9d42bb061360dd5b4dbbe1c80c12199e69e986fc | diff --git a/external/elasticsearch/src/main/java/com/digitalpebble/stormcrawler/elasticsearch/parse/filter/JSONResourceWrapper.java b/external/elasticsearch/src/main/java/com/digitalpebble/stormcrawler/elasticsearch/parse/filter/JSONResourceWrapper.java
index <HASH>..<HASH> 100644
--- a/external/elasticsearch/src/main/java/com/digitalpebble/stormcrawler/elasticsearch/parse/filter/JSONResourceWrapper.java
+++ b/external/elasticsearch/src/main/java/com/digitalpebble/stormcrawler/elasticsearch/parse/filter/JSONResourceWrapper.java
@@ -59,7 +59,7 @@ import org.w3c.dom.DocumentFragment;
* The resource file can be pushed to ES with
*
* <pre>
- * curl -XPUT 'localhost:9200/config/config/collections.json?pretty' -H 'Content-Type: application/json' -d @collections.json
+ * curl -XPUT "$ESHOST/config/_create/collections.json" -H 'Content-Type: application/json' -d @src/main/resources/collections.json
* </pre>
*/
public class JSONResourceWrapper extends ParseFilter { | Update JSONResourceWrapper.java
fix javadoc showing how to push resource file | DigitalPebble_storm-crawler | train | java |
99357b6672a3ec2abfd45ce1901171d97e31221f | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -123,5 +123,13 @@ module.exports = exports = defineProperties(function (msg) {
return ((x > 0) ? exports.right(x) : exports.left(-x)) +
((y > 0) ? exports.down(y) : exports.up(-y));
}),
- beep: d('cew', '\x07')
+ beep: d('cew', '\x07'),
+ bol: d('cew', function (n) {
+ n = isNaN(n) ? 0 : floor(n);
+ if (n >= 0) {
+ return '\x1b[' + n + 'E';
+ } else {
+ return '\x1b[' + n + 'F';
+ }
+ })
})); | bol (move to begining of line) function | medikoo_cli-color | train | js |
2060bf2c42762f9c853305a1ecefcd826156b608 | diff --git a/includes/class-freemius.php b/includes/class-freemius.php
index <HASH>..<HASH> 100755
--- a/includes/class-freemius.php
+++ b/includes/class-freemius.php
@@ -19081,7 +19081,6 @@
*
* @param string $url
* @param array $request
- * @param string|bool $cache_key
* @param int $success_cache_expiration
* @param int $failure_cache_expiration
*
@@ -19090,10 +19089,11 @@
$url,
private static function safe_remote_post(
$request,
- $cache_key = false,
$success_cache_expiration = 0,
$failure_cache_expiration = 0
) {
+ $cache_key = $should_cache ? md5( fs_strip_url_protocol($url) . json_encode( $request ) ) : false;
+
$response = ( false !== $cache_key ) ?
get_transient( $cache_key ) :
false;
@@ -20144,7 +20144,6 @@
$response = $this->safe_remote_post(
$url,
$request,
- 'fs_user_plugins_' . md5( $user_email . implode( ',', $plugin_ids_set ) ),
WP_FS__TIME_24_HOURS_IN_SEC,
WP_FS__TIME_12_HOURS_IN_SEC
); | [api] [safe-remote-post] The cache key of the request can be generated right in the method (no need to have it as an external argument). | Freemius_wordpress-sdk | train | php |
7bb9f0a3e28ac00080703a1050f1c06a2d21a2da | diff --git a/h2o-algos/src/main/java/hex/ensemble/Metalearners.java b/h2o-algos/src/main/java/hex/ensemble/Metalearners.java
index <HASH>..<HASH> 100644
--- a/h2o-algos/src/main/java/hex/ensemble/Metalearners.java
+++ b/h2o-algos/src/main/java/hex/ensemble/Metalearners.java
@@ -212,8 +212,7 @@ public class Metalearners {
//specific to AUTO mode
parms._non_negative = true;
//parms._alpha = new double[] {0.0, 0.25, 0.5, 0.75, 1.0};
- //parms._alpha = new double[] {0.5, 1.0};
- parms._alpha = new double[] {1.0};
+ parms._alpha = new double[] {0.5, 1.0};
// feature columns are already homogeneous (probabilities); when standardization is enabled,
// there can be information loss if some columns have very low probabilities compared with others for example (bad model) | PUBDEV-<I>: Update alpha to [<I>,<I>] in AutoML GLM metalearner | h2oai_h2o-3 | train | java |
0fad116c6c2a01a8632c35db1484955a6dcc42ef | diff --git a/structs.go b/structs.go
index <HASH>..<HASH> 100644
--- a/structs.go
+++ b/structs.go
@@ -1213,6 +1213,7 @@ const (
ActivityTypeListening ActivityType = 2
ActivityTypeWatching ActivityType = 3
ActivityTypeCustom ActivityType = 4
+ ActivityTypeCompeting ActivityType = 5
)
// Identify is sent during initial handshake with the discord gateway. | feat: add ActivityTypeCompeting (5) (#<I>) | bwmarrin_discordgo | train | go |
ca2efa989b0db5a6d112281716ee5b85b5b635e6 | diff --git a/lib/trestle/admin/controller.rb b/lib/trestle/admin/controller.rb
index <HASH>..<HASH> 100644
--- a/lib/trestle/admin/controller.rb
+++ b/lib/trestle/admin/controller.rb
@@ -23,6 +23,13 @@ module Trestle
def breadcrumbs
@breadcrumbs ||= admin.breadcrumbs.dup
end
+
+ def flash_message(type, title:, message:)
+ {
+ title: admin.t("flash.#{type}.title", default: title),
+ message: admin.t("flash.#{type}.message", default: message)
+ }
+ end
end
end
end
diff --git a/lib/trestle/resource/controller.rb b/lib/trestle/resource/controller.rb
index <HASH>..<HASH> 100644
--- a/lib/trestle/resource/controller.rb
+++ b/lib/trestle/resource/controller.rb
@@ -148,13 +148,6 @@ module Trestle
attr_accessor :instance, :collection
helper_method :instance, :collection
- def flash_message(type, title:, message:)
- {
- title: admin.t("flash.#{type}.title", default: title),
- message: admin.t("flash.#{type}.message", default: message)
- }
- end
-
def redirect_to_return_location(action, instance, default:)
if admin.return_locations[action] && !dialog_request?
location = instance_exec(instance, &admin.return_locations[action]) | Promote #flash_message from Resource controller to Admin controller | TrestleAdmin_trestle | train | rb,rb |
0a09ad6040d0185c1ac85aea404d4e27d270ddb1 | diff --git a/development_fabfile/fabfile/remote.py b/development_fabfile/fabfile/remote.py
index <HASH>..<HASH> 100644
--- a/development_fabfile/fabfile/remote.py
+++ b/development_fabfile/fabfile/remote.py
@@ -7,26 +7,27 @@ from development_fabfile.fabfile.utils import require_server
@require_server
-def run_restart_apache():
+def run_git_pull():
"""
- Restarts apache on the given server.
+ Pulls the latest code and updates submodules.
Usage::
- fab <server> run_restart_apache
+ fab <server> run_git_pull
"""
- run('{0}restart'.format(settings.SERVER_APACHE_BIN_DIR))
+ with cd(settings.SERVER_REPO_ROOT):
+ run('git pull && git submodule init && git submodule update')
-def run_git_pull():
+@require_server
+def run_restart_apache():
"""
- Pulls the latest code and updates submodules.
+ Restarts apache on the given server.
Usage::
- fab <server> run_git_pull
+ fab <server> run_restart_apache
"""
- with cd(settings.SERVER_REPO_ROOT):
- run('git pull && git submodule init && git submodule update')
+ run('{0}restart'.format(settings.SERVER_APACHE_BIN_DIR)) | Added require_server decorator to run_git_pull | bitlabstudio_django-development-fabfile | train | py |
0af5c10cf19462f27e43914b8dbed81e5b0f53ae | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -16,6 +16,7 @@ setup(
description="Python REPL build on top of prompt_toolkit",
long_description=long_description,
packages=find_packages("."),
+ package_data={"ptpython": ["py.typed"]},
install_requires=[
"appdirs",
"importlib_metadata;python_version<'3.8'", | Added py.typed to package_data in setup.py | prompt-toolkit_ptpython | train | py |
e84b8faeecf7ed76b2a81e2eeaac09bdf6b15ff6 | diff --git a/lib/mongoid/archivable.rb b/lib/mongoid/archivable.rb
index <HASH>..<HASH> 100644
--- a/lib/mongoid/archivable.rb
+++ b/lib/mongoid/archivable.rb
@@ -12,7 +12,7 @@ module Mongoid
end
def original_document
- excluded_attributes = %i(_id original_id original_type archived_at)
+ excluded_attributes = %w(_id original_id original_type archived_at)
original_class_name.constantize.new(attributes.except(*excluded_attributes)) do |doc|
doc.id = original_id
end
@@ -36,7 +36,7 @@ module Mongoid
include Mongoid::Document
include Mongoid::Attributes::Dynamic
include Mongoid::Archivable::Restoration
-
+
field :archived_at, type: Time
field :original_id, type: String
field :original_type, type: String | make sure that excluded attrs are stings | Sign2Pay_mongoid-archivable | train | rb |
738c3e74882e3f312bee908f6a11dd192b1756e1 | diff --git a/src/pybel/parser/utils.py b/src/pybel/parser/utils.py
index <HASH>..<HASH> 100644
--- a/src/pybel/parser/utils.py
+++ b/src/pybel/parser/utils.py
@@ -12,8 +12,7 @@ re_match_bel_header = re.compile("(SET\s+DOCUMENT|DEFINE\s+NAMESPACE|DEFINE\s+AN
def sanitize_file_lines(f):
"""Enumerates a line iterator and returns the pairs of (line number, line) that are cleaned"""
it = (line.strip() for line in f)
- it = filter(lambda i_l: i_l[1] and not i_l[1].startswith('#'), enumerate(it, start=1))
- it = iter(it)
+ it = ((line_number, line) for line_number, line in enumerate(it, start=1) if line and not line.startswith('#'))
for line_number, line in it:
if line.endswith('\\'): | Update readability of BEL line reader
Closes #<I>
This isn’t an issue I want to solve. Fix your BEL document encodings
and get rid of dumb characters in them. | pybel_pybel | train | py |
77882dd44acb6d5d38a9eda273780693709923ce | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@
from setuptools import setup
-with open('pull_into_place/__meta__.py') as file:
+with open('pull_into_place/__init__.py') as file:
exec file.read()
with open('README.rst') as file:
@@ -52,7 +52,7 @@ setup(
install_requires=[
'klab',
],
- extras_require = {
+ extras_require={
'analysis': [
'numpy',
'scipy',
@@ -66,7 +66,7 @@ setup(
'weblogo',
],
},
- entry_points = {
+ entry_points={
'console_scripts': [
'pull_into_place=pull_into_place.main:main',
],
@@ -90,5 +90,4 @@ setup(
define_command('plot_funnels', '[analysis]'),
],
},
- include_package_data=True,
) | Move package metadata to __init__.py
I preferred having it in __meta__.py, but for some reason that file
couldn't be imported into __init__.py. | Kortemme-Lab_pull_into_place | train | py |
22f4c4fe3c82222038a12630cec48a757f1192ca | diff --git a/bedup/filesystem.py b/bedup/filesystem.py
index <HASH>..<HASH> 100644
--- a/bedup/filesystem.py
+++ b/bedup/filesystem.py
@@ -87,6 +87,7 @@ class WholeFS(object):
).filter(
~ BtrfsFilesystem.id.in_(seen_fs_ids)
):
+ uuid, = uuid
yield self.get_fs(uuid), None
def get_vol(self, volpath, size_cutoff): | Fix the query for removed filesystems. | g2p_bedup | train | py |
87ae85d5360ac8965f2467680e556c1f94806ba8 | diff --git a/activerecord/lib/active_record/attribute_methods/primary_key.rb b/activerecord/lib/active_record/attribute_methods/primary_key.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/attribute_methods/primary_key.rb
+++ b/activerecord/lib/active_record/attribute_methods/primary_key.rb
@@ -24,7 +24,7 @@ module ActiveRecord
end
def get_primary_key(base_name) #:nodoc:
- return unless base_name && !base_name.blank?
+ return 'id' unless base_name && !base_name.blank?
case primary_key_prefix_type
when :table_name | returning id (for some yet to be discovered reason) | rails_rails | train | rb |
47524f0f94a867781788312c066ec07923bf9c6c | diff --git a/tests/test_ode.py b/tests/test_ode.py
index <HASH>..<HASH> 100644
--- a/tests/test_ode.py
+++ b/tests/test_ode.py
@@ -233,7 +233,7 @@ def test_initial_parameters():
k, p, l, m = parameters('k, p, l, m')
a0 = Parameter('a0', min=0, value=10, fixed=True)
- c0 = Parameter('c0', min=0, value=0.1)
+ c0 = Parameter('c0', min=0, value=0.05)
b = a0 - d + a
model_dict = {
D(d, t): l * c * b - m * d,
@@ -251,7 +251,7 @@ def test_initial_parameters():
results = fit.execute()
print(results)
assert results.value(a0) == pytest.approx(10, abs=1e-8)
- assert results.value(c0) == pytest.approx(0, abs=1e-8)
+ assert results.value(c0) == pytest.approx(0, abs=1e-5)
assert ode_model.params == [a0, c0, k, l, m, p]
assert ode_model.initial_params == [a0, c0] | Relax required precision of parameter, and provide a better initial guess to avoid an alternative local minimum | tBuLi_symfit | train | py |
bb441e15d984cd4aac40a4d98ea21c147c1d4c81 | diff --git a/code/libraries/koowa/dispatcher/abstract.php b/code/libraries/koowa/dispatcher/abstract.php
index <HASH>..<HASH> 100644
--- a/code/libraries/koowa/dispatcher/abstract.php
+++ b/code/libraries/koowa/dispatcher/abstract.php
@@ -154,7 +154,7 @@ abstract class KDispatcherAbstract extends KControllerAbstract
*
* @return mixed
*/
- public function _actionForward(KCommandContext $context)
+ protected function _actionForward(KCommandContext $context)
{
if (KRequest::type() == 'HTTP')
{ | KDispatcherAbstract::_actionForward needs to be protected | joomlatools_joomlatools-framework | train | php |
8fceeb5b41d16a23ed8cd8733baae13fa847c43f | diff --git a/server/rpc/concept/TypeHandler.java b/server/rpc/concept/TypeHandler.java
index <HASH>..<HASH> 100644
--- a/server/rpc/concept/TypeHandler.java
+++ b/server/rpc/concept/TypeHandler.java
@@ -207,9 +207,11 @@ public class TypeHandler {
}
private void getSupertype(Transaction.Req request, Type type) {
+ ConceptProto.Type.GetSupertype.Res.Builder getSupertypeRes = ConceptProto.Type.GetSupertype.Res.newBuilder();
+ Type superType = type.getSupertype();
+ if (superType != null) getSupertypeRes.setType(type(superType));
final ConceptProto.Type.Res.Builder response = ConceptProto.Type.Res.newBuilder()
- .setTypeGetSupertypeRes(ConceptProto.Type.GetSupertype.Res.newBuilder()
- .setType(type(type.getSupertype())));
+ .setTypeGetSupertypeRes(getSupertypeRes);
transactionRPC.respond(response(request, response));
} | Do not send super type in response when super type is null (#<I>)
## What is the goal of this PR?
When we ask for the super type of `thing`, the concept API returns null correctly, yet we need to do a null check to make sure we don't add the null in response which throws null pointer exception.
## What are the changes implemented in this PR?
- null check the super type that concept API returns. | graknlabs_grakn | train | java |
7f106d8d60275d1d874c955ebc1495e644d77e57 | diff --git a/utils/xmlrpc_utils.js b/utils/xmlrpc_utils.js
index <HASH>..<HASH> 100644
--- a/utils/xmlrpc_utils.js
+++ b/utils/xmlrpc_utils.js
@@ -19,7 +19,7 @@ module.exports = {
}
log.debug('Trying again in ' + timeout + 'ms');
log.debug('Connection refused during method %s: %j', method, data);
- this.call(method, data, resolve, reject, timeout);
+ this.call(client, method, data, resolve, reject, log, timeout);
}
else if (err || resp[0] !== 1) {
log.debug('Some other error during %s: %s, %j', method, err, resp); | Fix log.debug fails when waiting for ROS Master #<I>
Fixes #<I>.
- TODO: currently there is no timeout when failing to connect | RethinkRobotics-opensource_rosnodejs | train | js |
9198a1cbc186e742d0762ea54a84009a223d776f | diff --git a/packages/interactive-wrapper/src/interactive-wrapper.js b/packages/interactive-wrapper/src/interactive-wrapper.js
index <HASH>..<HASH> 100644
--- a/packages/interactive-wrapper/src/interactive-wrapper.js
+++ b/packages/interactive-wrapper/src/interactive-wrapper.js
@@ -61,7 +61,9 @@ class InteractiveWrapper extends Component {
if (retries) {
this.setState({ retries: retries - 1 });
setTimeout(() => {
- this.webview.reload();
+ if (this.webview) {
+ this.webview.reload();
+ }
}, 1000);
}
}
@@ -74,7 +76,9 @@ class InteractiveWrapper extends Component {
) {
// Need to handle native routing when something is clicked.
InteractiveWrapper.openURLInBrowser(data.url);
- this.webview.reload();
+ if (this.webview) {
+ this.webview.reload();
+ }
}
} | fix: REPLAT-<I> fix missing prop crash (#<I>) | newsuk_times-components | train | js |
324473d586a9e27a6a7a9f2af901a355cbbef39d | diff --git a/formula/validation.js b/formula/validation.js
index <HASH>..<HASH> 100644
--- a/formula/validation.js
+++ b/formula/validation.js
@@ -1309,7 +1309,7 @@ exports.validate = function (opts, callback) {
complexity = saved_complexity;
count_ops = saved_count_ops;
bStateVarAssignmentAllowed = saved_sva;
- bInFunction = mci < constants.aa3UpgradeMci ? false : saved_infunction;
+ bInFunction = saved_infunction;
assignObject(locals, saved_locals);
if (funcProps.complexity > constants.MAX_COMPLEXITY) | always restore bInFunction | byteball_ocore | train | js |
7475332291df99364c8bfa50db6ffabf6863ecc7 | diff --git a/lib/ronin/email_address.rb b/lib/ronin/email_address.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/email_address.rb
+++ b/lib/ronin/email_address.rb
@@ -18,9 +18,9 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
-require 'ronin/model'
require 'ronin/user_name'
require 'ronin/host_name'
+require 'ronin/model'
require 'dm-timestamps'
@@ -53,11 +53,11 @@ module Ronin
# @since 0.4.0
#
def EmailAddress.parse(email)
- user_name, host_name = email.strip.split('@',2)
+ user, host = email.strip.split('@',2)
- EmailAddress.first_or_new(
- EmailAddress.user_name.name => user_name,
- EmailAddress.host_name.address => host_name
+ return EmailAddress.first_or_new(
+ :user_name => UserName.first_or_new(:name => user),
+ :host_name => HostName.first_or_new(:address => host)
)
end | Worked around strange DataMapper QueryPath bug in EmailAddress.parse. | ronin-ruby_ronin | train | rb |
a22acf1b55dc93d88ca91626455127ea7d2585b6 | diff --git a/src/Pakettikauppa/Client.php b/src/Pakettikauppa/Client.php
index <HASH>..<HASH> 100644
--- a/src/Pakettikauppa/Client.php
+++ b/src/Pakettikauppa/Client.php
@@ -224,6 +224,9 @@ class Client
'weight' => $parcel->getWeight(),
'volume' => $parcel->getVolume(),
'type' => $parcel->getPackageType(),
+ 'x_dimension' => $parcel->getX(),
+ 'y_dimension' => $parcel->getY(),
+ 'z_dimension' => $parcel->getZ(),
);
} | Add support for x/y/z dimensions of the package to price estimator | Pakettikauppa_api-library | train | php |
5c1f8825761387ea71e684faaf43e88e5d7782a3 | diff --git a/scripts/release/index.js b/scripts/release/index.js
index <HASH>..<HASH> 100644
--- a/scripts/release/index.js
+++ b/scripts/release/index.js
@@ -38,6 +38,7 @@ cooker.cook('publish', [
cook.pushTagToRemote,
cook.createReleaseNotes(releaseNotesTemplate),
cook.createGithubRelease,
+ cook.runNpmScript('deploy'),
],
otherwise: [],
}, | chore(release): add website deploy to master script | cerebral_cerebral | train | js |
d57a4621038204ee906a743a7f068b058d26179b | diff --git a/mod/resource/lib.php b/mod/resource/lib.php
index <HASH>..<HASH> 100644
--- a/mod/resource/lib.php
+++ b/mod/resource/lib.php
@@ -385,7 +385,7 @@ function resource_pluginfile($course, $cm, $context, $filearea, $args, $forcedow
$relativepath = implode('/', $args);
$fullpath = "/$context->id/mod_resource/$filearea/0/$relativepath";
if (!$file = $fs->get_file_by_hash(sha1($fullpath)) or $file->is_directory()) {
- $resource = $DB->get_record('resource', array('id'=>$cminfo->instance), 'id, legacyfiles', MUST_EXIST);
+ $resource = $DB->get_record('resource', array('id'=>$cm->instance), 'id, legacyfiles', MUST_EXIST);
if ($resource->legacyfiles != RESOURCELIB_LEGACYFILES_ACTIVE) {
return false;
} | MDL-<I> fix regression in mod_resource pluginfile.php migration | moodle_moodle | train | php |
00ebb7c33e223b0916a16c70bbcc5cdb803f812e | diff --git a/src/Entrust/HasRole.php b/src/Entrust/HasRole.php
index <HASH>..<HASH> 100644
--- a/src/Entrust/HasRole.php
+++ b/src/Entrust/HasRole.php
@@ -12,7 +12,7 @@ trait HasRole
*/
public function roles()
{
- return $this->belongsToMany(Config::get('entrust::role'), Config::get('entrust::assigned_roles_table'));
+ return $this->belongsToMany(Config::get('entrust::role'), Config::get('entrust::assigned_roles_table'), 'user_id', 'role_id');
}
/** | Forced user_id and role_id for roles relationship
I choose to not make my own Role and Permission model and just use your EntrustRole and EntrustPermission directly instead.
The issue here is that eloquent will infer the column names from the class name hence trying to set attached_roles.entrust_role_id
By enforcing the column names we get around this issue without any considerable downsides in my opinion. | Zizaco_entrust | train | php |
438e75eaee906faf969d176e85fd77cb8a8423c4 | diff --git a/library/AcceptanceTestCase.php b/library/AcceptanceTestCase.php
index <HASH>..<HASH> 100644
--- a/library/AcceptanceTestCase.php
+++ b/library/AcceptanceTestCase.php
@@ -882,6 +882,7 @@ abstract class AcceptanceTestCase extends MinkWrapper
protected function _changeAdminLanguage($sLanguage, $sSelectLocator)
{
$this->selectAndWaitFrame($sSelectLocator, "label=$sLanguage", "edit");
+ $this->waitForElement($sSelectLocator);
if ($this->getSelectedLabel($sSelectLocator) != $sLanguage) {
$this->selectAndWaitFrame($sSelectLocator, "label=$sLanguage", "edit");
} | ESDEV-<I> Wait for Select element before selecting something in it.
Improves stability of tests. | OXID-eSales_testing_library | train | php |
09e80101528cfd2e2443750e8a4096d5c45549cd | diff --git a/pygubu/__init__.py b/pygubu/__init__.py
index <HASH>..<HASH> 100644
--- a/pygubu/__init__.py
+++ b/pygubu/__init__.py
@@ -16,7 +16,7 @@ from pygubu.builder.builderobject import (BuilderObject, register_widget,
register_property,
register_custom_property)
-__version__ = '0.19'
+__version__ = '0.20'
class TkApplication: | Update version to sync with pypi. | alejandroautalan_pygubu | train | py |
5450793b8d5f6d1b6f4cd5f9819c341cc537c510 | diff --git a/lib/chef/resource/homebrew_update.rb b/lib/chef/resource/homebrew_update.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/resource/homebrew_update.rb
+++ b/lib/chef/resource/homebrew_update.rb
@@ -86,7 +86,7 @@ class Chef
end
action :periodic do
- return unless mac_os_x?
+ return unless macos?
unless brew_up_to_date?
converge_by "update new lists of packages" do
@@ -96,7 +96,7 @@ class Chef
end
action :update do
- return unless mac_os_x?
+ return unless macos?
converge_by "force update new lists of packages" do
do_update | Use macos? helper in homebrew_update
This is the one we should be using vs. the alias. | chef_chef | train | rb |
a96bb80552b4f1e1eb77a44ca5db5969de36ab17 | diff --git a/lib/ditty/controllers/users.rb b/lib/ditty/controllers/users.rb
index <HASH>..<HASH> 100644
--- a/lib/ditty/controllers/users.rb
+++ b/lib/ditty/controllers/users.rb
@@ -44,6 +44,8 @@ module Ditty
begin
identity.save
rescue Sequel::ValidationFailed
+ raise unless request.accept? 'text/html'
+ status 400
locals = { title: heading(:new), entity: user, identity: identity }
return haml(:"#{view_location}/new", locals: locals)
end | fix: Failing to create a user should return <I> | EagerELK_ditty | train | rb |
d26abe9e797d6562c8cf73d6c85d3c5a168c8e5a | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
from setuptools import setup
setup(
- name='django-binary-memcached',
- version='0.1',
+ name='python-binary-memcached',
+ version='0.2',
author='Jayson Reis',
author_email='santosdosreis@gmail.com',
description='A pure python module to access memcached via it\'s binary' + \ | bumpped to <I> because title was wrong | jaysonsantos_python-binary-memcached | train | py |
8b348bd52977bbab415100ad714f361fc6080cb7 | diff --git a/js/scrollspy.js b/js/scrollspy.js
index <HASH>..<HASH> 100755
--- a/js/scrollspy.js
+++ b/js/scrollspy.js
@@ -171,6 +171,10 @@
*/
$.scrollSpy = function(selector, options) {
var visible = [];
+ options = options || {
+ throttle: 100,
+ scrollOffsetFix: 200 // offset - 200 allows elements near bottom of page to scroll
+ };
selector = $(selector);
selector.each(function(i, element) {
elements.push($(element));
@@ -179,16 +183,9 @@
$('a[href="#' + $(element).attr('id') + '"]').click(function(e) {
e.preventDefault();
var offset = $(this.hash).offset().top + 1;
-
-// offset - 200 allows elements near bottom of page to scroll
-
- $('html, body').animate({ scrollTop: offset - 200 }, {duration: 400, queue: false, easing: 'easeOutCubic'});
-
+ $('html, body').animate({ scrollTop: offset - options.scrollOffsetFix }, {duration: 400, queue: false, easing: 'easeOutCubic'});
});
});
- options = options || {
- throttle: 100
- };
offset.top = options.offsetTop || 0;
offset.right = options.offsetRight || 0; | Add option in ScrollSpy to set the vertical offset | Dogfalo_materialize | train | js |
7c9dab31dbc9477b4c477bff7f0e9c33e0149393 | diff --git a/colab/accounts/views.py b/colab/accounts/views.py
index <HASH>..<HASH> 100644
--- a/colab/accounts/views.py
+++ b/colab/accounts/views.py
@@ -23,7 +23,7 @@ from haystack.query import SearchQuerySet
from colab.super_archives.models import EmailAddress, Message, EmailAddressValidation
from colab.search.utils import trans
# from proxy.trac.models import WikiCollabCount, TicketCollabCount
-from .forms import (UserCreationForm, ListsForm, UserUpdateForm,
+from .forms import (UserCreationForm, UserCreationFormNoBrowserId, ListsForm, UserUpdateForm,
ChangeXMPPPasswordForm)
# from .errors import XMPPChangePwdException
from .utils import mailman
@@ -128,7 +128,6 @@ class UserProfileDetailView(UserProfileBaseMixin, DetailView):
def signup(request):
- user = request.user
BROWSERID_ENABLED = getattr(settings, 'BROWSERID_ENABLED', False)
if BROWSERID_ENABLED: | Handling browserid in User Creation Form | colab_colab | train | py |
c70914ac7e54904bb7e0ed0e3a9511481f69168d | diff --git a/tests/Components/OptionsArrayTest.php b/tests/Components/OptionsArrayTest.php
index <HASH>..<HASH> 100644
--- a/tests/Components/OptionsArrayTest.php
+++ b/tests/Components/OptionsArrayTest.php
@@ -69,10 +69,25 @@ class OptionsArrayTest extends TestCase
public function testRemove()
{
+ /* Assertion 1 */
$component = new OptionsArray(array('a', 'b', 'c'));
$this->assertTrue($component->remove('b'));
$this->assertFalse($component->remove('d'));
$this->assertEquals($component->options, array(0 => 'a', 2 => 'c'));
+
+ /* Assertion 2 */
+ $component = OptionsArray::parse(
+ new Parser(),
+ $this->getTokensList('A B = /*comment*/ (test) C'),
+ array(
+ 'A' => 1,
+ 'B' => array(2, 'var'),
+ 'C' => 3,
+ )
+ );
+ $this->assertEquals('test', $component->has('B'));
+ $component->remove('B');
+ $this->assertFalse($component->has('B'));
}
public function testMerge() | Add tests for removal of option which has value attached to it | phpmyadmin_sql-parser | train | php |
a8130426321951dd6b18c0370e597be002970f21 | diff --git a/src/Functions/Polynomial.php b/src/Functions/Polynomial.php
index <HASH>..<HASH> 100644
--- a/src/Functions/Polynomial.php
+++ b/src/Functions/Polynomial.php
@@ -162,6 +162,11 @@ class Polynomial
return $polynomial($x₀);
}
+ /**
+ * Getter method for the degree of a polynomial
+ *
+ * @return int The degree of a polynomial object
+ */
public function getDegree(): int
{
return $this->degree; | Added description for polynomial degree getter method | markrogoyski_math-php | train | php |
79a19f7d855e5bc02f44a15625db267ec864d985 | diff --git a/gutenberg/acquire/metadata.py b/gutenberg/acquire/metadata.py
index <HASH>..<HASH> 100644
--- a/gutenberg/acquire/metadata.py
+++ b/gutenberg/acquire/metadata.py
@@ -225,14 +225,14 @@ def load_metadata(refresh_cache=False):
call to Project Gutenberg's servers, the meta-data is persisted locally.
"""
- global _METADATA_CACHE
+ cache = get_metadata_cache()
if refresh_cache:
- _METADATA_CACHE.refresh()
+ cache.refresh()
- if _METADATA_CACHE.cache_open:
- return _METADATA_CACHE.graph
+ if cache.cache_open:
+ return cache.graph
- _METADATA_CACHE.open()
+ cache.open()
- return _METADATA_CACHE.graph
+ return cache.graph | Remove direct reference to _METADATA_CACHE | c-w_gutenberg | train | py |
ae9a17a5cde92efc471e46d900e52a29068083da | diff --git a/sesame/backends.py b/sesame/backends.py
index <HASH>..<HASH> 100755
--- a/sesame/backends.py
+++ b/sesame/backends.py
@@ -146,12 +146,6 @@ class UrlAuthBackendMixin(object):
logger.debug("Valid token for user %s: %s", user, token)
return user
-
-class ModelBackend(UrlAuthBackendMixin, auth_backends.ModelBackend):
- """
- Authenticates against a token containing a signed user id.
-
- """
def authenticate(self, request, url_auth_token=None):
"""
Check the token and return the corresponding user.
@@ -164,3 +158,10 @@ class ModelBackend(UrlAuthBackendMixin, auth_backends.ModelBackend):
logger.exception("TypeError in %s, here's the traceback before "
"Django swallows it:", backend)
raise
+
+
+class ModelBackend(UrlAuthBackendMixin, auth_backends.ModelBackend):
+ """
+ Authenticates against a token containing a signed user id.
+
+ """ | Move authenticate to UrlAuthBackendMixin.
This makes it a bit easier to implement AllowAllUsersModelBackend,
should someone want to do that. I don't think it's a good idea so
I'm not going to include the two-line definition. | aaugustin_django-sesame | train | py |
b7be02c353b0979bab2027c43dafcab6757b3825 | diff --git a/addon-test-support/ember-qunit/test-loader.js b/addon-test-support/ember-qunit/test-loader.js
index <HASH>..<HASH> 100644
--- a/addon-test-support/ember-qunit/test-loader.js
+++ b/addon-test-support/ember-qunit/test-loader.js
@@ -15,8 +15,19 @@ addModuleIncludeMatcher(function(moduleName) {
let moduleLoadFailures = [];
QUnit.done(function() {
- if (moduleLoadFailures.length) {
- throw new Error('\n' + moduleLoadFailures.join('\n'));
+ let length = moduleLoadFailures.length;
+
+ try {
+ if (length === 0) {
+ // do nothing
+ } else if (length === 1) {
+ throw moduleLoadFailures[0];
+ } else {
+ throw new Error('\n' + moduleLoadFailures.join('\n'));
+ }
+ } finally {
+ // ensure we release previously captured errors.
+ moduleLoadFailures = [];
}
}); | Improve ModuleLoadFailure handling
1. if only 1 error is found, throw that (rather then joining)
2. after throwing, release errors captured in `moduleLoadFailures` | emberjs_ember-qunit | train | js |
3cf03f3018eeda04e30c696babae7ac036019a90 | diff --git a/dbt/main.py b/dbt/main.py
index <HASH>..<HASH> 100644
--- a/dbt/main.py
+++ b/dbt/main.py
@@ -477,6 +477,7 @@ def parse_args(args):
for sub in [run_sub, compile_sub, generate_sub]:
sub.add_argument(
+ '-m',
'--models',
required=False,
nargs='+', | add "-m" shorthand for models | fishtown-analytics_dbt | train | py |
e3da8ad16d50f0b436e52a18e8b7e621dd29a47d | diff --git a/docx.py b/docx.py
index <HASH>..<HASH> 100755
--- a/docx.py
+++ b/docx.py
@@ -320,7 +320,7 @@ def getdocumenttext(document):
paralist = []
for element in document.iter():
# Find p (paragraph) elements
- if element.tag == 'w'+'p':
+ if element.tag == '{'+nsprefixes['w']+'}p':
paralist.append(element)
# Since a single sentence might be spread over multiple text elements, iterate through each
@@ -330,7 +330,7 @@ def getdocumenttext(document):
# Loop through each paragraph
for element in para.iter():
# Find t (text) elements
- if element.tag == 'w'+'t':
+ if element.tag == '{'+nsprefixes['w']+'}t':
if element.text:
paratext = paratext+element.text
diff --git a/example-extracttext.py b/example-extracttext.py
index <HASH>..<HASH> 100755
--- a/example-extracttext.py
+++ b/example-extracttext.py
@@ -27,6 +27,6 @@ if __name__ == '__main__':
asciiparatextlist.append(paratext.encode("ascii", "backslashreplace"))
## Print our documnts test with two newlines under each paragraph
- print '\n\n'.join(asciiparatextlist)
+ print '\n\n'.join(paratextlist)
\ No newline at end of file | - Revert bug causing getdocumenttext() not to work | mikemaccana_python-docx | train | py,py |
97493b112f76711adc8f431f6f8e6f3245f05c47 | diff --git a/core/src/main/java/org/testcontainers/utility/ResourceReaper.java b/core/src/main/java/org/testcontainers/utility/ResourceReaper.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/testcontainers/utility/ResourceReaper.java
+++ b/core/src/main/java/org/testcontainers/utility/ResourceReaper.java
@@ -28,6 +28,7 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
+import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
@@ -157,7 +158,9 @@ public final class ResourceReaper {
while (true) {
RYUK_ACK_RATE_LIMITER.doWhenReady(() -> {
int index = 0;
- try(Socket clientSocket = new Socket(host, ryukPort)) {
+ // not set the read timeout, as Ryuk would not send anything unless a new filter is submitted, meaning that we would get a timeout exception pretty quick
+ try (Socket clientSocket = new Socket()) {
+ clientSocket.connect(new InetSocketAddress(host, ryukPort), 5 * 1000);
FilterRegistry registry = new FilterRegistry(clientSocket.getInputStream(), clientSocket.getOutputStream());
synchronized (DEATH_NOTE) { | Support Ryuk socket timeout (#<I>)
Fixes #<I> | testcontainers_testcontainers-java | train | java |
8296f95acbca10b980dae3303c94219f76a52b8a | diff --git a/test/test-format.js b/test/test-format.js
index <HASH>..<HASH> 100644
--- a/test/test-format.js
+++ b/test/test-format.js
@@ -4,7 +4,7 @@ const chalk = require('chalk');
const testFormat = () => {
try {
- execSync('npx prettier --check "**/*.js" "**/*.ts"');
+ execSync('npx prettier --check "**/*.js" "**/*.ts"', { stdio: 'inherit' });
} catch (err) {
let errorText = err.stdout.toString();
console.error(chalk`{red Prettier – formatting errors:}`); | Print prettier to stdio (#<I>) | mdn_browser-compat-data | train | js |
640b51c606f1aed8336a70f2332f9bbb00da33bb | diff --git a/ara/api/views.py b/ara/api/views.py
index <HASH>..<HASH> 100644
--- a/ara/api/views.py
+++ b/ara/api/views.py
@@ -14,6 +14,7 @@
#
# You should have received a copy of the GNU General Public License
# along with ARA. If not, see <http://www.gnu.org/licenses/>.
+from django.db import transaction
from rest_framework import viewsets
from rest_framework_extensions.mixins import NestedViewSetMixin
@@ -36,8 +37,9 @@ class PlaybookFilesDetail(NestedViewSetMixin, viewsets.ModelViewSet):
def perform_create(self, serializer):
playbook = models.Playbook.objects.get(pk=self.get_parents_query_dict()['playbooks'])
- instance = serializer.save()
- playbook.files.add(instance)
+ with transaction.atomic(savepoint=False):
+ instance = serializer.save()
+ playbook.files.add(instance)
class PlayViewSet(viewsets.ModelViewSet): | Ensure that add files to a playbook succeeds completly or not at all.
Change-Id: Icda<I>cc<I>df<I>d1a<I>ef<I>e9b2f2 | ansible-community_ara | train | py |
28c5fc48ee4aa431bbaee86c68845baa43ada749 | diff --git a/src/app/controllers/pro/sharePanelCtrl.js b/src/app/controllers/pro/sharePanelCtrl.js
index <HASH>..<HASH> 100644
--- a/src/app/controllers/pro/sharePanelCtrl.js
+++ b/src/app/controllers/pro/sharePanelCtrl.js
@@ -68,6 +68,9 @@ function (angular, _) {
var baseUrl = 'http://localhost:3000';
$scope.shareUrl = baseUrl + '/dashboard/db/' + $routeParams.id + "?" + paramsArray.join('&') ;
+
+ paramsArray.push('width=1000');
+ paramsArray.push('height=500');
$scope.imageUrl = baseUrl + '/render/dashboard/solo/' + $routeParams.id + '?' + paramsArray.join('&') ;
$timeout(function() { | updated sharePanel with width & height | grafana_grafana | train | js |
9e7dc537d09555d9c77ff5e1f16f5577721910f9 | diff --git a/runtests.py b/runtests.py
index <HASH>..<HASH> 100644
--- a/runtests.py
+++ b/runtests.py
@@ -33,10 +33,10 @@ if not settings.configured:
'django.contrib.contenttypes',
'django.contrib.auth',
'django.contrib.sites',
- 'wagtail.wagtailcore',
- 'wagtail.wagtailsites',
- 'wagtail.wagtailusers',
- 'wagtail.wagtailimages',
+ 'wagtail.core',
+ 'wagtail.sites',
+ 'wagtail.users',
+ 'wagtail.images',
'taggit',
'wagtailgeowidget',
"tests", | Fix issue with old wagtail core paths | Frojd_wagtail-geo-widget | train | py |
3848e7b7778571b400be74a668e5123814753ff9 | diff --git a/packages/vuelidate/src/core.js b/packages/vuelidate/src/core.js
index <HASH>..<HASH> 100644
--- a/packages/vuelidate/src/core.js
+++ b/packages/vuelidate/src/core.js
@@ -256,14 +256,14 @@ function createValidationResults (rules, state, key, parentKey) {
.filter(ruleKey => result[ruleKey].$invalid.value)
.map(ruleKey => {
const res = result[ruleKey]
- return {
+ return reactive({
$propertyPath: parentKey ? `${parentKey}.${key}` : key,
$property: key,
$validator: ruleKey,
$message: res.$message,
$params: res.$params,
$pending: res.$pending
- }
+ })
})
) | fix(core): make $errors a reactive object | vuelidate_vuelidate | train | js |
933914478d6b4c51334359e8ed02837d8ac0dd49 | diff --git a/spec/unit/veritas/aggregate/standard_deviation/class_methods/finalize_spec.rb b/spec/unit/veritas/aggregate/standard_deviation/class_methods/finalize_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/veritas/aggregate/standard_deviation/class_methods/finalize_spec.rb
+++ b/spec/unit/veritas/aggregate/standard_deviation/class_methods/finalize_spec.rb
@@ -5,11 +5,22 @@ require 'spec_helper'
describe Aggregate::StandardDeviation, '.finalize' do
subject { object.finalize(accumulator) }
- let(:object) { described_class }
- let(:accumulator) { [ count, mean, sum_of_squares ] }
- let(:count) { 6 }
- let(:mean) { 3.5 }
- let(:sum_of_squares) { 17.5 }
+ let(:object) { described_class }
+ let(:accumulator) { [ count, mean, sum_of_squares ] }
- it { should be_close(1.70, 0.01) }
+ context 'when the variance is 0.0' do
+ let(:count) { 0 }
+ let(:mean) { nil }
+ let(:sum_of_squares) { 0.0 }
+
+ it { should eql(0.0) }
+ end
+
+ context 'when the variance is not 0.0' do
+ let(:count) { 6 }
+ let(:mean) { 3.5 }
+ let(:sum_of_squares) { 17.5 }
+
+ it { should be_close(1.70, 0.01) }
+ end
end | Added spec to make sure StandardDeviation#finalize can handle a variance of 0 | dkubb_axiom | train | rb |
e97e53b527ea5842336cb56551ec055fb39af0a6 | diff --git a/sdl/audio.go b/sdl/audio.go
index <HASH>..<HASH> 100644
--- a/sdl/audio.go
+++ b/sdl/audio.go
@@ -9,11 +9,11 @@ static int SDL_QueueAudio(SDL_AudioDeviceID dev, const void *data, Uint32 len)
{
return -1;
}
-static Uint32 SDL_GetQueuedAudioSize(SDL_AudioDeviceID)
+static Uint32 SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev_id)
{
return 0;
}
-static SDL_ClearQueuedAudio(SDL_AudioDeviceID dev)
+static void SDL_ClearQueuedAudio(SDL_AudioDeviceID dev)
{
}
#endif | sdl: audio: fix compile error when running on SDL2 <<I> | veandco_go-sdl2 | train | go |
6f19c251f951d252b6186d1fd1bddf39b2463553 | diff --git a/src/main/groovy/org/codehaus/gant/GantMetaClass.java b/src/main/groovy/org/codehaus/gant/GantMetaClass.java
index <HASH>..<HASH> 100644
--- a/src/main/groovy/org/codehaus/gant/GantMetaClass.java
+++ b/src/main/groovy/org/codehaus/gant/GantMetaClass.java
@@ -307,7 +307,11 @@ public class GantMetaClass implements MetaClass , GroovyObject {
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//// Methods required of a MetaObjectProtocol object that are not explicitly mentioned for GroovyObject
+<<<<<<< TREE
//// and MetaClass. NB MetaClass is a subinterface of MetaObjectProtocol.
+=======
+ //// and MetaClass.
+>>>>>>> MERGE-SOURCE
/*
* Obtain a list of all meta properties available on this meta class | Rearrange the comments a bit to make things more obvious.
git-svn-id: <URL> | Gant_Gant | train | java |
eadc222de235344b69650d67448f08cf0ab9a2f3 | diff --git a/kernel/user/ezuseroperationcollection.php b/kernel/user/ezuseroperationcollection.php
index <HASH>..<HASH> 100644
--- a/kernel/user/ezuseroperationcollection.php
+++ b/kernel/user/ezuseroperationcollection.php
@@ -320,6 +320,8 @@ class eZUserOperationCollection
// "Draft" must be in sync with the PersistentObject
self::updateUserDraft( $user );
+
+ eZContentCacheManager::clearContentCacheIfNeeded( $userID );
return array( 'status' => true );
} | Fix EZP-<I>: Change password with "legacy_mode: false" does not properly clear the cache (#<I>) | ezsystems_ezpublish-legacy | train | php |
b18e9491f227edb36ec5d30e030533b091734599 | diff --git a/tests/test_external.py b/tests/test_external.py
index <HASH>..<HASH> 100644
--- a/tests/test_external.py
+++ b/tests/test_external.py
@@ -102,4 +102,4 @@ def test_list_of_numbers(left, right, alg):
int_result = internal_func(left, right)
s1, s2 = lib.prepare(left, right)
ext_result = external_func(s1, s2)
- assert isclose(int_result, ext_result), str(lib)
+ assert isclose(int_result, ext_result), f'{lib}({repr(s1)}, {repr(s2)})' | skip external tests if quick answer is available | orsinium_textdistance | train | py |
8356c02e81d213db225408be36c3f5e0a5205841 | diff --git a/scripts/verify/storage.js b/scripts/verify/storage.js
index <HASH>..<HASH> 100644
--- a/scripts/verify/storage.js
+++ b/scripts/verify/storage.js
@@ -29,6 +29,12 @@ const hashes = [
'0x45d493a6f73fa5f404244a5fb8472fc014ca5885',
'0x2e25d2127e0240c6deaf35394702feb236d4d7fc',
'0x34579e4614ac1a7bd295372d3de8621770c76cdc',
+ '0xa721d5893480260bd28ca1f395f2c465d0b5b1c2',
+ '0x891daf0e1750a1031ebe23030828ad7781d874d6',
+ '0x442e7964f6486005235e87e082f56cd52aa663b8',
+ '0xceab719b8baa2310f232ee0d277c061704541cfb',
+ '0x23501e5fef0f67ec476406c556e91992323a0357',
+ '0x0e86a40588f715fcaf7acd1812d50af478e6e917',
];
const oneProvider = new NEOONEDataProvider({ | Add more contracts to verify-storage | neo-one-suite_neo-one | train | js |
46562415ef4cae3d948f0a23b03b6da738fcd0a2 | diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js
index <HASH>..<HASH> 100644
--- a/src/core/renderers/webgl/WebGLRenderer.js
+++ b/src/core/renderers/webgl/WebGLRenderer.js
@@ -536,6 +536,8 @@ WebGLRenderer.prototype.destroy = function (removeView)
this.gl.useProgram(null);
+ this.gl.flush();
+
this.gl = null;
}; | flush all webgl commands before the renderer is completely destroyed. This ensures that all commands are processed in a timely fashion (especially in browsers with multi-process or multi-threaded graphics architectures like chrome). Noteably, this ensures that gl textures are actually deleted around the same time that the renderer is destroyed. | pixijs_pixi.js | train | js |
ecd7832d193099d44312419529a3102980177d93 | diff --git a/nanostat/version.py b/nanostat/version.py
index <HASH>..<HASH> 100644
--- a/nanostat/version.py
+++ b/nanostat/version.py
@@ -1 +1 @@
-__version__ = "0.1.2"
+__version__ = "0.1.3" | bumping version to <I> | wdecoster_nanostat | train | py |
8b260f67bf8dc05a0213bdab019056897fb3b7ef | diff --git a/src/ORM/Table.php b/src/ORM/Table.php
index <HASH>..<HASH> 100644
--- a/src/ORM/Table.php
+++ b/src/ORM/Table.php
@@ -872,14 +872,27 @@ class Table implements RepositoryInterface, EventListenerInterface, EventDispatc
}
/**
- * Returns an association object configured for the specified alias if any
+ * Returns an association object configured for the specified alias if any.
+ *
+ * The name argument also supports dot syntax to access deeper associations.
+ *
+ * ```
+ * $users = $this->association('Articles.Comments.Users');
+ * ```
*
* @param string $name the alias used for the association.
* @return \Cake\ORM\Association|null Either the association or null.
*/
public function association($name)
{
- return $this->_associations->get($name);
+ list($name, $next) = array_pad(explode('.', $name, 2), 2, null);
+ $result = $this->_associations->get($name);
+
+ if ($result !== null && $next !== null) {
+ $result = $result->getTarget()->association($next);
+ }
+
+ return $result;
}
/** | Added support for dot syntax on Table::association()
Reference: #<I> | cakephp_cakephp | train | php |
2a9143f48816b0394ee36dc7035bcbcc75aeb795 | diff --git a/lib/post/create.js b/lib/post/create.js
index <HASH>..<HASH> 100644
--- a/lib/post/create.js
+++ b/lib/post/create.js
@@ -104,20 +104,22 @@ module.exports = function(data, replace, callback){
file.mkdirs(target, next);
}
});
+ }],
+ event: ['filename', 'content', 'folder', function(next, results){
+ /**
+ * Fired when a new post created.
+ *
+ * @event new
+ * @param {String} path The full path of the new post
+ * @param {String} content The content of the new post
+ * @for Hexo
+ */
+ hexo.emit('new', results.filename, results.content);
+ next();
}]
}, function(err, results){
if (err) return callback(err);
- /**
- * Fired when a new post created.
- *
- * @event new
- * @param {String} path The full path of the new post
- * @param {String} content The content of the new post
- * @for Hexo
- */
-
- hexo.emit('new', results.filename, results.content);
callback(null, results.filename, results.content);
});
};
\ No newline at end of file | post.create: fix event and callback can't be called at same time | hexojs_hexo | train | js |
40135379aaa0ecdbdc1ba8f69ad3cc03faa915e1 | diff --git a/mwviews/page_view_count.py b/mwviews/page_view_count.py
index <HASH>..<HASH> 100644
--- a/mwviews/page_view_count.py
+++ b/mwviews/page_view_count.py
@@ -1,4 +1,3 @@
-import urllib.parse
class PageViewCount:
@@ -12,19 +11,9 @@ class PageViewCount:
@classmethod
def from_line(cls, line):
- line_split_on_spaces = line.strip().split(" ")
- views = line_split_on_spaces[-2]
- del(line_split_on_spaces[-2])
-
- bytes_returned = line_split_on_spaces[-1]
- del(line_split_on_spaces[-1])
-
- project = line_split_on_spaces[0]
- del(line_split_on_spaces[0])
-
- page_name = " ".join(line_split_on_spaces)
- page_name = urllib.parse.unquote(page_name).split("#")[0] # No anchors
+ project, page_name, views, bytes_returned = line.strip().split(" ")
+ page_name = page_name.split("#")[0] # No anchors
return cls(project, page_name, int(views), int(bytes_returned)) | Removing URL normalization in titles | mediawiki-utilities_python-mwviews | train | py |
6e824b5fa25e2874d570656173c8de40f4655ef4 | diff --git a/samples/updateViewQuery.js b/samples/updateViewQuery.js
index <HASH>..<HASH> 100644
--- a/samples/updateViewQuery.js
+++ b/samples/updateViewQuery.js
@@ -44,7 +44,7 @@ function main(
// Retrieve existing view metadata
const [metadata] = await view.getMetadata();
- // Uodate view query
+ // Update view query
metadata.view = newViewQuery;
// Set metadata | docs: update minor typo as per b/<I> (#<I>) | googleapis_nodejs-bigquery | train | js |
4b63d16c8a8694b0ba3bbb99170e88e2a39c0256 | diff --git a/src/utilities/__tests__/extendSchema.js b/src/utilities/__tests__/extendSchema.js
index <HASH>..<HASH> 100644
--- a/src/utilities/__tests__/extendSchema.js
+++ b/src/utilities/__tests__/extendSchema.js
@@ -100,7 +100,7 @@ describe('extendSchema', () => {
`);
const originalPrint = printSchema(testSchema);
const extendedSchema = extendSchema(testSchema, ast);
- expect(extendSchema).to.not.equal(testSchema);
+ expect(extendedSchema).to.not.equal(testSchema);
expect(printSchema(testSchema)).to.equal(originalPrint);
expect(printSchema(extendedSchema)).to.contain('newField');
expect(printSchema(testSchema)).to.not.contain('newField'); | Test schema instead of function
The test was run against the function instead of the schema, a simple typo omission. | graphql_graphql-js | train | js |
968fc2f0385736965dd1aace886a047745a80f23 | diff --git a/javascript/firefox-driver/js/utils.js b/javascript/firefox-driver/js/utils.js
index <HASH>..<HASH> 100644
--- a/javascript/firefox-driver/js/utils.js
+++ b/javascript/firefox-driver/js/utils.js
@@ -723,7 +723,7 @@ Utils.getLocation = function(element, opt_onlyFirstRect) {
var clientRect = undefined;
if (opt_onlyFirstRect && element.getClientRects().length > 1) {
for (var i = 0; i < element.getClientRects().length; i++) {
- var candidate = element.getClientRects()[0];
+ var candidate = element.getClientRects()[i];
if (candidate.width != 0 && candidate.height != 0) {
clientRect = candidate;
break; | DanielWagnerHall: Fixing typo - actually check each rect we're iterating over, not just the first one over and over again
r<I> | SeleniumHQ_selenium | train | js |
b83bdae6390abafe2e9cfc47996c1b1e5b8191ea | diff --git a/mod/survey/report.php b/mod/survey/report.php
index <HASH>..<HASH> 100644
--- a/mod/survey/report.php
+++ b/mod/survey/report.php
@@ -225,7 +225,7 @@
case "questions":
if ($qid) { // just get one multi-question
- $questions = $DB->get_record("survey_questions", "id", $qid);
+ $questions = $DB->get_records_select("survey_questions", "id in ($qid)");
$questionorder = explode(",", $qid);
if ($scale = $DB->get_records("survey_questions", array("multi"=>$qid))) {
@@ -441,7 +441,7 @@
$table->align = array ("left");
$table->data[] = array(s($answer->answer1)); // no html here, just plain text
echo html_writer::table($table);
- echo $OUTPUT->spacer(30);
+ echo $OUTPUT->spacer(array('height'=>30));
}
}
} | survey MDL-<I> refactored some code that had been left behind during prior refactoring | moodle_moodle | train | php |
619a18b26a5482585b10eddd331ccacf582ba913 | diff --git a/examples/counter/src/index.js b/examples/counter/src/index.js
index <HASH>..<HASH> 100644
--- a/examples/counter/src/index.js
+++ b/examples/counter/src/index.js
@@ -17,9 +17,10 @@ render(
if (module.hot) {
module.hot.accept('./containers/Root', () => {
+ const RootContainer = require('./containers/Root').default;
render(
<AppContainer>
- <Root
+ <RootContainer
store={ store }
/>
</AppContainer>,
diff --git a/examples/todomvc/index.js b/examples/todomvc/index.js
index <HASH>..<HASH> 100644
--- a/examples/todomvc/index.js
+++ b/examples/todomvc/index.js
@@ -18,9 +18,10 @@ render(
if (module.hot) {
module.hot.accept('./containers/Root', () => {
+ const RootContainer = require('./containers/Root').default;
render(
<AppContainer>
- <Root
+ <RootContainer
store={ store }
/>
</AppContainer>, | Examples: fixed HMR of components issue (#<I>) | reduxjs_redux-devtools | train | js,js |
990b65999708eb25675dee391053ad8e17e37aef | diff --git a/lib/request.js b/lib/request.js
index <HASH>..<HASH> 100644
--- a/lib/request.js
+++ b/lib/request.js
@@ -105,6 +105,7 @@ AWS.AWSRequest = inherit({
* request.send();
*/
send: function send() {
+ this.response.constructor.call(this.response, this);
this.emitEvents('validate', 'build', 'sign', 'send');
if (this.response.error) this.completeRequest();
}, | Clear response between calls to Request.send() | aws_aws-sdk-js | train | js |
c5b6ddb4a9e23eb50b028eab09391d644de2be68 | diff --git a/ui/src/api/wfegraph.js b/ui/src/api/wfegraph.js
index <HASH>..<HASH> 100644
--- a/ui/src/api/wfegraph.js
+++ b/ui/src/api/wfegraph.js
@@ -61,6 +61,7 @@ class Workflow2Graph {
case 'TIMED_OUT':
case 'CANCELLED':
case 'CANCELED':
+ case 'FAILED_WITH_TERMINAL_ERROR':
style = 'stroke: #ff0000; fill: #ff0000';
labelStyle = 'fill:#ffffff; stroke-width: 1px';
break; | Added FAILED_WITH_TERMINAL_ERROR status to show up in the workflow graph | Netflix_conductor | train | js |
8c3ca3cdeb2e87a9ab41d4353cc6d9a67c490a97 | diff --git a/app.js b/app.js
index <HASH>..<HASH> 100755
--- a/app.js
+++ b/app.js
@@ -29,7 +29,7 @@ var argv = rc('peerflix', {}, optimist
.alias('n', 'no-quit').describe('n', 'do not quit peerflix on vlc exit')
.alias('a', 'all').describe('a', 'select all files in the torrent')
.alias('r', 'remove').describe('r', 'remove files on exit')
- .alias('i', 'peer').describe('i', 'add peer by ip:port')
+ .alias('e', 'peer').describe('e', 'add peer by ip:port')
.describe('version', 'prints current version')
.argv); | change -i to -e for peer | mafintosh_peerflix | train | js |
b949f831b64e448f39ebf66588b352cc63786eba | diff --git a/tests/test.js b/tests/test.js
index <HASH>..<HASH> 100644
--- a/tests/test.js
+++ b/tests/test.js
@@ -4,6 +4,9 @@ var mock = require("..");
// This is my test application.
var app = {
+ propertyFunction: function(arg) {
+ return arg;
+ },
regularFunction: function() {
return 1;
},
@@ -21,6 +24,21 @@ var app = {
};
module.exports = {
+ "Properties": {
+ "Call values": function(test) {
+ var nOps = 25;
+ test.expect(nOps + 2);
+ var args = [];
+ var pf = mock(test, app, "propertyFunction");
+ for ( var i = 0; i < nOps; ++i ) {
+ test.equal(app.propertyFunction(i), i);
+ args.push([i]);
+ }
+ test.equal(pf.callCount, nOps);
+ test.deepEqual(pf.callArguments, args);
+ test.done();
+ }
+ },
"Regular function": {
"Mock pass through": function(test) {
test.expect(3); | Added in a test just to make sure that the properties on the mocked function
are updating even with a bunch of calls to them. | Eagerod_nodeunit-mock | train | js |
7c9780840f20a34af859bd9bec3fb1383565a800 | diff --git a/tests/ConfigurationTest.php b/tests/ConfigurationTest.php
index <HASH>..<HASH> 100644
--- a/tests/ConfigurationTest.php
+++ b/tests/ConfigurationTest.php
@@ -37,4 +37,29 @@ class ConfigurationTest extends CommandTestBase
true
);
}
+
+ /**
+ * Test that YAML configuration is loaded.
+ */
+ public function testYAMLConfigurationDefault()
+ {
+ // @todo
+ }
+
+ /**
+ * Test that the correct YAML file gets parsed when the --env attribute is filled
+ */
+ public function testYAMLEnvironmentConfigurationWithEnvSet()
+ {
+ // @todo
+ }
+
+ /**
+ * If both a YAML and a PHP array configuration file exist within the workspace then Tapestry should exit with an
+ * error code and appropriate message.
+ */
+ public function testYAMLandPHPConfigurationThrowsError()
+ {
+ // @todo
+ }
} | :white_check_mark: added test shells for issue #<I> | tapestry-cloud_tapestry | train | php |
02d0c88046b187e09d6f46583b1b1e65d47a966f | diff --git a/src/Joomla/Log/Logger.php b/src/Joomla/Log/Logger.php
index <HASH>..<HASH> 100644
--- a/src/Joomla/Log/Logger.php
+++ b/src/Joomla/Log/Logger.php
@@ -16,7 +16,7 @@ namespace Joomla\Log;
*
* @since 1.0
*/
-abstract class Logger
+abstract class AbstractLogger
{
/**
* Options array for the JLog instance. | Renaming Logger to AbstractLogger | joomla_joomla-framework | train | php |
761bdda293ecb412661a7cd029c56b3c1f064dee | diff --git a/test/unit/psql.test.js b/test/unit/psql.test.js
index <HASH>..<HASH> 100644
--- a/test/unit/psql.test.js
+++ b/test/unit/psql.test.js
@@ -45,6 +45,19 @@ describe('psql', function() {
assert.ok(_.isString(pg1.dbkey()), "pg1 dbkey is " + pg1.dbkey());
});
+ it('dbkey depends on the dbhost', function () {
+ var opt1 = _.clone(dbopts_anon);
+ opt1.host = '192.0.0.8';
+ var pg1 = new PSQL(opt1);
+
+ var opt2 = _.clone(dbopts_anon);
+ opt2.host = '127.0.0.1';
+ var pg2 = new PSQL(opt2);
+
+ assert.ok(pg1.dbkey() !== pg2.dbkey(),
+ 'both PSQL objects using same dbkey ' + pg1.dbkey());
+ });
+
}); | Test for dbkey including DB host #<I> | CartoDB_node-cartodb-psql | train | js |
7afa4c1f3ab74cb3a8349fee16dca8754f34a975 | diff --git a/application/geomajas-gwt-example/src/main/java/org/geomajas/example/gwt/client/samples/layertree/LayerOrderSample.java b/application/geomajas-gwt-example/src/main/java/org/geomajas/example/gwt/client/samples/layertree/LayerOrderSample.java
index <HASH>..<HASH> 100644
--- a/application/geomajas-gwt-example/src/main/java/org/geomajas/example/gwt/client/samples/layertree/LayerOrderSample.java
+++ b/application/geomajas-gwt-example/src/main/java/org/geomajas/example/gwt/client/samples/layertree/LayerOrderSample.java
@@ -117,7 +117,7 @@ public class LayerOrderSample extends SamplePanel {
}
public String[] getConfigurationFiles() {
- return new String[] { "WEB-INF/layertree/mapLegend.xml", "WEB-INF/layerLakes110m.xml",
+ return new String[] { "WEB-INF/mapLegend.xml", "WEB-INF/layerLakes110m.xml",
"WEB-INF/layerRivers50m.xml", "WEB-INF/layerPopulatedPlaces110m.xml",
"WEB-INF/layerWmsBluemarble.xml" };
} | GWTSHOW-<I> : View Source on layer order sample is broken | geomajas_geomajas-project-client-gwt2 | train | java |
da6d2595bd2b9e057e2c53433be3d4297ed18262 | diff --git a/gwpy/cli/cliproduct.py b/gwpy/cli/cliproduct.py
index <HASH>..<HASH> 100644
--- a/gwpy/cli/cliproduct.py
+++ b/gwpy/cli/cliproduct.py
@@ -445,15 +445,17 @@ class CliProduct(object):
xmax = self.xmax
if self.xaxis_type == 'linx':
+ epoch = 0
if arg_list.epoch:
- scale = False
- self.ax.set_xscale('auto-gps')
-
epoch=float(arg_list.epoch)
- if epoch < 1e8:
- epoch += xmin # specified as seconds from start GPS
- self.ax.set_epoch(epoch)
self.log(3,('Epoch set to %.2f' % epoch))
+
+ scale = False
+ self.ax.set_xscale('auto-gps')
+
+ if epoch < 1e8:
+ epoch += xmin # specified as seconds from start GPS
+ self.ax.set_epoch(epoch)
if arg_list.logx:
scale = 'log'
elif not (self.get_xlabel() or arg_list.xlabel): | gwpy/cli/cliproduct.py: handle no epoch specified for time series | gwpy_gwpy | train | py |
e7a3d5cf8dcbcc2be04a038be3b5a9eee270fa7f | diff --git a/src/angular-websocket.js b/src/angular-websocket.js
index <HASH>..<HASH> 100644
--- a/src/angular-websocket.js
+++ b/src/angular-websocket.js
@@ -96,12 +96,6 @@
}
- $WebSocket.prototype.safeDigest = function safeDigest(autoApply) {
- if (autoApply && !this.scope.$$phase) {
- this.scope.$digest();
- }
- };
-
$WebSocket.prototype._readyStateConstants = {
'CONNECTING': 0,
'OPEN': 1,
@@ -117,6 +111,20 @@
$WebSocket.prototype.close = function (force) {
if (force || !this.socket.bufferedAmount) {
this.socket.close();
+ $WebSocket.prototype.safeDigest = function safeDigest(autoApply) {
+ if (autoApply && !this.scope.$$phase) {
+ this.scope.$digest();
+ }
+ };
+
+ $WebSocket.prototype.bindToScope = function bindToScope(scope) {
+ if (scope) {
+ this.scope = scope;
+ if (this.rootScopeFailover) {
+ this.scope.$on('$destroy', function() {
+ this.scope = $rootScope;
+ });
+ }
}
return this;
}; | feat: bindToScope and safeDigest | PatrickJS_angular-websocket | train | js |
7f678ca3c62d591541d21c6d857dc52bda0fb72a | diff --git a/pandas/io/tests/test_parsers.py b/pandas/io/tests/test_parsers.py
index <HASH>..<HASH> 100755
--- a/pandas/io/tests/test_parsers.py
+++ b/pandas/io/tests/test_parsers.py
@@ -2827,6 +2827,16 @@ MyColumn
s = StringIO(',,')
self.read_csv(s, header=[10])
+ def test_read_only_header_no_rows(self):
+ # See gh-7773
+ expected = DataFrame(columns=['a', 'b', 'c'])
+
+ df = self.read_csv(StringIO('a,b,c'))
+ tm.assert_frame_equal(df, expected)
+
+ df = self.read_csv(StringIO('a,b,c'), index_col=False)
+ tm.assert_frame_equal(df, expected)
+
class CompressionTests(object):
def test_zip(self): | BUG: sniffing a csv raises with only a header
Closes #<I>. Validation Test. | pandas-dev_pandas | train | py |
fdd5189d9e1d7a1c43bcedad325f2d2f9fa96b65 | diff --git a/google_cloud_logger/__init__.py b/google_cloud_logger/__init__.py
index <HASH>..<HASH> 100644
--- a/google_cloud_logger/__init__.py
+++ b/google_cloud_logger/__init__.py
@@ -1,5 +1,7 @@
-from datetime import datetime
import inspect
+import traceback
+from datetime import datetime
+from io import StringIO
from pythonjsonlogger.jsonlogger import JsonFormatter
@@ -57,7 +59,22 @@ class GoogleCloudFormatter(JsonFormatter):
}
return levels[level_name.upper()]
+ def make_exception(self, record):
+ with StringIO() as buf:
+ exception_info = record.exc_info
+ traceback.print_tb(exception_info[2], file=buf)
+ return {
+ "class": record.exc_info[0],
+ "message": record.exc_info[1],
+ "traceback": buf.getvalue(),
+ }
+
def make_metadata(self, record):
+ if record.exc_info:
+ return {
+ "userLabels": self.make_user_labels(record),
+ "exception": self.make_exception(record),
+ }
return {"userLabels": self.make_user_labels(record)}
def make_source_location(self, record): | feat: Format exceptions and tracebacks (#4) | rai200890_python_google_cloud_logger | train | py |
238381408375bb4203756bb330081a0ca18aeb03 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -759,7 +759,7 @@ Dat.prototype.createWriteStream = function (opts) {
}
var getLength = function (data) {
- return data.value.length
+ return data.value ? data.value.length : 128 // we just set a delete to count as ~128 bytes
}
var encoder = through.obj(function (data, enc, cb) { | set deletes to count as <I> bytes | maxogden_dat-core | train | js |
54dbcdf17ee03ad2af6834c29712c400c7f40f82 | diff --git a/src/test/java/com/ibm/g11n/pipeline/client/ServiceClientTRTest.java b/src/test/java/com/ibm/g11n/pipeline/client/ServiceClientTRTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/com/ibm/g11n/pipeline/client/ServiceClientTRTest.java
+++ b/src/test/java/com/ibm/g11n/pipeline/client/ServiceClientTRTest.java
@@ -428,7 +428,7 @@ public class ServiceClientTRTest extends AbstractServiceClientBundleTest {
assertTrue("All the draft TRs should be listed",
withoutSummaryDraftTRIdSet.containsAll(draftTRIdSet));
assertTrue("The listing of draft TRs with summary took:" + durationWithSummary +
- " milliseconds, while list performance of draft TRs without summary took: " + durationWithoutSummary + " milliseconds",
+ " milliseconds, while listing of draft TRs without summary took: " + durationWithoutSummary + " milliseconds",
durationWithoutSummary >= durationWithSummary);
cleanupBundles(); | minor rewording to trigger rebuild post travis changes | IBM-Cloud_gp-java-client | train | java |
63d0a56640529147e956bcdc512329590e86bdb2 | diff --git a/blueflood-core/src/integration-test/java/com/rackspacecloud/blueflood/service/ExcessEnumsReaderIntegrationTest.java b/blueflood-core/src/integration-test/java/com/rackspacecloud/blueflood/service/ExcessEnumsReaderIntegrationTest.java
index <HASH>..<HASH> 100644
--- a/blueflood-core/src/integration-test/java/com/rackspacecloud/blueflood/service/ExcessEnumsReaderIntegrationTest.java
+++ b/blueflood-core/src/integration-test/java/com/rackspacecloud/blueflood/service/ExcessEnumsReaderIntegrationTest.java
@@ -41,7 +41,7 @@ public class ExcessEnumsReaderIntegrationTest extends IntegrationTestBase {
ExcessEnumReader.getInstance().isInExcessEnumMetrics(dummyLocator));
// Start the thread to read the table from Cassandra
eerThread.start();
- Thread.sleep(200);
+ Thread.sleep(2000);
Assert.assertTrue("After the table is read from Cassandra the locator should be found",
ExcessEnumReader.getInstance().isInExcessEnumMetrics(dummyLocator)); | inced sleep to fix test on jenkins | rackerlabs_blueflood | train | java |
134723a82df26671c6d458da8753d05eb4507e40 | diff --git a/src/widgets/toast/toast.js b/src/widgets/toast/toast.js
index <HASH>..<HASH> 100755
--- a/src/widgets/toast/toast.js
+++ b/src/widgets/toast/toast.js
@@ -136,7 +136,9 @@
setTimeout ( function () { // In order to better support client size rendering
- $.$layout.append ( Toast.config.templates.queues );
+ const queues = Toast.config.templates.queues ();
+
+ $.$layout.append ( queues );
done (); | Toast: explicitly rendering the queues before appending them | svelto_svelto | train | js |
b35cbed69151aef6292ecca21fcd746152d57ba9 | diff --git a/src/AlgoliaSearch/Client.php b/src/AlgoliaSearch/Client.php
index <HASH>..<HASH> 100644
--- a/src/AlgoliaSearch/Client.php
+++ b/src/AlgoliaSearch/Client.php
@@ -32,7 +32,6 @@ namespace AlgoliaSearch;
*/
class Client
{
-
const CAINFO = 'cainfo';
const CURLOPT = 'curloptions';
diff --git a/src/AlgoliaSearch/ClientContext.php b/src/AlgoliaSearch/ClientContext.php
index <HASH>..<HASH> 100644
--- a/src/AlgoliaSearch/ClientContext.php
+++ b/src/AlgoliaSearch/ClientContext.php
@@ -29,7 +29,6 @@ use Exception;
class ClientContext
{
-
public $applicationID;
public $apiKey;
public $readHostsArray;
diff --git a/src/AlgoliaSearch/Index.php b/src/AlgoliaSearch/Index.php
index <HASH>..<HASH> 100644
--- a/src/AlgoliaSearch/Index.php
+++ b/src/AlgoliaSearch/Index.php
@@ -31,7 +31,6 @@ namespace AlgoliaSearch;
*/
class Index
{
-
public $indexName;
private $client;
private $urlIndexName; | There should be no empty lines after class opening brace.
php-cs-fixer fix src/AlgoliaSearch --fixers=no_blank_lines_after_class_opening | algolia_algoliasearch-client-php | train | php,php,php |
d737f1e26e25b5e25b133a96465f571ba4b54cfe | diff --git a/src/ocLazyLoad.js b/src/ocLazyLoad.js
index <HASH>..<HASH> 100644
--- a/src/ocLazyLoad.js
+++ b/src/ocLazyLoad.js
@@ -393,9 +393,8 @@
return self.getModuleConfig(requireEntry.name).files.indexOf(n) < 0
});
if (diff.length !== 0) {
-
$log.warn('Module "', moduleName, '" attempted to redefine configuration for dependency. "', requireEntry.name, '"\n Additional Files Loaded:', diff);
- promisesList.push(filesLoader(diff).then(function () {
+ promisesList.push(filesLoader(diff, params).then(function () {
return loadDependencies(requireEntry);
}));
} | Small mistake in the 'diff' code detecting module redefinitions (I wasn't passing params to the loader). | ocombe_ocLazyLoad | train | js |
62607b2f63c4d8b9bb5bd783ee386f0f78c0d788 | diff --git a/ui/app/common/pnc-client/resources/UserResource.js b/ui/app/common/pnc-client/resources/UserResource.js
index <HASH>..<HASH> 100644
--- a/ui/app/common/pnc-client/resources/UserResource.js
+++ b/ui/app/common/pnc-client/resources/UserResource.js
@@ -36,7 +36,7 @@
// when status code 401 is returned (see httpResponseInterceptor for more details),
// call authService#getPncUser() instead
getAuthenticatedUser: {
- method: 'POST',
+ method: 'GET',
url: restConfig.getPncRestUrl() + '/users/current',
isArray: false,
cache: true, | NCL-<I> Change request method | project-ncl_pnc | train | js |
e410df0354d504236ff2e28a964809c000c703f1 | diff --git a/src/Cron/CronExpression.php b/src/Cron/CronExpression.php
index <HASH>..<HASH> 100644
--- a/src/Cron/CronExpression.php
+++ b/src/Cron/CronExpression.php
@@ -4,6 +4,7 @@ namespace Cron;
use DateInterval;
use DateTime;
+use DateTimeZone;
use RuntimeException;
use InvalidArgumentException;
@@ -260,6 +261,9 @@ class CronExpression
? $currentTime
: new DateTime($currentTime ?: 'now');
+ // set the timezone
+ $currentDate->setTimezone(new DateTimeZone(date_default_timezone_get()));
+
$currentDate->setTime($currentDate->format('H'), $currentDate->format('i'), 0);
$nextRun = clone $currentDate;
$nth = (int) $nth; | minor change - uses environment timezone setting when @timestamps are used to build the DateTime object | mtdowling_cron-expression | train | php |
448a24b508f97e358bd06c8a1e595cb915c13c92 | diff --git a/retry-flags.js b/retry-flags.js
index <HASH>..<HASH> 100644
--- a/retry-flags.js
+++ b/retry-flags.js
@@ -23,9 +23,7 @@
module.exports = RetryFlags;
function RetryFlags(never, onConnectionError, onTimeout) {
- var self = this;
-
- self.never = never;
- self.onConnectionError = onConnectionError;
- self.onTimeout = onTimeout;
+ this.never = never;
+ this.onConnectionError = onConnectionError;
+ this.onTimeout = onTimeout;
} | retry-flags: drop self. access pattern | uber_tchannel-node | train | js |
7980b07352c05ffac19bce6eda42ff200cfda3f5 | diff --git a/xchange-core/src/main/java/com/xeiam/xchange/dto/Order.java b/xchange-core/src/main/java/com/xeiam/xchange/dto/Order.java
index <HASH>..<HASH> 100644
--- a/xchange-core/src/main/java/com/xeiam/xchange/dto/Order.java
+++ b/xchange-core/src/main/java/com/xeiam/xchange/dto/Order.java
@@ -128,7 +128,7 @@ public class Order {
if (this.type != other.type) {
return false;
}
- if (this.tradableAmount != other.tradableAmount && (this.tradableAmount == null || !this.tradableAmount.equals(other.tradableAmount))) {
+ if ((this.tradableAmount == null) ? (other.tradableAmount != null) : this.tradableAmount.compareTo(other.tradableAmount) != 0) {
return false;
}
if ((this.currencyPair == null) ? (other.currencyPair != null) : !this.currencyPair.equals(other.currencyPair)) { | In equals() method changed BigDecimal equality check to use compareTo so
as to ignore scale. | knowm_XChange | train | java |
84626b95f3195b48fa58ce5935aa25a4784465b6 | diff --git a/builtin/logical/database/backend_test.go b/builtin/logical/database/backend_test.go
index <HASH>..<HASH> 100644
--- a/builtin/logical/database/backend_test.go
+++ b/builtin/logical/database/backend_test.go
@@ -41,6 +41,7 @@ func getCluster(t *testing.T) (*vault.TestCluster, logical.SystemView) {
})
cluster.Start()
cores := cluster.Cores
+ vault.TestWaitActive(t, cores[0].Core)
os.Setenv(pluginutil.PluginCACertPEMEnv, cluster.CACertPEMFile) | database/test: use vault.TestWaitActive when we're starting up a test cluster (#<I>) | hashicorp_vault | train | go |
9ea8b6f659083ba94a8bb95d69b595fd6c330aaf | diff --git a/internal/model/sharedpullerstate.go b/internal/model/sharedpullerstate.go
index <HASH>..<HASH> 100644
--- a/internal/model/sharedpullerstate.go
+++ b/internal/model/sharedpullerstate.go
@@ -20,7 +20,6 @@ import (
"path/filepath"
"sync"
- "github.com/syncthing/syncthing/internal/osutil"
"github.com/syncthing/syncthing/internal/protocol"
)
@@ -137,8 +136,6 @@ func (s *sharedPullerState) earlyCloseLocked(context string, err error) {
s.err = err
if s.fd != nil {
s.fd.Close()
- // Delete temporary file, even if parent dir is read-only
- osutil.InWritableDir(func(string) error { os.Remove(s.tempName); return nil }, s.tempName)
}
s.closed = true
} | Do not delete temp files on error (fixes #<I>) | syncthing_syncthing | train | go |
0e9b703a213599d2738608c8bbd26829fb58b940 | diff --git a/docs/source/user-guide/examples/ll_fpadd.py b/docs/source/user-guide/examples/ll_fpadd.py
index <HASH>..<HASH> 100644
--- a/docs/source/user-guide/examples/ll_fpadd.py
+++ b/docs/source/user-guide/examples/ll_fpadd.py
@@ -49,6 +49,7 @@ def compile_ir(engine, llvm_ir):
# Now add the module and make sure it is ready for execution
engine.add_module(mod)
engine.finalize_object()
+ engine.run_static_constructors()
return mod | include static ctor call in documentation. | numba_llvmlite | train | py |
d75a01ec83f0940cd5165a039b4aecca249c45b7 | diff --git a/walletunlocker/service.go b/walletunlocker/service.go
index <HASH>..<HASH> 100644
--- a/walletunlocker/service.go
+++ b/walletunlocker/service.go
@@ -309,7 +309,7 @@ func (u *UnlockerService) ChangePassword(ctx context.Context,
privatePw := in.CurrentPassword
// If the current password is blank, we'll assume the user is coming
- // from a --noencryptwallet state, so we'll use the default passwords.
+ // from a --noseedbackup state, so we'll use the default passwords.
if len(in.CurrentPassword) == 0 {
publicPw = lnwallet.DefaultPublicPassphrase
privatePw = lnwallet.DefaultPrivatePassphrase | walletunlocker/service: change noencryptwallet reference to noseedbackup | lightningnetwork_lnd | train | go |
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.