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
4cfa1c3db52efc6ba0e32980bf8ee3d592dfacd8
diff --git a/modules/core/src/lib/layer.js b/modules/core/src/lib/layer.js index <HASH>..<HASH> 100644 --- a/modules/core/src/lib/layer.js +++ b/modules/core/src/lib/layer.js @@ -803,22 +803,7 @@ ${flags.viewportChanged ? 'viewport' : ''}\ // TODO - is attribute manager needed? - Model should be enough. const attributeManager = this.getAttributeManager(); const attributeManagerNeedsRedraw = attributeManager && attributeManager.getNeedsRedraw(opts); - const modelNeedsRedraw = this._modelNeedsRedraw(opts); - redraw = redraw || attributeManagerNeedsRedraw || modelNeedsRedraw; - - return redraw; - } - - _modelNeedsRedraw(opts) { - let redraw = false; - - for (const model of this.getModels()) { - let modelNeedsRedraw = model.getNeedsRedraw(opts); - if (modelNeedsRedraw && typeof modelNeedsRedraw !== 'string') { - modelNeedsRedraw = `model ${model.id}`; - } - redraw = redraw || modelNeedsRedraw; - } + redraw = redraw || attributeManagerNeedsRedraw; return redraw; }
Remove dependency on model redraw flags (#<I>)
uber_deck.gl
train
js
c7834c1acc6d5faa4928c4792e32311f5907bc57
diff --git a/py17track/package.py b/py17track/package.py index <HASH>..<HASH> 100644 --- a/py17track/package.py +++ b/py17track/package.py @@ -251,7 +251,7 @@ PACKAGE_TYPE_MAP = { } -@attr.s(cmp=False) # pylint: disable=too-few-public-methods +@attr.s(frozen=True) # pylint: disable=too-few-public-methods class Package: """Define a package object.""" @@ -268,7 +268,11 @@ class Package: # pylint: disable=attribute-defined-outside-init def __attrs_post_init__(self): """Do some post-init processing.""" - self.destination_country = COUNTRY_MAP[self.destination_country] - self.origin_country = COUNTRY_MAP[self.origin_country] - self.package_type = PACKAGE_TYPE_MAP[self.package_type] - self.status = PACKAGE_STATUS_MAP[self.status] + object.__setattr__( + self, 'destination_country', COUNTRY_MAP[self.destination_country]) + object.__setattr__( + self, 'origin_country', COUNTRY_MAP[self.origin_country]) + object.__setattr__( + self, 'package_type', PACKAGE_TYPE_MAP[self.package_type]) + object.__setattr__( + self, 'status', PACKAGE_STATUS_MAP[self.status])
Fix a bug in how Packages are hashed (#5)
bachya_py17track
train
py
3796eab0e0f0efd98b87d6910b89a8c176924552
diff --git a/polyaxon/experiments/signals.py b/polyaxon/experiments/signals.py index <HASH>..<HASH> 100644 --- a/polyaxon/experiments/signals.py +++ b/polyaxon/experiments/signals.py @@ -44,7 +44,7 @@ def add_experiment_pre_save(sender, **kwargs): not instance.specification or not instance.specification.run_exec or instance.specification.run_exec.git or - instance.is_clone or + instance.code_reference or not instance.project.has_code) if condition: return
Experiment post save signal should check if experiment has a code ref
polyaxon_polyaxon
train
py
d9bfe1c2fe607f1b9feaf214425a9ccf43a88045
diff --git a/builtin/providers/digitalocean/resource_digitalocean_droplet.go b/builtin/providers/digitalocean/resource_digitalocean_droplet.go index <HASH>..<HASH> 100644 --- a/builtin/providers/digitalocean/resource_digitalocean_droplet.go +++ b/builtin/providers/digitalocean/resource_digitalocean_droplet.go @@ -287,11 +287,11 @@ func resource_digitalocean_droplet_update_state( } s.Attributes["ipv4_address"] = droplet.IPV4Address("public") - s.Attributes["ipv4_address_private"] = droplet.IPV4Address("private") s.Attributes["locked"] = droplet.IsLocked() if droplet.NetworkingType() == "private" { s.Attributes["private_networking"] = "true" + s.Attributes["ipv4_address_private"] = droplet.IPV4Address("private") } s.Attributes["size"] = droplet.SizeSlug()
providers/digitalocean: only save private ip address if private
hashicorp_terraform
train
go
afbf2ee348dd57f3bee1f0abea8ffd7d798fb1b5
diff --git a/findbugs/test/OpenDatabase.java b/findbugs/test/OpenDatabase.java index <HASH>..<HASH> 100644 --- a/findbugs/test/OpenDatabase.java +++ b/findbugs/test/OpenDatabase.java @@ -8,6 +8,42 @@ public class OpenDatabase { public void openStatement(Connection conn) throws SQLException { Statement statement = conn.createStatement(); } + + public int doNotReport(Connection connection) throws SQLException { + Statement statement = null; + ResultSet rs = null; + + int id = 0; + + try { + statement = connection.createStatement(); + rs = statement.executeQuery("select blah blah"); + if (!rs.next()) { + throw new IllegalStateException("no row found"); + } + id = rs.getInt(1); + } finally { + try { + if (rs != null) + rs.close(); + } catch (Throwable t) { + t.printStackTrace(); + } + try { + if (statement != null) + statement.close(); + } catch (Throwable t) { + t.printStackTrace(); + } + try { + if (connection != null) + connection.close(); + } catch (Throwable t) { + t.printStackTrace(); + } + } + return id; + } } // vim:ts=3
Added a method that should not be reported git-svn-id: <URL>
spotbugs_spotbugs
train
java
490094faa1946696a67958bae8c7487fad56e816
diff --git a/src/ShopifyApp/Services/ShopSession.php b/src/ShopifyApp/Services/ShopSession.php index <HASH>..<HASH> 100644 --- a/src/ShopifyApp/Services/ShopSession.php +++ b/src/ShopifyApp/Services/ShopSession.php @@ -61,7 +61,7 @@ class ShopSession * * @return self */ - public function __construct(object $shop = null) + public function __construct($shop = null) { $this->setShop($shop); } @@ -73,7 +73,7 @@ class ShopSession * * @return void */ - public function setShop(object $shop = null) + public function setShop($shop = null) { $this->shop = $shop; }
Fix to satisify older php versions
ohmybrew_laravel-shopify
train
php
d8f7a21b19f58aee059d11c2f5a3a1b4fcc192ac
diff --git a/test/test_sparkline.py b/test/test_sparkline.py index <HASH>..<HASH> 100644 --- a/test/test_sparkline.py +++ b/test/test_sparkline.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- """ -Run from the root folder with either 'python setup.py test' or +Run from the root folder with either 'python setup.py test' or 'py.test test/test_sparkline.py'. """ @@ -102,6 +102,6 @@ def test1(): "Test single values all have the same four pixel high output character." for i in range(10): - res = sparklines([3]) + res = sparklines([i]) exp = ['▄'] assert res == exp
Fix a likely typo in test. Whitespace.
deeplook_sparklines
train
py
8b33f014f04625aa465226c36e76b7991853b68b
diff --git a/pyglibc/_signalfd.py b/pyglibc/_signalfd.py index <HASH>..<HASH> 100644 --- a/pyglibc/_signalfd.py +++ b/pyglibc/_signalfd.py @@ -122,6 +122,7 @@ class signalfd(object): """ return self._sfd < 0 + @property def signals(self): """ Get the set of monitored signals @@ -130,9 +131,15 @@ class signalfd(object): A frozenset corresponding to each of the monitored signals :raises ValueError: If :meth:`closed()` is True + + This property can be assigned to when it simply calls :meth:`update()`. """ return self._signals + @signals.setter + def signals(self, signals): + self.update(signals) + def fileno(self): """ Get the descriptor number obtained from ``signalfd(2)``
Make signalfd.signals writable This patch makes the signalfd.signals property writable. This is just syntactic sugar for the existing signalgf.update()
zyga_python-glibc
train
py
30d5c208ac3b472910f99a15673585abc040bcd7
diff --git a/werkzeug/test.py b/werkzeug/test.py index <HASH>..<HASH> 100644 --- a/werkzeug/test.py +++ b/werkzeug/test.py @@ -322,7 +322,6 @@ class EnvironBuilder(object): warn(DeprecationWarning('it\'s no longer possible to pass dicts ' 'as `data`. Use tuples or FileStorage ' 'objects instead'), stacklevel=2) - args = v value = dict(value) mimetype = value.pop('mimetype', None) if mimetype is not None:
Remove assignment of undefined name to unused name.
pallets_werkzeug
train
py
265d3163546c9d86da5cfb622f6b0a9e25f2dcfd
diff --git a/tests/test_encoding.py b/tests/test_encoding.py index <HASH>..<HASH> 100644 --- a/tests/test_encoding.py +++ b/tests/test_encoding.py @@ -19,7 +19,7 @@ class TSourceEncoding(TestCase): """ def _check_encoding(self, path): - with open(path, "rb") as h: + with open(path, "r") as h: match = None for i, line in enumerate(h): # https://www.python.org/dev/peps/pep-0263/
tests: fix file encoding test under Python3
quodlibet_mutagen
train
py
e061f2dec41671e89766b2939fd404a0f5f59546
diff --git a/aeron-cluster/src/main/java/io/aeron/cluster/ClusterSession.java b/aeron-cluster/src/main/java/io/aeron/cluster/ClusterSession.java index <HASH>..<HASH> 100644 --- a/aeron-cluster/src/main/java/io/aeron/cluster/ClusterSession.java +++ b/aeron-cluster/src/main/java/io/aeron/cluster/ClusterSession.java @@ -77,6 +77,12 @@ class ClusterSession implements AutoCloseable } } + void open() + { + this.state = State.OPEN; + principleData = null; + } + byte[] principleData() { return principleData; diff --git a/aeron-cluster/src/main/java/io/aeron/cluster/SequencerAgent.java b/aeron-cluster/src/main/java/io/aeron/cluster/SequencerAgent.java index <HASH>..<HASH> 100644 --- a/aeron-cluster/src/main/java/io/aeron/cluster/SequencerAgent.java +++ b/aeron-cluster/src/main/java/io/aeron/cluster/SequencerAgent.java @@ -866,7 +866,7 @@ class SequencerAgent implements Agent if (logAppender.appendConnectedSession(session, nowMs)) { messageIndex.incrementOrdered(); - session.state(OPEN); + session.open(); return true; }
[Java]: null out principleData in consensus module after being appended to log.
real-logic_aeron
train
java,java
1cdbd0bb4892d758386d624148b1ae81c6471102
diff --git a/megaman/embedding/base.py b/megaman/embedding/base.py index <HASH>..<HASH> 100644 --- a/megaman/embedding/base.py +++ b/megaman/embedding/base.py @@ -7,10 +7,14 @@ import numpy as np from scipy.sparse import isspmatrix from sklearn.base import BaseEstimator, TransformerMixin -from sklearn.utils.validation import check_array, FLOAT_DTYPES +from sklearn.utils.validation import check_array from ..geometry.geometry import Geometry +# from sklearn.utils.validation import FLOAT_DTYPES +FLOAT_DTYPES = (np.float64, np.float32, np.float16) + + class BaseEmbedding(BaseEstimator, TransformerMixin): """ Base Class for all megaman embeddings.
BUG: make embeddings work with older sklearn versions
mmp2_megaman
train
py
e43071f4f5d437deccf5ce8a443b4c30e18fb027
diff --git a/tarbell/app.py b/tarbell/app.py index <HASH>..<HASH> 100644 --- a/tarbell/app.py +++ b/tarbell/app.py @@ -236,8 +236,6 @@ class TarbellSite: return hooks def call_hook(self, hook, *args, **kwargs): - if len(self.hooks[hook]): - puts("Executing {0} hooks".format(hook)) for function in self.hooks[hook]: function.__call__(*args, **kwargs) @@ -323,6 +321,8 @@ class TarbellSite: def preview(self, path=None, extra_context=None, publish=False): """ Preview a project path """ + self.call_hook("preview", self) + if path is None: path = 'index.html' diff --git a/tarbell/hooks.py b/tarbell/hooks.py index <HASH>..<HASH> 100644 --- a/tarbell/hooks.py +++ b/tarbell/hooks.py @@ -4,6 +4,7 @@ hooks = { 'generate': [], # (site, tempdir) 'publish': [], # (site, s3) 'install': [], # (site, project) + 'preview': [], # (site) }
add preview hook and remove ultimately annoying hook execution print statement, closes #<I>
tarbell-project_tarbell
train
py,py
a49a53960702858db652fbc846d308ad1c72bd6d
diff --git a/tests/test_config_parser.py b/tests/test_config_parser.py index <HASH>..<HASH> 100644 --- a/tests/test_config_parser.py +++ b/tests/test_config_parser.py @@ -817,7 +817,7 @@ class TestConfigParser(object): x = ${x.y} """ ) - assert config.get("x.y") == {'y': 1} + assert config.get("x.y") == 1 assert set(config.get("x").keys()) == set(['y']) def test_self_ref_substitution_dict_recurse(self):
test_self_ref_substitution_dict_path_hide: assertion is wrong
chimpler_pyhocon
train
py
ea4f8f9e49eb47893b0860f2a450bc8d8b7ca847
diff --git a/admin/roles/define.php b/admin/roles/define.php index <HASH>..<HASH> 100644 --- a/admin/roles/define.php +++ b/admin/roles/define.php @@ -201,7 +201,7 @@ if (optional_param('savechanges', false, PARAM_BOOL) && confirm_sesskey() && $de $event = \core\event\role_capabilities_updated::create( array( 'context' => $systemcontext, - 'objectid' => $roleid + 'objectid' => $tableroleid ) ); $event->set_legacy_logdata(array(SITEID, 'role', $action, 'admin/roles/define.php?action=view&roleid=' . $tableroleid,
MDL-<I> Roles : Logs store newly created role's id
moodle_moodle
train
php
80fb3bdeba9d355596e29240d66930851654d55c
diff --git a/core-bundle/contao/elements/ContentText.php b/core-bundle/contao/elements/ContentText.php index <HASH>..<HASH> 100644 --- a/core-bundle/contao/elements/ContentText.php +++ b/core-bundle/contao/elements/ContentText.php @@ -52,6 +52,13 @@ class ContentText extends \ContentElement $this->text = \String::toHtml5($this->text); } + // Add the static files URL to images + if (TL_FILES_URL != '') + { + $path = $GLOBALS['TL_CONFIG']['uploadPath'] . '/'; + $this->text = str_replace(' src="' . $path, ' src="' . TL_FILES_URL . $path, $this->text); + } + $this->Template->text = \String::encodeEmail($this->text); $this->Template->addImage = false; diff --git a/core-bundle/contao/library/Contao/Controller.php b/core-bundle/contao/library/Contao/Controller.php index <HASH>..<HASH> 100644 --- a/core-bundle/contao/library/Contao/Controller.php +++ b/core-bundle/contao/library/Contao/Controller.php @@ -3363,6 +3363,8 @@ abstract class Controller extends \System return; } + global $objPage; + $arrConstants = array ( 'staticFiles' => 'TL_FILES_URL',
[Core] Add the static files URL to images added in the rich text editor
contao_contao
train
php,php
7c730c6587dbd9708e23c66a6f9c4767cf6c9824
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -63,7 +63,7 @@ setuptools.setup( description="A pure Python chess library with move generation and validation, Polyglot opening book probing, PGN reading and writing, Syzygy tablebase probing and UCI engine communication.", long_description=read_description(), license="GPL3", - keywords="chess fen pgn polyglot syzygy uci", + keywords="chess fen pgn polyglot syzygy gaviota uci", url="https://github.com/niklasf/python-chess", packages=["chess"], test_suite="test",
Add Gaviota as keyword
niklasf_python-chess
train
py
304e300021a74b4d32d8ca8a28e058e172c2375e
diff --git a/lib/perpetuity/postgres/table_name.rb b/lib/perpetuity/postgres/table_name.rb index <HASH>..<HASH> 100644 --- a/lib/perpetuity/postgres/table_name.rb +++ b/lib/perpetuity/postgres/table_name.rb @@ -1,8 +1,10 @@ module Perpetuity class Postgres + InvalidTableName = Class.new(StandardError) class TableName def initialize name @name = name.to_s + raise InvalidTableName, "PostgreSQL table name cannot contain double quotes" if @name.include? '"' end def to_s diff --git a/spec/perpetuity/postgres/table_name_spec.rb b/spec/perpetuity/postgres/table_name_spec.rb index <HASH>..<HASH> 100644 --- a/spec/perpetuity/postgres/table_name_spec.rb +++ b/spec/perpetuity/postgres/table_name_spec.rb @@ -7,6 +7,10 @@ module Perpetuity TableName.new('Person').to_s.should == '"Person"' end + it 'cannot contain double quotes' do + expect { TableName.new('Foo "Bar"') }.to raise_error InvalidTableName + end + it 'compares equally to its string representation' do TableName.new('Person').should == 'Person' end
Don't allow double quotes in table names
jgaskins_perpetuity-postgres
train
rb,rb
ab703f88e89ffdcf3c9260c24d2a5df70a00a137
diff --git a/src/Suki/Ohara.php b/src/Suki/Ohara.php index <HASH>..<HASH> 100644 --- a/src/Suki/Ohara.php +++ b/src/Suki/Ohara.php @@ -16,6 +16,11 @@ class Ohara protected $_text = array(); protected static $_registry = array(); protected $_request = array(); + public $sourceDir; + public $scriptUrl; + public $settings; + public $boardDir; + public $boardUrl; public function getName() { @@ -24,12 +29,11 @@ class Ohara public function setRegistry() { - global $sourcedir, $scripturl, $smcFunc; + global $sourcedir, $scripturl; global $settings, $boarddir, $boardurl; $this->sourceDir = $sourcedir; $this->scriptUrl = $scripturl; - $this->smcFunc = $smcFunc; $this->settings = $settings; $this->boardDir = $boarddir; $this->boardUrl = $boardurl;
Remove $smcFunc, lots of dulpicate stuff
MissAllSunday_Ohara
train
php
5c9a3bc36c51526d55caf784347a1ce2f02e1283
diff --git a/lib/rubaidh/google_analytics.rb b/lib/rubaidh/google_analytics.rb index <HASH>..<HASH> 100644 --- a/lib/rubaidh/google_analytics.rb +++ b/lib/rubaidh/google_analytics.rb @@ -33,7 +33,7 @@ module Rubaidh # :nodoc: # I can't see why you'd want to do this, but you can always change the # analytics URL (ssl version). - @@analytics_ssl_url = 'https://www.google-analytics.com/urchin.js' + @@analytics_ssl_url = 'https://ssl.google-analytics.com/urchin.js' cattr_accessor :analytics_ssl_url # The environments in which to enable the Google Analytics code. Defaults
* Fix the SSL analytics URL. Thanks to Alex Wayne for pointing it out. git-svn-id: <URL>
rubaidh_google_analytics
train
rb
bd9e6629538d53e09a4067f1905078801cfea9e2
diff --git a/mod/lesson/backup/moodle2/restore_lesson_stepslib.php b/mod/lesson/backup/moodle2/restore_lesson_stepslib.php index <HASH>..<HASH> 100644 --- a/mod/lesson/backup/moodle2/restore_lesson_stepslib.php +++ b/mod/lesson/backup/moodle2/restore_lesson_stepslib.php @@ -181,6 +181,17 @@ class restore_lesson_activity_structure_step extends restore_activity_structure_ } $rs->close(); + // Remap all the restored 'jumpto' fields now that we have all the pages and their mappings + $rs = $DB->get_recordset('lesson_answers', array('lessonid' => $this->task->get_activityid()), + '', 'id, jumpto'); + foreach ($rs as $answer) { + if ($answer->jumpto > 0) { + $answer->jumpto = $this->get_mappingid('lesson_page', $answer->jumpto); + $DB->update_record('lesson_answers', $answer); + } + } + $rs->close(); + // TODO: somewhere at the end of the restore... when all the activities have been restored // TODO: we need to decode the lesson->activitylink that points to another activity in the course // TODO: great functionality that breaks self-contained principles, grrr
MDL-<I> lesson restore - add missing jumpto remapping. Credit goes to Mike Churchward
moodle_moodle
train
php
c25605a9028b374aed1578e5be5e001cffac2c3e
diff --git a/ui/api/src/main/java/org/jboss/forge/addon/ui/util/Selections.java b/ui/api/src/main/java/org/jboss/forge/addon/ui/util/Selections.java index <HASH>..<HASH> 100644 --- a/ui/api/src/main/java/org/jboss/forge/addon/ui/util/Selections.java +++ b/ui/api/src/main/java/org/jboss/forge/addon/ui/util/Selections.java @@ -137,7 +137,7 @@ public final class Selections @Override public Optional<UIRegion<SELECTIONTYPE>> getRegion() { - return regions == null ? Optional.empty() : Optional.ofNullable(regions.apply(get())); + return regions == null || isEmpty() ? Optional.empty() : Optional.ofNullable(regions.apply(get())); } }
Selections should check if empty before calling Function
forge_core
train
java
b436e79c09467098712dbc4da4d260317a13620e
diff --git a/ptpython/ipython.py b/ptpython/ipython.py index <HASH>..<HASH> 100644 --- a/ptpython/ipython.py +++ b/ptpython/ipython.py @@ -282,4 +282,21 @@ def embed(**kwargs): kwargs["config"] = config shell = InteractiveShellEmbed.instance(**kwargs) initialize_extensions(shell, config["InteractiveShellApp"]["extensions"]) + run_startup_scripts(shell) shell(header=header, stack_depth=2, compile_flags=compile_flags) + + +def run_startup_scripts(shell): + """ + Contributed by linyuxu: + https://github.com/prompt-toolkit/ptpython/issues/126#issue-161242480 + """ + import glob + import os + + startup_dir = shell.profile_dir.startup_dir + startup_files = [] + startup_files += glob.glob(os.path.join(startup_dir, "*.py")) + startup_files += glob.glob(os.path.join(startup_dir, "*.ipy")) + for file in startup_files: + shell.run_cell(open(file).read())
Feature: read ipython config files
prompt-toolkit_ptpython
train
py
923291a5e9ed03a181439a964a5e6d4be5a951a8
diff --git a/src/VCard.php b/src/VCard.php index <HASH>..<HASH> 100644 --- a/src/VCard.php +++ b/src/VCard.php @@ -560,7 +560,7 @@ class VCard { $browser = strtolower($_SERVER['HTTP_USER_AGENT']); - $matches = []; + $matches = array(); preg_match('/os (\d+)_(\d+)\s+/', $browser, $matches); $version = isset($matches[1]) ? ((int)$matches[1]) : 999;
Replaced shorthand array declaration to preserve PHP<I> compatibility.
jeroendesloovere_vcard
train
php
bc7af35c32210f2d19fee9a37b8ad76aec68e839
diff --git a/nodeconductor/iaas/views.py b/nodeconductor/iaas/views.py index <HASH>..<HASH> 100644 --- a/nodeconductor/iaas/views.py +++ b/nodeconductor/iaas/views.py @@ -474,9 +474,9 @@ class InstanceViewSet(mixins.CreateModelMixin, if not instance.backend_id: raise Http404() - yesterday = timezone.now() - datetime.timedelta(hours=1) + default_start = timezone.now() - datetime.timedelta(hours=1) time_interval_serializer = serializers.TimeIntervalSerializer(data={ - 'start': request.query_params.get('from', datetime_to_timestamp(yesterday)), + 'start': request.query_params.get('from', datetime_to_timestamp(default_start)), 'end': request.query_params.get('to', datetime_to_timestamp(timezone.now())) }) time_interval_serializer.is_valid(raise_exception=True)
Rename variable (NC-<I>)
opennode_waldur-core
train
py
fac32fbf03a6a6d9f9fdc4fda477a950dea7c065
diff --git a/py/testdir_multi_jvm/test_putfile.py b/py/testdir_multi_jvm/test_putfile.py index <HASH>..<HASH> 100644 --- a/py/testdir_multi_jvm/test_putfile.py +++ b/py/testdir_multi_jvm/test_putfile.py @@ -42,7 +42,8 @@ class Basic(unittest.TestCase): resultSize = node.inspect(key)['value_size_bytes'] self.assertEqual(origSize,resultSize) - def test_C_putfile_and_getfile(self): + print "Disabling test C and D because get_key doesn't seem to work?" + def notest_C_putfile_and_getfile(self): cvsfile = h2o.find_file(file_to_put()) node = h2o.nodes[0] @@ -52,7 +53,7 @@ class Basic(unittest.TestCase): self.diff(r, f) f.close() - def test_D_putfile_and_getfile_to_all_nodes(self): + def notest_D_putfile_and_getfile_to_all_nodes(self): cvsfile = h2o.find_file(file_to_put()) for node in h2o.nodes:
got rid of the get_key tests
h2oai_h2o-2
train
py
73fb6349c98742bb404bd7ad97184d19f32a8366
diff --git a/activerecord/lib/active_record/validations/uniqueness.rb b/activerecord/lib/active_record/validations/uniqueness.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/validations/uniqueness.rb +++ b/activerecord/lib/active_record/validations/uniqueness.rb @@ -36,7 +36,10 @@ module ActiveRecord relation = relation.merge(options[:conditions]) if options[:conditions] if relation.exists? - record.errors.add(attribute, :taken, options.except(:case_sensitive, :scope, :conditions).merge(:value => value)) + error_options = options.except(:case_sensitive, :scope, :conditions) + error_options[:value] = value + + record.errors.add(attribute, :taken, error_options) end end
Avoid unnecessary hashes with error options
rails_rails
train
rb
578a0cdd896bc09ea1d2154277f13086c59297bc
diff --git a/jupytext/cell_metadata.py b/jupytext/cell_metadata.py index <HASH>..<HASH> 100644 --- a/jupytext/cell_metadata.py +++ b/jupytext/cell_metadata.py @@ -33,7 +33,7 @@ _IGNORE_CELL_METADATA = '-' + ','.join([ # Pre-jupytext metadata 'skipline', 'noskipline', # Jupytext metadata - 'lines_to_next_cell', 'lines_to_end_of_cell_marker']) + 'cell_marker', 'lines_to_next_cell', 'lines_to_end_of_cell_marker']) _PERCENT_CELL = re.compile( r'(# |#)%%([^\{\[]*)(|\[raw\]|\[markdown\])([^\{\[]*)(|\{.*\})\s*$')
cell_marker is another jupytext cell metadata
mwouts_jupytext
train
py
021e535a7b2feabcc86e2586a24b1e45af866f06
diff --git a/karma.conf.js b/karma.conf.js index <HASH>..<HASH> 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -45,7 +45,8 @@ module.exports = function(config) { }, preprocessors: { - 'lib/*/*.js': 'coverage' + // Don't compute coverage over lib/debug/ + 'lib/!(debug)/*.js': 'coverage', }, coverageReporter: {
Do not compute coverage over debug code Code coverage stats for debug code does not matter and skews the report. Change-Id: Id<I>a<I>c<I>e8b<I>f6e<I>e<I>bcad<I>
google_shaka-player
train
js
9ddadb7a1d59d0cc8c4d0d0ff24d9e396cad6f75
diff --git a/src/Api.php b/src/Api.php index <HASH>..<HASH> 100644 --- a/src/Api.php +++ b/src/Api.php @@ -100,7 +100,7 @@ class Api throw new \RuntimeException('Failed to read file: ' . $filename); } - return $content; + return trim($content); } /**
Prevent new lines messing up tokens
platformsh_platformsh-cli
train
php
837fd41c42be8601af15e331088355e165a8e922
diff --git a/pkg/features/kube_features.go b/pkg/features/kube_features.go index <HASH>..<HASH> 100644 --- a/pkg/features/kube_features.go +++ b/pkg/features/kube_features.go @@ -460,6 +460,7 @@ const ( // owner: @adisky // alpha: v1.14 + // beta: v1.18 // // Enables the OpenStack Cinder in-tree driver to OpenStack Cinder CSI Driver migration feature. CSIMigrationOpenStack featuregate.Feature = "CSIMigrationOpenStack" @@ -604,7 +605,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS CSIMigrationAzureFile: {Default: false, PreRelease: featuregate.Alpha}, CSIMigrationAzureFileComplete: {Default: false, PreRelease: featuregate.Alpha}, RunAsGroup: {Default: true, PreRelease: featuregate.Beta}, - CSIMigrationOpenStack: {Default: false, PreRelease: featuregate.Alpha}, + CSIMigrationOpenStack: {Default: false, PreRelease: featuregate.Beta}, // Off by default (requires OpenStack Cinder CSI driver) CSIMigrationOpenStackComplete: {Default: false, PreRelease: featuregate.Alpha}, VolumeSubpath: {Default: true, PreRelease: featuregate.GA}, BalanceAttachedNodeVolumes: {Default: false, PreRelease: featuregate.Alpha},
Flip CSIMigrationOpenStack flag to be beta and off by default
kubernetes_kubernetes
train
go
108b9fe2fac346aedc3af690d70083ad7b6125fc
diff --git a/src/Presenters/BackgroundTaskViewBridge.js b/src/Presenters/BackgroundTaskViewBridge.js index <HASH>..<HASH> 100644 --- a/src/Presenters/BackgroundTaskViewBridge.js +++ b/src/Presenters/BackgroundTaskViewBridge.js @@ -4,10 +4,10 @@ var bridge = function (presenterPath) { this.pollRate = 1000; } - window.rhubarb.viewBridgeClasses.HtmlViewBridge.apply(this, arguments); + window.rhubarb.viewBridgeClasses.ViewBridge.apply(this, arguments); }; -bridge.prototype = new window.rhubarb.viewBridgeClasses.HtmlViewBridge(); +bridge.prototype = new window.rhubarb.viewBridgeClasses.ViewBridge(); bridge.prototype.constructor = bridge; bridge.prototype.onStateLoaded = function () {
Renamed HtmlViewBridge to ViewBridge
RhubarbPHP_Scaffold.BackgroundTasks
train
js
e6069769151b91c91a107bd4d79ca3a941658518
diff --git a/cmd/helm/install.go b/cmd/helm/install.go index <HASH>..<HASH> 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -60,6 +60,7 @@ or $ helm install --set-string long_int=1234567890 myredis ./redis or + $ helm install --set-file my_script=dothings.sh myredis ./redis You can specify the '--values'/'-f' flag multiple times. The priority will be given to the
Add new line to fix code formatting in doc
helm_helm
train
go
d001c11ed879b3e5451c324a2e96ac9f864d4525
diff --git a/lib/jasmine-node/index.js b/lib/jasmine-node/index.js index <HASH>..<HASH> 100755 --- a/lib/jasmine-node/index.js +++ b/lib/jasmine-node/index.js @@ -9,12 +9,15 @@ try { var path = require('path'); var filename = __dirname + '/jasmine-2.0.0.rc1.js'; -global.window = { - setTimeout: setTimeout, - clearTimeout: clearTimeout, - setInterval: setInterval, - clearInterval: clearInterval -}; +var isWindowUndefined = typeof global.window === 'undefined'; +if (isWindowUndefined) { + global.window = { + setTimeout: setTimeout, + clearTimeout: clearTimeout, + setInterval: setInterval, + clearInterval: clearInterval + }; +} var src = fs.readFileSync(filename); var jasmine; @@ -28,7 +31,9 @@ switch (minorVersion) { jasmine = require('vm').runInThisContext(src + "\njasmine;", filename); } -delete global.window; +if (isWindowUndefined) { + delete global.window; +} require("./async-callback"); require("jasmine-reporters");
Allow custom window objects to be used. This allows using jasmine-node to do better testing against code that requires a DOM, such as can be provided by jsdom. Without this change, jasmine-node will always override any window object you set up prior to loading it.
mhevery_jasmine-node
train
js
318b5cfeb9ae30b2d0d6cffaf5761104ea3b97ab
diff --git a/lib/engine-addon.js b/lib/engine-addon.js index <HASH>..<HASH> 100644 --- a/lib/engine-addon.js +++ b/lib/engine-addon.js @@ -332,7 +332,7 @@ module.exports = { var host = findHostsHost.call(this); if (!host) { - return []; + return {}; } var hostIsEngine = !!host.ancestorHostAddons;
[BUGFIX release]: ancestorHostAddons return value Without this, you cannot build engines with who's names are built-in array methods such as "filter".
ember-engines_ember-engines
train
js
14f270f0964b2e3ba8924ca9c58416655be34405
diff --git a/dronekit/__init__.py b/dronekit/__init__.py index <HASH>..<HASH> 100644 --- a/dronekit/__init__.py +++ b/dronekit/__init__.py @@ -1161,7 +1161,8 @@ class Vehicle(HasObservers): self._armed = (m.base_mode & mavutil.mavlink.MAV_MODE_FLAG_SAFETY_ARMED) != 0 self.notify_attribute_listeners('armed', self.armed, cache=True) if self._master.mode_mapping() != None: - self._flightmode = {v: k for k, v in self._master.mode_mapping().items()}[m.custom_mode] + if m.custom_mode in {v: k for k, v in self._master.mode_mapping().items()}: + self._flightmode = {v: k for k, v in self._master.mode_mapping().items()}[m.custom_mode] self.notify_attribute_listeners('mode', self.mode, cache=True) self._system_status = m.system_status self.notify_attribute_listeners('system_status', self.system_status, cache=True)
Validate existence of custom_mode before setting
dronekit_dronekit-python
train
py
8175f6eefb9c55a8906fc8bce2dd3b7c03de3e59
diff --git a/test/test_verbose_formatter.rb b/test/test_verbose_formatter.rb index <HASH>..<HASH> 100644 --- a/test/test_verbose_formatter.rb +++ b/test/test_verbose_formatter.rb @@ -12,11 +12,10 @@ class VerboseFormatterTest < Test::Unit::TestCase def test_message @error = assert_raise(NoMethodError){ 1.zeor? } - assert_equal <<~MESSAGE.chomp, @error.message + assert_match <<~MESSAGE.strip, @error.message undefined method `zeor?' for 1:Integer Did you mean? zero? - MESSAGE end end
Relax test requirements for DYM's verbose formatter
yuki24_did_you_mean
train
rb
99e2f3f12586294ef0be677b2f7bb78b82c0a9ae
diff --git a/src/views/transfer/index.php b/src/views/transfer/index.php index <HASH>..<HASH> 100644 --- a/src/views/transfer/index.php +++ b/src/views/transfer/index.php @@ -19,8 +19,8 @@ $this->registerCss(' } '); $this->registerJs(<<<JS - jQuery('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { - jQuery('#' + e.relatedTarget.getAttribute('href').substr(1)).find('input:text, textarea').val(''); //e.target + jQuery('#domain-transfer-single').on('submit', function (e) { + $(this).find('.tab-pane').not('.active').find('input:text, textarea').val(''); }); JS );
Do not clean transfer form on tabs switching
hiqdev_hipanel-module-domain
train
php
42352557f9f5cf8af3db430f88bb335132a6ea9e
diff --git a/lib/services/local/users.go b/lib/services/local/users.go index <HASH>..<HASH> 100644 --- a/lib/services/local/users.go +++ b/lib/services/local/users.go @@ -455,10 +455,10 @@ func (s *IdentityService) GetU2fRegisterChallenge(token string) (u2fChallenge u2 // u2f.Registration cannot be json marshalled due to the public key pointer so we have this marshallable version type MarshallableU2fRegistration struct { - Raw []byte `"json:raw"` + Raw []byte `json:"raw"` - KeyHandle []byte `"json:keyhandle"` - MarshalledPubKey []byte `"json:marshalled_pubkey"` + KeyHandle []byte `json:"keyhandle"` + MarshalledPubKey []byte `json:"marshalled_pubkey"` // AttestationCert is not needed for authentication so we don't need to store it } @@ -518,7 +518,7 @@ func (s *IdentityService) GetU2fRegistration(user string) (u2fReg *u2f.Registrat } type U2fRegistrationCounter struct { - Counter uint32 `"json:counter"` + Counter uint32 `json:"counter"` } func (s *IdentityService) UpsertU2fRegistrationCounter(user string, counter uint32) (e error) {
fix struct field tags causing test failure
gravitational_teleport
train
go
aad3b651834d79ccd7fdc4e7a9437220da6e9503
diff --git a/src/lib/widget/default.js b/src/lib/widget/default.js index <HASH>..<HASH> 100644 --- a/src/lib/widget/default.js +++ b/src/lib/widget/default.js @@ -136,7 +136,7 @@ define(['../util', '../assets', '../i18n'], function(util, assets, i18n) { } }; elements.connectForm.userAddress.addEventListener('keyup', adjustButton); - adjustButton(); + adjustButton(); if(connectionError) { // error bubbled from webfinger @@ -150,7 +150,16 @@ define(['../util', '../assets', '../i18n'], function(util, assets, i18n) { addBubbleHint(t('typing-hint')); } - setCubeAction(jumpAction('initial')); + function hideBubble(evt) { + evt.preventDefault(); + evt.stopPropagation(); + setState('initial'); + document.body.removeEventListener('click', hideBubble); + return false; + } + + setCubeAction(hideBubble); + document.body.addEventListener('click', hideBubble); elements.connectForm.userAddress.focus(); },
also hide bubble on body click, when in 'typing' state
remotestorage_remotestorage.js
train
js
9fb9efe10e2b61156943b306bafba0a70beb5485
diff --git a/packages/eslint-config-cozy-app/index.js b/packages/eslint-config-cozy-app/index.js index <HASH>..<HASH> 100644 --- a/packages/eslint-config-cozy-app/index.js +++ b/packages/eslint-config-cozy-app/index.js @@ -20,6 +20,7 @@ module.exports = { 'prettier/prettier': ['error', { singleQuote: true, semi: false - }] + }], + 'react/prop-types': 0 } }
chore: disable proptypes checking in eslint config :wrench:
CPatchane_create-cozy-app
train
js
49e2fbe5917c359f48b5e50062df01fb5554daf8
diff --git a/terminal/runereader.go b/terminal/runereader.go index <HASH>..<HASH> 100644 --- a/terminal/runereader.go +++ b/terminal/runereader.go @@ -41,14 +41,18 @@ func (rr *RuneReader) ReadLine(mask rune) ([]rune, error) { // we get the terminal width and height (if resized after this point the property might become invalid) terminalSize, _ := cursor.Size(rr.Buffer()) + // we set the current location of the cursor once + cursorCurrent, _ := cursor.Location(rr.Buffer()) + for { // wait for some input r, _, err := rr.ReadRune() if err != nil { return line, err } - // we set the current location of the cursor and update it after every key press - cursorCurrent, err := cursor.Location(rr.Buffer()) + // increment cursor location + cursorCurrent.X++ + // if the user pressed enter or some other newline/termination like ctrl+d if r == '\r' || r == '\n' || r == KeyEndTransmission { // delete what's printed out on the console screen (cleanup)
Fix #<I> by not using ANSI DSR on every key press (#<I>) Instead of using the ANSI DSR escape code on every key press, only do it once at the beginning of reading input, and keep track of cursor location ourselves.
AlecAivazis_survey
train
go
c616b5da69f6314a7b651405a5bcf633cf1010bc
diff --git a/Input/InputDefinition.php b/Input/InputDefinition.php index <HASH>..<HASH> 100644 --- a/Input/InputDefinition.php +++ b/Input/InputDefinition.php @@ -21,17 +21,20 @@ class InputDefinition extends ConsoleInputDefinition public function getSynopsis() { $elements = array(); + $flags = array(); foreach ($this->getOptions() as $option) { $shortcut = $option->getShortcut() ? sprintf('-%s|', $option->getShortcut()) : ''; if ($option instanceof InputOption && $option->isFlag()) { - $elements[] = sprintf('[%s--%s]', $shortcut, $option->getName()); + $flags[] = sprintf('[%s--%s]', $shortcut, $option->getName()); } else { $elements[] = sprintf('[' . ($option->isValueRequired() ? '%s--%s="..."' : ($option->isValueOptional() ? '%s--%s[="..."]' : '%s--%s')) . ']', $shortcut, $option->getName()); } } + $elements = array_merge($elements, $flags); + foreach ($this->getArguments() as $argument) { $elements[] = sprintf($argument->isRequired() ? '%s' : '[%s]', $argument->getName() . ($argument->isArray() ? '1' : ''));
Display flags at the end of synopsis
in2pire_in2pire-cli
train
php
6b55fe1a87852bd440b32b53b1abf683aacd17db
diff --git a/packages/jollof-data-arangodb/jollofDataArangoDB.js b/packages/jollof-data-arangodb/jollofDataArangoDB.js index <HASH>..<HASH> 100644 --- a/packages/jollof-data-arangodb/jollofDataArangoDB.js +++ b/packages/jollof-data-arangodb/jollofDataArangoDB.js @@ -63,8 +63,10 @@ class JollofDataArangoDB { this.connectionOptions = options || {}; - this._convertConditionsFromJollof = convertConditionsFromJollof; - this._convertToJollof = convertToJollof; + this.convertConditionsFromJollof = convertConditionsFromJollof; + this.convertToJollof = convertToJollof; + + this.arangojs = arangojs; } async ensureConnection() {
- added this.arangojs to arango dapter
iyobo_jollofjs
train
js
ad7cd5af82de99b018a335604614d8df7cac6da5
diff --git a/modules/orionode/server.js b/modules/orionode/server.js index <HASH>..<HASH> 100644 --- a/modules/orionode/server.js +++ b/modules/orionode/server.js @@ -31,8 +31,9 @@ function auth(pwd) { // Get the arguments, the workspace directory, and the password file (if configured), then launch the server var args = argslib.parseArgs(process.argv); var port = args.port || args.p || 8081; +var configFile = args.config || args.c || path.join(__dirname, 'orion.conf'); -argslib.readConfigFile(path.join(__dirname, 'orion.conf'), function(configParams) { +argslib.readConfigFile(configFile, function(configParams) { configParams = configParams || {}; var workspaceArg = args.workspace || args.w;
Bug <I> - server.js entry point should accept alternative path to conf file Change-Id: Ic6d3b0ecdd3a9f<I>fdbef<I>fb<I>d6b2fefd
eclipse_orion.client
train
js
e7d36ff9134065e2d9498d3875b1f1c7d2436cb4
diff --git a/src/main/java/org/gwtbootstrap3/extras/datetimepicker/client/ui/base/DateTimePickerBase.java b/src/main/java/org/gwtbootstrap3/extras/datetimepicker/client/ui/base/DateTimePickerBase.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/gwtbootstrap3/extras/datetimepicker/client/ui/base/DateTimePickerBase.java +++ b/src/main/java/org/gwtbootstrap3/extras/datetimepicker/client/ui/base/DateTimePickerBase.java @@ -153,7 +153,7 @@ public class DateTimePickerBase extends Widget implements HasEnabled, HasId, Has /** * DEFAULT values */ - private String format = "mm/dd/yyyy HH:ii"; + private String format = "mm/dd/yyyy hh:ii"; private DateTimePickerDayOfWeek weekStart = DateTimePickerDayOfWeek.SUNDAY; private DateTimePickerDayOfWeek[] daysOfWeekDisabled = {}; private boolean autoClose = false; @@ -213,7 +213,7 @@ public class DateTimePickerBase extends Widget implements HasEnabled, HasId, Has return textBox.isReadOnly(); } - + /** {@inheritDoc} */ @Override public boolean isEnabled() {
Changed default format to use <I> hour format The default format was using <I> hour format, while showMeredian is default of. This was confusing.
gwtbootstrap3_gwtbootstrap3-extras
train
java
542bdd6bb1ad4d5b51d0b75a1cce341f6b5bab52
diff --git a/unittest/Si_test.py b/unittest/Si_test.py index <HASH>..<HASH> 100755 --- a/unittest/Si_test.py +++ b/unittest/Si_test.py @@ -28,11 +28,11 @@ class TestDynaphopy(unittest.TestCase): def test_force_constants_self_consistency(self): trajectory = io.generate_test_trajectory(self.structure, supercell=[2, 2, 2], total_time=10, silent=False) calculation = dynaphopy.Quasiparticle(trajectory) - calculation.select_power_spectra_algorithm(1) + calculation.select_power_spectra_algorithm(2) renormalized_force_constants = calculation.get_renormalized_force_constants().get_array() harmonic_force_constants = calculation.dynamic.structure.get_force_constants().get_array() - self.assertEqual(np.allclose(renormalized_force_constants, harmonic_force_constants, rtol=1, atol=1.e-1), True) + self.assertEqual(np.allclose(renormalized_force_constants, harmonic_force_constants, rtol=1, atol=1.e-2), True) def test_q_points_data(self):
update silicon tests to increase trajectory length for MEM
abelcarreras_DynaPhoPy
train
py
7822c3d092c1aafddef7e385947ff26bd5888c3f
diff --git a/test/sql_test.rb b/test/sql_test.rb index <HASH>..<HASH> 100644 --- a/test/sql_test.rb +++ b/test/sql_test.rb @@ -139,11 +139,11 @@ class TestSql < Minitest::Test # https://gist.github.com/jprante/7099463 def test_where_range_array store [ - {name: "Product A", user_ids: [11, 23, 13, 16, 17, 23.6]}, - {name: "Product B", user_ids: [1, 2, 3, 4, 5, 6, 7, 8, 8.9, 9.1, 9.4]}, + {name: "Product A", user_ids: [11, 23, 13, 16, 17, 23]}, + {name: "Product B", user_ids: [1, 2, 3, 4, 5, 6, 7, 8, 9]}, {name: "Product C", user_ids: [101, 230, 150, 200]} ] - assert_search "product", ["Product A"], where: {user_ids: {gt: 10, lt: 23.9}} + assert_search "product", ["Product A"], where: {user_ids: {gt: 10, lt: 24}} end def test_where_range_array_again @@ -301,9 +301,9 @@ class TestSql < Minitest::Test def test_big_decimal store [ - {name: "Product", latitude: 100.0} + {name: "Product", latitude: 80.0} ] - assert_search "product", ["Product"], where: {latitude: {gt: 99}} + assert_search "product", ["Product"], where: {latitude: {gt: 79}} end # load
Fixed issues with tests for <I>
ankane_searchkick
train
rb
15caf72b9f111639127409214df8456fbbb17a2a
diff --git a/src/Api/Abstract.js b/src/Api/Abstract.js index <HASH>..<HASH> 100644 --- a/src/Api/Abstract.js +++ b/src/Api/Abstract.js @@ -309,7 +309,7 @@ class ApiAbstract extends Abstract { }) .then(() => { timer.stop(); - var updated = _.defaultsDeep(validData, doc); + var updated = _.defaultsDeep(_.cloneDeep(validData), doc); resolve(updated); }) .catch((error) => { @@ -378,7 +378,7 @@ class ApiAbstract extends Abstract { }) .then(() => { timer.stop(); - var updated = _.defaultsDeep(validData, doc); + var updated = _.defaultsDeep(_.cloneDeep(validData), doc); resolve(updated); }) .catch((error) => {
chg: Api/Abstract clone object before merging with original doc
alekzonder_maf
train
js
60b4b987b9b0ecfbe1ffada83a241d1e53e8d8ae
diff --git a/code/javascript/core/scripts/selenium-browserbot.js b/code/javascript/core/scripts/selenium-browserbot.js index <HASH>..<HASH> 100644 --- a/code/javascript/core/scripts/selenium-browserbot.js +++ b/code/javascript/core/scripts/selenium-browserbot.js @@ -180,17 +180,24 @@ BrowserBot.prototype._windowClosed = function(win) { return c; }; +// +// +// +// temporarily commented out LOG calls in _modifyWindow which lead to an infinite loop: +// +// +// BrowserBot.prototype._modifyWindow = function(win) { if (this._windowClosed(win)) { - LOG.error("modifyWindow: Window was closed!"); + //LOG.error("modifyWindow: Window was closed!"); return null; } - LOG.debug('modifyWindow ' + this.uniqueId + ":" + win[this.uniqueId]); + //LOG.debug('modifyWindow ' + this.uniqueId + ":" + win[this.uniqueId]); if (!win[this.uniqueId]) { win[this.uniqueId] = true; this.modifyWindowToRecordPopUpDialogs(win, this); this.currentPage = PageBot.createForWindow(this); - LOG.debug("_modifyWindow newPageLoaded = false"); + //LOG.debug("_modifyWindow newPageLoaded = false"); this.newPageLoaded = false; } if (!this.proxyInjectionMode) {
temporarily commented out LOG calls in _modifyWindow which lead to an infinite loop when run from s-rc r<I>
SeleniumHQ_selenium
train
js
ad1591af1ee03d35780550b6f3588e740f9089e9
diff --git a/src/client/transport/socketio.js b/src/client/transport/socketio.js index <HASH>..<HASH> 100644 --- a/src/client/transport/socketio.js +++ b/src/client/transport/socketio.js @@ -100,8 +100,8 @@ export class SocketIO { this.socket.on('sync', (gameID, state, log, gameMetadata) => { if (gameID == this.gameID) { const action = ActionCreators.sync(state, log); - this.store.dispatch(action); this.gameMetadataCallback(gameMetadata); + this.store.dispatch(action); } });
call gameMetadataCallback() before dispatching (#<I>)
nicolodavis_boardgame.io
train
js
c72f7b745c3b2266b796f7e92c772a47fdf6919e
diff --git a/lib/task.js b/lib/task.js index <HASH>..<HASH> 100644 --- a/lib/task.js +++ b/lib/task.js @@ -270,7 +270,7 @@ function factory( } else if (item.tag === '_v') { depth = _.isNumber(depth) ? depth : 0; var type = _.get(context, item.n); - if(typeof type === 'string' || type instanceof String || type === null) { + if(typeof type === 'string' || type instanceof String || typeof type === 'undefined' || type === null) { isString = true; } else { isString = false;
Fixing hound to pass the tests
RackHD_on-tasks
train
js
303077fdb5cf03881d240c7c090f2d3f9b7a1ccd
diff --git a/version.php b/version.php index <HASH>..<HASH> 100644 --- a/version.php +++ b/version.php @@ -5,7 +5,7 @@ // database to determine whether upgrades should // be performed (see lib/db/*.php) -$version = 2002111401; // The current version is a date (YYYYMMDDXX) +$version = 2002111700; // The current version is a date (YYYYMMDDXX) -$release = "1.0.6.3"; // User-friendly version number +$release = "1.0.6.3 +"; // User-friendly version number
Updated version for those using CVS etc
moodle_moodle
train
php
6fe5b159b33a443a7b414e6bb9cd129898ab39f4
diff --git a/tests/test_61_makemeta.py b/tests/test_61_makemeta.py index <HASH>..<HASH> 100644 --- a/tests/test_61_makemeta.py +++ b/tests/test_61_makemeta.py @@ -265,3 +265,11 @@ def test_do_idp_sso_descriptor(): assert isinstance(res[1], mdui.UIInfo) elif isinstance(res[1], shibmd.Scope): assert isinstance(res[0], mdui.UIInfo) + + found = exts.find_extensions(mdui.UIInfo.c_tag, mdui.NAMESPACE) + assert len(found) == 1 + + elem = exts.extensions_as_elements(mdui.UIInfo.c_tag, mdui) + assert len(elem) == 1 + assert isinstance(elem[0], mdui.UIInfo) +
Added some more subtest of different methods
IdentityPython_pysaml2
train
py
fd8136fa755a3c59e459e1168014f2bf2fca721a
diff --git a/src/transformers/modeling_utils.py b/src/transformers/modeling_utils.py index <HASH>..<HASH> 100644 --- a/src/transformers/modeling_utils.py +++ b/src/transformers/modeling_utils.py @@ -1049,7 +1049,8 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix # Handle the case where some state_dict keys shouldn't be saved if self._keys_to_ignore_on_save is not None: - state_dict = {k: v for k, v in state_dict.items() if k not in self._keys_to_ignore_on_save} + for ignore_key in self._keys_to_ignore_on_save: + del state_dict[ignore_key] # If we save using the predefined names, we can load using `from_pretrained` output_model_file = os.path.join(save_directory, WEIGHTS_NAME)
improve rewrite state_dict missing _metadata (#<I>)
huggingface_pytorch-pretrained-BERT
train
py
0ecaad98cd761c9d2a2c0f3e547fdc3c171973c2
diff --git a/modules/Cockpit/Helper/Revisions.php b/modules/Cockpit/Helper/Revisions.php index <HASH>..<HASH> 100644 --- a/modules/Cockpit/Helper/Revisions.php +++ b/modules/Cockpit/Helper/Revisions.php @@ -15,7 +15,7 @@ class Revisions extends \Lime\Helper { return $this->storage->count("cockpit/revisions", ["_oid" => $id]); } - public function list($id) { + public function revlist($id) { return $this->storage->find("cockpit/revisions", [ "filter" => ["_oid" => $id], diff --git a/modules/Collections/Controller/Admin.php b/modules/Collections/Controller/Admin.php index <HASH>..<HASH> 100755 --- a/modules/Collections/Controller/Admin.php +++ b/modules/Collections/Controller/Admin.php @@ -268,7 +268,7 @@ class Admin extends \Cockpit\AuthController { return false; } - $revisions = $this->app->helper('revisions')->list($id); + $revisions = $this->app->helper('revisions')->revlist($id); return $this->render('collections:views/revisions.php', compact('collection', 'entry', 'revisions'));
changed 'list' method in Revisions to avoid error in PHP >=<I>
agentejo_cockpit
train
php,php
9e79d34215737bb85a7150fd2339aebb1bed700d
diff --git a/packages/sw-precaching/src/lib/revisioned-cache-manager.js b/packages/sw-precaching/src/lib/revisioned-cache-manager.js index <HASH>..<HASH> 100644 --- a/packages/sw-precaching/src/lib/revisioned-cache-manager.js +++ b/packages/sw-precaching/src/lib/revisioned-cache-manager.js @@ -256,6 +256,7 @@ class RevisionedCacheManager { let response = await fetch(fileEntry.cacheBustRequest, { credentials: 'same-origin', + redirect: 'follow', }); if (response.ok) {
Explicitly set `redirect: follow` when precaching (#<I>)
GoogleChrome_workbox
train
js
a66e4f9e10c6ac9cea4dc1597cb44d01089b279a
diff --git a/services/github/github-forks.service.js b/services/github/github-forks.service.js index <HASH>..<HASH> 100644 --- a/services/github/github-forks.service.js +++ b/services/github/github-forks.service.js @@ -10,9 +10,7 @@ const { documentation, transformErrors } = require('./github-helpers') const schema = Joi.object({ data: Joi.object({ repository: Joi.object({ - forks: Joi.object({ - totalCount: nonNegativeInteger, - }).required(), + forkCount: nonNegativeInteger, }).required(), }).required(), }).required() @@ -78,9 +76,7 @@ module.exports = class GithubForks extends GithubAuthV4Service { query: gql` query($user: String!, $repo: String!) { repository(owner: $user, name: $repo) { - forks { - totalCount - } + forkCount } } `, @@ -91,7 +87,7 @@ module.exports = class GithubForks extends GithubAuthV4Service { return this.constructor.render({ user, repo, - forkCount: json.data.repository.forks.totalCount, + forkCount: json.data.repository.forkCount, }) } }
change query for fork count (#<I>)
badges_shields
train
js
4a59efc2aadf50e91d5205f0a9d910564fc98ec7
diff --git a/lib/rdl/boot_rails.rb b/lib/rdl/boot_rails.rb index <HASH>..<HASH> 100644 --- a/lib/rdl/boot_rails.rb +++ b/lib/rdl/boot_rails.rb @@ -2,9 +2,14 @@ if Rails.env.development? || Rails.env.test? require 'rdl/boot' require 'types/core' - dir = Rails::VERSION::STRING.split('.')[0] + ".x" - require_relative "../types/rails-#{dir}/_helpers.rb" # load type aliases first - Dir[File.dirname(__FILE__) + "/../types/rails-#{dir}/**/*.rb"].each { |f| require f } + version = Rails::VERSION::STRING.split('.')[0] + ".x" + + begin + require_relative "../types/rails-#{version}/_helpers.rb" # load type aliases first + Dir[File.dirname(__FILE__) + "/../types/rails-#{version}/**/*.rb"].each { |f| require f } + rescue LoadError + $stderr.puts("rdl could not load type definitions for Rails v#{version}") + end elsif Rails.env.production? require 'rdl_disable' class ActionController::Base
Rescue LoadError in boot_rails.rb
plum-umd_rdl
train
rb
86ed32e765c826a208d421e023c8453c116457c7
diff --git a/lib/redlander/statement.rb b/lib/redlander/statement.rb index <HASH>..<HASH> 100644 --- a/lib/redlander/statement.rb +++ b/lib/redlander/statement.rb @@ -121,9 +121,9 @@ module Redlander when NilClass nil when Node - source.rdf_node + Redland.librdf_new_node_from_node(source.rdf_node) else - Node.new(source).rdf_node + Redland.librdf_new_node_from_node(Node.new(source).rdf_node) end end end diff --git a/spec/integration/finalizer_gc_spec.rb b/spec/integration/finalizer_gc_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration/finalizer_gc_spec.rb +++ b/spec/integration/finalizer_gc_spec.rb @@ -67,11 +67,9 @@ describe "garbage collection" do GC.start expect(ObjectSpace.each_object(Model).count).to eq(0) expect(ObjectSpace.each_object(Statement).count).to eq(0) - expect(ObjectSpace.each_object(Node).count).to eq(0) expect(ObjectSpace.each_object(Query::Results).count).to eq(0) end - private def test_statement
copy librdf_node pointer on statement construction librdf_new_node_from_node will increase the reference count for the librdf_node to match the corresponding free of both librdf_node(s) and librdf_statement term(s). Incrementing and decrementing the reference count allows the raptor_term to be free'd only when nothing else references it. refs #3
cordawyn_redlander
train
rb,rb
d431ea6dbabf99c22793be66e4123fda2c931046
diff --git a/lib/Predis/Protocol/Text/ComposableProtocolProcessor.php b/lib/Predis/Protocol/Text/ComposableProtocolProcessor.php index <HASH>..<HASH> 100644 --- a/lib/Predis/Protocol/Text/ComposableProtocolProcessor.php +++ b/lib/Predis/Protocol/Text/ComposableProtocolProcessor.php @@ -26,8 +26,8 @@ use Predis\Protocol\ResponseReaderInterface; */ class ComposableProtocolProcessor implements ProtocolProcessorInterface { - private $serializer; - private $reader; + protected $serializer; + protected $reader; /** * @param RequestSerializerInterface $serializer Request serializer. diff --git a/lib/Predis/Protocol/Text/ProtocolProcessor.php b/lib/Predis/Protocol/Text/ProtocolProcessor.php index <HASH>..<HASH> 100644 --- a/lib/Predis/Protocol/Text/ProtocolProcessor.php +++ b/lib/Predis/Protocol/Text/ProtocolProcessor.php @@ -28,8 +28,8 @@ use Predis\Protocol\ProtocolProcessorInterface; */ class ProtocolProcessor implements ProtocolProcessorInterface { - private $mbiterable; - private $serializer; + protected $mbiterable; + protected $serializer; /** *
Change visibility of some members. There's no actual need for these ones to be private.
imcj_predis
train
php,php
4b3adee5824b287e0490832bbec4fc544c8d5798
diff --git a/lib/query_string_search/matchers/match_attribute_value.rb b/lib/query_string_search/matchers/match_attribute_value.rb index <HASH>..<HASH> 100644 --- a/lib/query_string_search/matchers/match_attribute_value.rb +++ b/lib/query_string_search/matchers/match_attribute_value.rb @@ -1,7 +1,7 @@ class MatchAttributeValue < QueryStringSearch::AbstractMatcher def match?(data) match_with_contingency do - QueryStringSearch::Comparator.does(desired_value).equal?(actual_value(data)) + QueryStringSearch::Comparator.using(operator).does(desired_value).compare_with?(actual_value(data)) end end
Convert MatchAttributeValue to use the operator
umn-asr_query_string_search
train
rb
d705b7bef4102c370fc6450413f7a18c3cd99afb
diff --git a/metpy/io/nexrad.py b/metpy/io/nexrad.py index <HASH>..<HASH> 100644 --- a/metpy/io/nexrad.py +++ b/metpy/io/nexrad.py @@ -380,7 +380,7 @@ class Level2File(object): #TODO: need to parse VCP descriptions in this data msg_fmt = NamedStruct(fields, '>', 'Msg18Fmt') - self.rda_adaptation_data = msg_fmt.unpack_from(data, 0) + self.rda_adaptation_data = msg_fmt.unpack(data) msg31_data_hdr_fmt = NamedStruct([('stid', '4s'), ('time_ms', 'L'),
Use unpack() rather than unpack_from(). We should be using all the data in the unpack, and using unpack() will check this.
Unidata_MetPy
train
py
826047fdc5f6c1af4d90122f54cecd042ce65f4d
diff --git a/listing-bundle/src/Resources/contao/config/autoload.php b/listing-bundle/src/Resources/contao/config/autoload.php index <HASH>..<HASH> 100644 --- a/listing-bundle/src/Resources/contao/config/autoload.php +++ b/listing-bundle/src/Resources/contao/config/autoload.php @@ -29,11 +29,21 @@ /** - * Register the module classes + * Register the classes */ -Autoloader::addClasses(array +ClassLoader::addClasses(array ( - 'ModuleListing' => 'system/modules/listing/ModuleListing.php' + 'ModuleListing' => 'system/modules/listing/ModuleListing.php', +)); + + +/** + * Register the templates + */ +TemplateLoader::addFiles(array +( + 'info_default' => 'system/modules/listing/templates', + 'list_default' => 'system/modules/listing/templates', )); ?> \ No newline at end of file
[Listing] Added a "merge extensions" script to convert Contao 2 extensions
contao_contao
train
php
36b1798807a0c80105899bd4bab06434865b9ad3
diff --git a/lib/Associations/Many.js b/lib/Associations/Many.js index <HASH>..<HASH> 100644 --- a/lib/Associations/Many.js +++ b/lib/Associations/Many.js @@ -125,6 +125,9 @@ function extendInstance(Model, Instance, Driver, association, opts, cb) { options.__merge.where[1][association.mergeId] = Instance[Model.id]; if (Instances.length) { + if (Array.isArray(Instances[0])) { + Instances = Instances[0]; + } options.__merge.where[1][association.mergeAssocId] = []; for (var i = 0; i < Instances.length; i++) { @@ -136,6 +139,9 @@ function extendInstance(Model, Instance, Driver, association, opts, cb) { if (err) { return cb(err); } + if (!Instances.length) { + return cb(null, instances.length > 0); + } return cb(null, instances.length == Instances.length); }); return this;
Adds ability to pass an Array to hasMany.hasAccessor and also not passing any instance to hasAccessor and have it check for any associated item Example: ```js Person.hasPets([ ..., ... ], cb); // now it's possible Person.hasPets(cb); // check if there any associations at all ```
dresende_node-orm2
train
js
d9536961cc9f5868dd4c0a693ea73837efbf31b7
diff --git a/tools/vis2.py b/tools/vis2.py index <HASH>..<HASH> 100755 --- a/tools/vis2.py +++ b/tools/vis2.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/local/bin/python2.7 # This is a visualizer which pulls TPC-C benchmark results from the MySQL # databases and visualizes them. Four graphs will be generated, latency graph on @@ -16,7 +16,7 @@ import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.ticker as ticker -from voltdbclientpy2 import * +from voltdbclient import * import numpy as np import csv import time @@ -341,7 +341,7 @@ def plot(title, xlabel, ylabel, filename, width, height, app, data, series, mind if failed: for pos in ['top', 'bottom', 'right', 'left']: pl.ax.spines[pos].set_edgecolor(color) - pl.ax.set_axis_bgcolor(color) + pl.ax.set_facecolor(color) pl.ax.patch.set_alpha(0.1) bdata.update(failed=failed, bgcolor=color)
ENG-<I>: Check current version of vis2.py into git/github (#<I>) Rectify the divergence of the checked in version of vis2.py and the version actually used by the performance-graphs Jenkins job (<URL>), i.e., on the 'ci' (.voltdb.lan) machine: /mnt/jenkins/jobs/performance-graphs/workspace/tools/vis2.py
VoltDB_voltdb
train
py
893827dd6357a83f6b67ccf604ef6076024a9e3e
diff --git a/src/core/jvm/insn/TableSwitchInstruction.js b/src/core/jvm/insn/TableSwitchInstruction.js index <HASH>..<HASH> 100644 --- a/src/core/jvm/insn/TableSwitchInstruction.js +++ b/src/core/jvm/insn/TableSwitchInstruction.js @@ -22,7 +22,7 @@ export default class TableSwitchInstruction extends PaddedInstruction { this.highByte = buffer.int(); this.jumpOffsets = []; - let offsetCount = (highByte - lowByte + 1); + let offsetCount = (this.highByte - this.lowByte + 1); for (let i = 0; i < offsetCount; i++) { this.jumpOffsets[i] = buffer.int(); }
fix bug in TableSwitchInstruction wasn't properly referencing it's properties using `this`
kylestev_jvm.js
train
js
24eca428a62a30697664c7f194f2a2e3c7e801ed
diff --git a/system/src/Grav/Common/GPM/Response.php b/system/src/Grav/Common/GPM/Response.php index <HASH>..<HASH> 100644 --- a/system/src/Grav/Common/GPM/Response.php +++ b/system/src/Grav/Common/GPM/Response.php @@ -220,11 +220,12 @@ class Response if ($bytes_transferred > 0) { if ($notification_code == STREAM_NOTIFY_PROGRESS | STREAM_NOTIFY_COMPLETED || $isCurlResource) { + $percent = $filesize <= 0 ? 0 : round(($bytes_transferred * 100) / $filesize, 1); $progress = [ 'code' => $notification_code, 'filesize' => $filesize, 'transferred' => $bytes_transferred, - 'percent' => $filesize <= 0 ? '-' : round(($bytes_transferred * 100) / $filesize, 1) + 'percent' => $percent < 100 ? $percent : 100 ]; if (self::$callback !== null) {
Force response % to be 0 - <I> only
getgrav_grav
train
php
0dfb1fea3c8c6cabc88519164939894a690b546e
diff --git a/dreamssh/config.py b/dreamssh/config.py index <HASH>..<HASH> 100644 --- a/dreamssh/config.py +++ b/dreamssh/config.py @@ -54,7 +54,6 @@ class Configurator(object): def __init__(self, main=None, ssh=None): self.main = main self.ssh = ssh - self.updateConfig() def buildDefaults(self): config = SafeConfigParser() @@ -115,4 +114,5 @@ class Configurator(object): return config -Configurator(main, ssh) +configurator = Configurator(main, ssh) +configurator.updateConfig()
Needed to move the call of updateConfig(). Subclasses need to be able to govern when updateConfig actually gets called, so it got moved out of the constructor.
oubiwann_carapace
train
py
3ce125c55056cec24d9df6ce428a0cb1597231a3
diff --git a/src/idle/idle.js b/src/idle/idle.js index <HASH>..<HASH> 100644 --- a/src/idle/idle.js +++ b/src/idle/idle.js @@ -195,8 +195,20 @@ angular.module('ngIdle.idle', ['ngIdle.keepalive', 'ngIdle.localStorage']) } }; - $document.find('body').on(options.interrupt, function() { - svc.interrupt(); + $document.find('body').on(options.interrupt, function(event) { + /* + note: + webkit fires fake mousemove events when the user has done nothing, so the idle will never time out while the cursor is over the webpage + Original webkit bug report which caused this issue: + https://bugs.webkit.org/show_bug.cgi?id=17052 + Chromium bug reports for issue: + https://code.google.com/p/chromium/issues/detail?id=5598 + https://code.google.com/p/chromium/issues/detail?id=241476 + https://code.google.com/p/chromium/issues/detail?id=317007 + */ + if (event.type !== 'mousemove' || (event.movementX || event.movementY)) { + svc.interrupt(); + } }); var wrap = function(event) {
webkit-fake-mousemove-fix Added a workaround for ignoring the fake mousemove events fired by Webkit browsers
HackedByChinese_ng-idle
train
js
11c910ec8c260bf3d71a969e9844da7c210d2d24
diff --git a/core/server/models/post.js b/core/server/models/post.js index <HASH>..<HASH> 100644 --- a/core/server/models/post.js +++ b/core/server/models/post.js @@ -343,14 +343,21 @@ Post = ghostBookshelf.Model.extend({ } if (this.hasChanged('html') || !this.get('plaintext')) { - this.set('plaintext', htmlToText.fromString(this.get('html'), { + const plaintext = htmlToText.fromString(this.get('html'), { wordwrap: 80, ignoreImage: true, hideLinkHrefIfSameAsText: true, preserveNewlines: true, returnDomByDefault: true, uppercaseHeadings: false - })); + }); + + // CASE: html is e.g. <p></p> + // @NOTE: Otherwise we will always update the resource to `plaintext: ''` and Bookshelf thinks that this + // value was modified. + if (plaintext) { + this.set('plaintext', plaintext); + } } // disabling sanitization until we can implement a better version
Avoided to store empty plaintext if html does not contain any text no issue
TryGhost_Ghost
train
js
39dd46149acaf26cfb5e888638414aaf6520258c
diff --git a/aredis/connection.py b/aredis/connection.py index <HASH>..<HASH> 100644 --- a/aredis/connection.py +++ b/aredis/connection.py @@ -220,6 +220,12 @@ class BaseConnection: def __repr__(self): return self.description.format(**self._description_args) + def __del__(self): + try: + self.disconnect() + except Exception: + pass + async def connect(self): raise NotImplementedError @@ -294,9 +300,10 @@ class BaseConnection: "Disconnects from the Redis server" self._parser.on_disconnect() try: - if not self._reader: + if self._reader: self._reader.close() - if not self._writer: + if self._writer: + self._writer.transport.close() self._writer.close() except Exception: pass
OPT: add __del__ to BaseConnection
NoneGG_aredis
train
py
88378aa1e5c8b80b9e5df81413a3112d5a2f250f
diff --git a/lib/jets/stack/main/extensions/lambda.rb b/lib/jets/stack/main/extensions/lambda.rb index <HASH>..<HASH> 100644 --- a/lib/jets/stack/main/extensions/lambda.rb +++ b/lib/jets/stack/main/extensions/lambda.rb @@ -38,7 +38,7 @@ module Jets::Stack::Main::Dsl } function_name = "#{Jets.config.project_namespace}-#{class_namespace}-#{meth}" - function_name.size > MAX_FUNCTION_NAME_SIZE ? nil : function_name + function_name = function_name.size > MAX_FUNCTION_NAME_SIZE ? nil : function_name defaults[:function_name] = function_name if function_name props = defaults.merge(props)
fix s3 event function for long bucket names
tongueroo_jets
train
rb
79c788c0df1f7e3755187334fb08ddc73f9d4747
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -67,7 +67,7 @@ function matchTerm(pattern) { type = ARR; } - if (type) return {type: type, name: possible.substring(6)}; + if (type) return {type: type, name: possible.slice(6)}; } /**
chore: replace substring with slice (faster on v8)
dumberjs_ast-matcher
train
js
215bdf12f61b4e5ebc5e2b745a84f7c665491f90
diff --git a/doc/test_messages_documentation.py b/doc/test_messages_documentation.py index <HASH>..<HASH> 100644 --- a/doc/test_messages_documentation.py +++ b/doc/test_messages_documentation.py @@ -2,7 +2,7 @@ # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE # Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt -"""Functional tests for the code examples in the messages documentation.""" +"""Functional tests for the code examples in the messages' documentation.""" import sys @@ -41,6 +41,11 @@ def get_functional_test_files_from_directory(input_dir: Path) -> List[Tuple[str, for subdirectory in input_dir.iterdir(): for message_dir in subdirectory.iterdir(): + assert_msg = ( + f"{subdirectory}: '{message_dir.name}' is in the wrong " + f"directory: it does not start with '{subdirectory.name}'" + ) + assert message_dir.name.startswith(subdirectory.name), assert_msg if (message_dir / "good.py").exists(): suite.append( (message_dir.stem, message_dir / "good.py"),
Add an assertion to check that the documentation structure is correct (#<I>)
PyCQA_pylint
train
py
2ddb2208c4276d2d895c05a631e3f2f1ed72e874
diff --git a/pyphi/config.py b/pyphi/config.py index <HASH>..<HASH> 100644 --- a/pyphi/config.py +++ b/pyphi/config.py @@ -62,7 +62,7 @@ These settings control the algorithms PyPhi uses. ``pyphi.distance.measures.register`` decorator; see :mod:`~pyphi.distance` for examples. A full list of currently installed measures is available by calling ``print(pyphi.distance.measures.all())``. Note that some measures - cannot be used for calculating big-phi because they are asymmetric. + cannot be used for calculating |big_phi| because they are asymmetric. >>> defaults['MEASURE'] 'EMD' @@ -127,8 +127,8 @@ These settings control the algorithms PyPhi uses. - ``SYSTEM_CUTS``: If set to ``'3.0_STYLE'``, then traditional IIT 3.0 cuts will be used when - computing big-phi. If set to ``'CONCEPT_STYLE'``, then experimental concept- - style system cuts will be used instead. + computing |big_phi|. If set to ``'CONCEPT_STYLE'``, then experimental + concept- style system cuts will be used instead. >>> defaults['SYSTEM_CUTS'] '3.0_STYLE'
Docs: Fix to use `|big_phi|` RST substitution
wmayner_pyphi
train
py
29f84846ebff0d5c5ea57bff1b44fcef570f3247
diff --git a/slug.go b/slug.go index <HASH>..<HASH> 100644 --- a/slug.go +++ b/slug.go @@ -9,6 +9,8 @@ import ( "regexp" "strings" + "bytes" + "github.com/rainycape/unidecode" ) @@ -89,15 +91,16 @@ func Substitute(s string, sub map[string]string) (buf string) { // SubstituteRune substitutes string chars with provided rune // substitution map. -func SubstituteRune(s string, sub map[rune]string) (buf string) { +func SubstituteRune(s string, sub map[rune]string) (result string) { + var buf bytes.Buffer for _, c := range s { if d, ok := sub[c]; ok { - buf += d + buf.WriteString(d) } else { - buf += string(c) + buf.WriteRune(c) } } - return + return buf.String() } func smartTruncate(text string) string {
Use a buffer instead of naive concatenation in SubstituteRune
gosimple_slug
train
go
37a2637b02e1f7a325224e4f9b8d7cb343771833
diff --git a/src/SocialiteWasCalled.php b/src/SocialiteWasCalled.php index <HASH>..<HASH> 100644 --- a/src/SocialiteWasCalled.php +++ b/src/SocialiteWasCalled.php @@ -3,4 +3,19 @@ namespace AndyWendt\Socialite\Extender; class SocialiteWasCalled { + /** + * @param string $providerName 'meetup' + * @param string $providerClass 'Your\Name\Space\ClassName' + */ + public function extendSocialite($providerName, $providerClass) + { + $socialite = \App::make('Laravel\Socialite\Contracts\Factory'); + $socialite->extend( + $providerName, + function ($app) use ($socialite, $providerName, $providerClass) { + $config = $app['config']['services.' . $providerName]; + return $socialite->buildProvider($providerClass, $config); + } + ); + } }
Added ability to extend socialite through event object
SocialiteProviders_Manager
train
php
a76e385be7f6cdfdf2ad9c5dca1954683eb95891
diff --git a/src/Module.php b/src/Module.php index <HASH>..<HASH> 100644 --- a/src/Module.php +++ b/src/Module.php @@ -36,6 +36,6 @@ class Module implements ConsoleUsageProviderInterface */ public function getConfig() { - return ModuleConfigLoader::load(__DIR__.'/config'); + return ModuleConfigLoader::load(__DIR__.'/../config'); } }
Fix: Configuration is not loaded. * Path in Module.php was wrong.
yawik_Solr
train
php
824a689d659861ab92375b7b76202fa56438f4be
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -11,7 +11,7 @@ var PLUGIN_NAME = 'gulp-lodash-template'; module.exports = function (options) { options = options || {}; - var _escape = 'var _ = {};\n\ + var _escape = 'var _ = window._ || {};\n\ var escapeMap = {\n\ \'&\': \'&amp;\',\n\ \'<\': \'&lt;\',\n\ @@ -80,4 +80,4 @@ _.escape = function(string) {\n\ }); return stream; -}; \ No newline at end of file +};
Adding lodash variable if available The previous code was overriding the `_` variable of lodash.
JiangJie_gulp-lodash-template
train
js
6e1598c93bef02e9820ae1140923594964fae9f7
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ class FetchExternal(setuptools.command.install.install): setup(cmdclass={'install': FetchExternal}, name='python_moztelemetry', - version='0.3.2.4', + version='0.3.2.5', author='Roberto Agostino Vitillo', author_email='rvitillo@mozilla.com', description='Spark bindings for Mozilla Telemetry',
Add support for revisions and startup histograms.
mozilla_python_moztelemetry
train
py
3c21d3ced8090989559aefa32cb7e9005c054403
diff --git a/worker/uniter/uniter_test.go b/worker/uniter/uniter_test.go index <HASH>..<HASH> 100644 --- a/worker/uniter/uniter_test.go +++ b/worker/uniter/uniter_test.go @@ -560,28 +560,6 @@ var steadyUpgradeTests = []uniterTest{ waitHooks{"upgrade-charm", "config-changed"}, verifyRunning{}, ), - ut( - // This test does an add-relation as quickly as possible - // after an upgrade-charm, in the hope that the scheduler will - // deliver the events in the wrong order. The observed - // behaviour should be the same in either case. - "ignore unknown relations until upgrade is done", - quickStart{}, - createCharm{ - revision: 2, - customize: func(c *C, ctx *context, path string) { - renameRelation(c, path, "db", "db2") - hpath := filepath.Join(path, "hooks", "db2-relation-joined") - ctx.writeHook(c, hpath, true) - }, - }, - serveCharm{}, - upgradeCharm{revision: 2}, - addRelation{}, - addRelationUnit{}, - waitHooks{"upgrade-charm", "config-changed", "db2-relation-joined mysql/0 db2:0"}, - verifyCharm{revision: 2}, - ), } func (s *UniterSuite) TestUniterSteadyStateUpgrade(c *C) {
Removed a failing test, which violates charm compatibility when upgrading
juju_juju
train
go
c9fec5ac2f7a60ad7e8b2c903b98f0d1ee9dcc73
diff --git a/meshio/_helpers.py b/meshio/_helpers.py index <HASH>..<HASH> 100644 --- a/meshio/_helpers.py +++ b/meshio/_helpers.py @@ -75,13 +75,21 @@ def write_points_cells( point_data=None, cell_data=None, field_data=None, + point_sets=None, + cell_sets=None, file_format=None, **kwargs, ): points = numpy.asarray(points) cells = [(key, numpy.asarray(value)) for key, value in cells] mesh = Mesh( - points, cells, point_data=point_data, cell_data=cell_data, field_data=field_data + points, + cells, + point_data=point_data, + cell_data=cell_data, + field_data=field_data, + point_sets=point_sets, + cell_sets=cell_sets, ) return write(filename, mesh, file_format=file_format, **kwargs)
update write_points_cells() to accept point_sets and cell_sets data
nschloe_meshio
train
py
f8338ed3455309dc696a67043f7a83d28c2c3187
diff --git a/pymola/backends/casadi/model.py b/pymola/backends/casadi/model.py index <HASH>..<HASH> 100644 --- a/pymola/backends/casadi/model.py +++ b/pymola/backends/casadi/model.py @@ -438,14 +438,14 @@ class Model: start = sign * alias_state.start # The intersection of all bound ranges applies - m = max(m, alias_state.min if sign == 1 else -alias_state.max) - M = min(M, alias_state.max if sign == 1 else -alias_state.min) + m = ca.fmax(m, alias_state.min if sign == 1 else -alias_state.max) + M = ca.fmin(M, alias_state.max if sign == 1 else -alias_state.min) # Take the largest nominal of all aliases - nominal = max(nominal, alias_state.nominal) + nominal = ca.fmax(nominal, alias_state.nominal) # If any of the aliases is fixed, the canonical state is as well - fixed = max(fixed, alias_state.fixed) + fixed = ca.fmax(fixed, alias_state.fixed) del all_states[alias] if alias in outputs:
CasADi model, alias merging: Use CasADi fmin/fmax as some attributes may be symbolic.
pymoca_pymoca
train
py
476e88898821763b5641bdee85162452931892ae
diff --git a/KnpUOAuth2ClientBundle.php b/KnpUOAuth2ClientBundle.php index <HASH>..<HASH> 100644 --- a/KnpUOAuth2ClientBundle.php +++ b/KnpUOAuth2ClientBundle.php @@ -2,9 +2,22 @@ namespace KnpU\OAuth2ClientBundle; +use KnpU\OAuth2ClientBundle\DependencyInjection\KnpUOAuth2ClientExtension; use Symfony\Component\HttpKernel\Bundle\Bundle; class KnpUOAuth2ClientBundle extends Bundle { + /** + * Overridden to allow for the custom extension alias. + * + * @return KnpUOAuth2ClientExtension + */ + public function getContainerExtension() + { + if (null === $this->extension) { + return new KnpUOAuth2ClientExtension(); + } + return $this->extension; + } }
Also overriding the method in the bundle to allow for the alias ... we should really change this...
knpuniversity_oauth2-client-bundle
train
php
c14a2d234faa05ba23e7bb8a14250a06daf4a3d8
diff --git a/scs_osio/device.py b/scs_osio/device.py index <HASH>..<HASH> 100755 --- a/scs_osio/device.py +++ b/scs_osio/device.py @@ -16,7 +16,7 @@ import sys from scs_core.data.json import JSONify from scs_core.osio.client.api_auth import APIAuth -from scs_core.osio.config.source import Source +from scs_core.osio.config.project_source import ProjectSource from scs_core.osio.manager.device_manager import DeviceManager from scs_host.client.http_client import HTTPClient @@ -71,7 +71,7 @@ if __name__ == '__main__': if cmd.set(): # update Device... - updated = Source.update(device, cmd.lat, cmd.lng, cmd.postcode, cmd.description) + updated = ProjectSource.update(device, cmd.lat, cmd.lng, cmd.postcode, cmd.description) manager.update(api_auth.org_id, device.client_id, updated) # find updated device...
Added particulates flag to host_project script.
south-coast-science_scs_osio
train
py
2ad68f741ce162608a91dc4926d1bc67fa5432f0
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -65,10 +65,11 @@ def main(): 'indra.sources.eidos', 'indra.sources.geneways', 'indra.sources.hume', 'indra.sources.index_cards', - 'indra.sources.indra_db_rest', + 'indra.sources.indra_db_rest', 'indra.sources.lincs_drug', 'indra.sources.ndex_cx', 'indra.sources.reach', 'indra.sources.sofia', - 'indra.sources.sparser', 'indra.sources.tees', + 'indra.sources.sparser', 'indra.sources.tas', + 'indra.sources.tees', 'indra.sources.trips', 'indra.resources', 'indra.resources.famplex', 'indra.tests', 'indra.tools', 'indra.tools.reading',
Add TAS and LINCS drug source modules to setup
sorgerlab_indra
train
py
01807dbe8e0ddd77da9c5049acd2b12fee344d7c
diff --git a/languagetool-language-modules/nl/src/main/java/org/languagetool/language/Dutch.java b/languagetool-language-modules/nl/src/main/java/org/languagetool/language/Dutch.java index <HASH>..<HASH> 100644 --- a/languagetool-language-modules/nl/src/main/java/org/languagetool/language/Dutch.java +++ b/languagetool-language-modules/nl/src/main/java/org/languagetool/language/Dutch.java @@ -175,6 +175,7 @@ public class Dutch extends Language { case "KORT_2": return -5; //so that spelling errors are recognized first case "EINDE_ZIN_ONVERWACHT": return -5; //so that spelling errors are recognized first case "TOO_LONG_PARAGRAPH": return -15; + case "DE_ONVERWACHT": return -20; // below spell checker and simple replace rule } return super.getPriorityForId(id); }
[nl] decrease DE_ONVERWACHT priority, according to Ruud
languagetool-org_languagetool
train
java
6f3db22476d7dcf4d822d886f00cd77a345f5567
diff --git a/salt/modules/cmdmod.py b/salt/modules/cmdmod.py index <HASH>..<HASH> 100644 --- a/salt/modules/cmdmod.py +++ b/salt/modules/cmdmod.py @@ -364,7 +364,7 @@ def run_all(cmd, cwd=None, runas=None, shell=DEFAULT_SHELL, env=(), def retcode(cmd, cwd=None, runas=None, shell=DEFAULT_SHELL, env=(), - template=None, daemon=daemon): + template=None, daemon=False): ''' Execute a shell command and return the command's return code.
Fix cmdmod.py daemon error introduced by <I>
saltstack_salt
train
py
0918c9eef3860bd54524147787cc68f02a52e522
diff --git a/opencv/cxcore.go b/opencv/cxcore.go index <HASH>..<HASH> 100644 --- a/opencv/cxcore.go +++ b/opencv/cxcore.go @@ -523,6 +523,10 @@ func Not(src, dst *IplImage) { /****************************************************************************************\ * Array Statistics * \****************************************************************************************/ +// CvScalar cvAvg(const CvArr* arr, const CvArr* mask=NULL ) +func (src *IplImage) Avg(mask *IplImage) Scalar { + return (Scalar)(C.cvAvg(unsafe.Pointer(src), unsafe.Pointer(mask))) +} /****************************************************************************************\ * Discrete Linear Transforms and Related Functions *
Added 'Avg' function
go-opencv_go-opencv
train
go
e9af7a0ac9d56bad83f3a17b478cf99fbfa51f02
diff --git a/spectrum.js b/spectrum.js index <HASH>..<HASH> 100644 --- a/spectrum.js +++ b/spectrum.js @@ -516,7 +516,7 @@ var color = get(); if (isInput) { - boundElement.val(color.toString(currentPreferredFormat)); + boundElement.val(color.toString(currentPreferredFormat)).change(); } colorOnShow = color;
Trigger the original input "change" event
bgrins_spectrum
train
js
1e9b68164bce898bb5f8c816ee699d56b1c35a8e
diff --git a/flink-core/src/main/java/org/apache/flink/util/SplittableIterator.java b/flink-core/src/main/java/org/apache/flink/util/SplittableIterator.java index <HASH>..<HASH> 100644 --- a/flink-core/src/main/java/org/apache/flink/util/SplittableIterator.java +++ b/flink-core/src/main/java/org/apache/flink/util/SplittableIterator.java @@ -24,7 +24,7 @@ import java.util.Iterator; public abstract class SplittableIterator<T> implements Iterator<T>, Serializable { - abstract Iterator<T>[] split(int numPartitions); + public abstract Iterator<T>[] split(int numPartitions); public Iterator<T> getSplit(int num, int numPartitions) { if (numPartitions < 1 || num < 0 || num >= numPartitions) { @@ -34,5 +34,5 @@ public abstract class SplittableIterator<T> implements Iterator<T>, Serializable return split(numPartitions)[num]; } - abstract int getMaximumNumberOfSplits(); + public abstract int getMaximumNumberOfSplits(); }
[FLINK-<I>] Make abstract methods public in SplittableIterator
apache_flink
train
java
98bdf0dd3a1170c2500495298a3f2b4b1057a7f1
diff --git a/spec/model/has_description_spec.rb b/spec/model/has_description_spec.rb index <HASH>..<HASH> 100644 --- a/spec/model/has_description_spec.rb +++ b/spec/model/has_description_spec.rb @@ -8,6 +8,12 @@ describe Model::HasDescription do DescribedModel.auto_migrate! end + it "should define a description property" do + property = DescribedModel.properties['description'] + + property.should_not be_nil + end + describe "description" do before(:each) do @model = DescribedModel.new diff --git a/spec/model/has_name_spec.rb b/spec/model/has_name_spec.rb index <HASH>..<HASH> 100644 --- a/spec/model/has_name_spec.rb +++ b/spec/model/has_name_spec.rb @@ -8,6 +8,12 @@ describe Model::HasName do NamedModel.auto_migrate! end + it "should define a name property" do + property = NamedModel.properties['name'] + + property.should_not be_nil + end + it "should require a name" do model = NamedModel.new model.should_not be_valid
Added specs for testing if HasName and HasDescription added a property.
ronin-ruby_ronin
train
rb,rb
8a8762dd4c6e23e4a57b800c48e16b3f54052586
diff --git a/src/karlskrone/jarvis/events/EventManager.java b/src/karlskrone/jarvis/events/EventManager.java index <HASH>..<HASH> 100644 --- a/src/karlskrone/jarvis/events/EventManager.java +++ b/src/karlskrone/jarvis/events/EventManager.java @@ -93,10 +93,7 @@ public class EventManager { return; } for (ActivatorEventListener next : contentGeneratorListeners) { - //TODO: retrieve Data - //TODO: call them concurrent next.activatorEventFired(id); - //TODO: Give Data to OutputManager } }
Changed EventManagerTest, EventManager and added DemoEvent The EventManagerTest should now be more self-explaining, and a DemoEvent class got created. The EventManager has now TODO's for missing features. The only purpose of this class is to explain how to use the EventManager Class
intellimate_Izou
train
java
cf713ef41b35a638e1d8e5281adae22c2ed24589
diff --git a/findbugs/src/java/edu/umd/cs/findbugs/gui/AboutDialog.java b/findbugs/src/java/edu/umd/cs/findbugs/gui/AboutDialog.java index <HASH>..<HASH> 100644 --- a/findbugs/src/java/edu/umd/cs/findbugs/gui/AboutDialog.java +++ b/findbugs/src/java/edu/umd/cs/findbugs/gui/AboutDialog.java @@ -206,6 +206,8 @@ public class AboutDialog extends javax.swing.JDialog { Runtime rt = Runtime.getRuntime(); if (os.indexOf( "win" ) >= 0) { rt.exec( "rundll32 url.dll,FileProtocolHandler " + url.toString()); + } else if (os.indexOf( "mac" ) >= 0) { + rt.exec( "open " + url.toString()); } } }
support hyperlinks on mac. The leenux fellars are on their own :) git-svn-id: <URL>
spotbugs_spotbugs
train
java
611f03f08b219d85ea97ee7b1a75a6f921459c68
diff --git a/src/main/java/com/github/snowdream/android/util/concurrent/AsyncTask.java b/src/main/java/com/github/snowdream/android/util/concurrent/AsyncTask.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/snowdream/android/util/concurrent/AsyncTask.java +++ b/src/main/java/com/github/snowdream/android/util/concurrent/AsyncTask.java @@ -174,7 +174,10 @@ public abstract class AsyncTask<Params, Progress, Result> extends protected void onPostExecute(Result result) { super.onPostExecute(result); if (listener != null) { - listener.onSuccess(result); + if (result != null) { + listener.onSuccess(result); + } + listener.onFinish(); } }
[Update] AsyncTask
snowdream_android-multithread
train
java
62e2d07d2d887c8c6d346fcc54dfeed45d1a90d6
diff --git a/graphics/canvas.py b/graphics/canvas.py index <HASH>..<HASH> 100644 --- a/graphics/canvas.py +++ b/graphics/canvas.py @@ -78,8 +78,8 @@ class Canvas: pass if visible: - char = colors.colorStr(sprite.char((x, y)), - sprite.color) + char = console.supportedChars(sprite.char((x, y))) + char = colors.colorStr(char, sprite.color) display[pixelPos[0]][pixelPos[1]] = char hPad = (
Added detection in canvas for UnicodeEncodeError and fallback to `?`
olls_graphics
train
py
6c632f3314310c9ba9f0d7ec1f8056f1b8e45fc1
diff --git a/pgpy/pgp.py b/pgpy/pgp.py index <HASH>..<HASH> 100644 --- a/pgpy/pgp.py +++ b/pgpy/pgp.py @@ -179,9 +179,8 @@ class PGPBlock(FileLoader): # by using the generator 0x864CFB and an initialization of 0xB704CE. # The accumulation is done on the data before it is converted to # radix-64, rather than on the converted data. - ##TODO: if self.data == b'', work on the output of self.__bytes__() instead if self.data == b'': - return None # pragma: no cover + self.data = self.__bytes__() crc = self.crc24_init sig = [ ord(i) for i in self.data ] if type(self.data) is str else self.data
finally figured out how to take this TODO off my list
SecurityInnovation_PGPy
train
py
831ea070f186683d4451fe60c1c449f72722d598
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -133,7 +133,6 @@ function decodeArgon2iStr (hash) { // var out = Buffer.allocUnsafe(32) // STR_HASHBYTES var isArgon2i = Buffer.compare(Argon2iStr_ALG_TAG, hash.slice(idx, idx += 8)) === 0 - console.log(isArgon2i) if (isArgon2i === false) return false type = 'argon2i'
Remove stray console.log (#7)
emilbayes_secure-password
train
js
e6a4d8f97d738bf8ea16c9f6907d2b54623aff5f
diff --git a/pghoard/basebackup.py b/pghoard/basebackup.py index <HASH>..<HASH> 100644 --- a/pghoard/basebackup.py +++ b/pghoard/basebackup.py @@ -370,6 +370,7 @@ class PGBaseBackup(Thread): } for oid, spcname in cursor.fetchall() } + db_conn.commit() with open(os.path.join(pgdata, "backup_label"), "rb") as fp: start_wal_segment, backup_start_time = self.parse_backup_label(fp.read()) @@ -399,6 +400,7 @@ class PGBaseBackup(Thread): finally: db_conn.rollback() cursor.execute("SELECT pg_stop_backup()") + db_conn.commit() metadata = { "compression-algorithm": compression_algorithm,
local tar backup: don't keep a transaction open while backup is taking place
aiven_pghoard
train
py