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 |
|---|---|---|---|---|---|
794749c3f4d4d3f6fb78eb6e4c078ac21af87df6 | diff --git a/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java b/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java
index <HASH>..<HASH> 100644
--- a/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java
+++ b/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java
@@ -491,10 +491,12 @@ public class RhodesActivity extends BaseActivity {
}
String urlStart = uri.getPath();
- if (urlStart.compareTo("") != 0)
- {
- Logger.D(TAG, "PROCESS URL START: " + urlStart);
- RhoConf.setString("start_path", Uri.decode(urlStart));
+ if (urlStart != null) {
+ if ("".compareTo(urlStart) != 0)
+ {
+ Logger.D(TAG, "PROCESS URL START: " + urlStart);
+ RhoConf.setString("start_path", Uri.decode(urlStart));
+ }
}
ENABLE_LOADING_INDICATION = !RhoConf.getBool("disable_loading_indication"); | fix NPE during start app from another via System.open_url | rhomobile_rhodes | train | java |
9ca77317ba5b104f6b894ff14860a408007399b5 | diff --git a/src/plugins/media_control/media_control.js b/src/plugins/media_control/media_control.js
index <HASH>..<HASH> 100644
--- a/src/plugins/media_control/media_control.js
+++ b/src/plugins/media_control/media_control.js
@@ -664,8 +664,13 @@ export default class MediaControl extends UICorePlugin {
* @method configure
* @param {Object} options all the options to change in form of a javascript object
*/
- configure() {
- this.options.chromeless ? this.disable() : this.enable()
+ configure(options) {
+ // Check if chromeless mode or if configure is called with new source(s)
+ if (this.options.chromeless || options.source || options.sources)
+ this.disable()
+ else
+ this.enable()
+
this.trigger(Events.MEDIACONTROL_OPTIONS_CHANGE)
} | fix(media_control): check if options has source in configure method
Fixes #<I>. | clappr_clappr | train | js |
0734040a13d0b2737edf9117631796267882687a | diff --git a/yfinance/__init__.py b/yfinance/__init__.py
index <HASH>..<HASH> 100644
--- a/yfinance/__init__.py
+++ b/yfinance/__init__.py
@@ -41,6 +41,7 @@ _PROGRESS_BAR = None
def Tickers(tickers):
tickers = tickers if isinstance(
tickers, list) else tickers.replace(',', ' ').split()
+ tickers = [ticker.upper() for ticker in tickers]
ticker_objects = {}
for ticker in tickers:
@@ -372,6 +373,7 @@ def download(tickers, start=None, end=None, actions=False, threads=True,
# create ticker list
tickers = tickers if isinstance(
tickers, list) else tickers.replace(',', ' ').split()
+ tickers = [ticker.upper() for ticker in tickers]
if progress:
_PROGRESS_BAR = _ProgressBar(len(tickers), 'downloaded') | making sure tickers are always uppercase | ranaroussi_fix-yahoo-finance | train | py |
373b9f7fcb888850ebc4337d7331d57593d37983 | diff --git a/test/src/main/java/com/gargoylesoftware/htmlunit/html/DomNodeUtil.java b/test/src/main/java/com/gargoylesoftware/htmlunit/html/DomNodeUtil.java
index <HASH>..<HASH> 100644
--- a/test/src/main/java/com/gargoylesoftware/htmlunit/html/DomNodeUtil.java
+++ b/test/src/main/java/com/gargoylesoftware/htmlunit/html/DomNodeUtil.java
@@ -23,6 +23,7 @@
*/
package com.gargoylesoftware.htmlunit.html;
+import com.gargoylesoftware.htmlunit.WebClientUtil;
import com.gargoylesoftware.htmlunit.html.xpath.XPathUtils;
import java.util.List;
@@ -33,6 +34,7 @@ import java.util.List;
public class DomNodeUtil {
public static <E> List<E> getByXPath(final DomNode domNode, final String xpathExpr) {
+ WebClientUtil.waitForJSExec(domNode.getPage().getWebClient());
return (List) XPathUtils.getByXPath(domNode, xpathExpr, null);
}
@@ -41,6 +43,7 @@ public class DomNodeUtil {
}
public static <X> X selectSingleNode(final DomNode domNode, final String xpathExpr) {
+ WebClientUtil.waitForJSExec(domNode.getPage().getWebClient());
return domNode.<X>getFirstByXPath(xpathExpr);
}
} | Make sure all background JS is done executing before querying the DOM
Lots of tests di "stuff" that relies on JS execution and then check for a result in the DOM by querying it. We should check make sure all JS has finished executing before we perform the DOM query. | jenkinsci_jenkins | train | java |
e47653ac118c3043627e8ebaa93e82969a1e9cb9 | diff --git a/molgenis-one-click-importer/src/main/java/org/molgenis/oneclickimporter/job/OneClickImportJob.java b/molgenis-one-click-importer/src/main/java/org/molgenis/oneclickimporter/job/OneClickImportJob.java
index <HASH>..<HASH> 100644
--- a/molgenis-one-click-importer/src/main/java/org/molgenis/oneclickimporter/job/OneClickImportJob.java
+++ b/molgenis-one-click-importer/src/main/java/org/molgenis/oneclickimporter/job/OneClickImportJob.java
@@ -13,6 +13,7 @@ import org.molgenis.oneclickimporter.service.EntityService;
import org.molgenis.oneclickimporter.service.ExcelService;
import org.molgenis.oneclickimporter.service.OneClickImporterService;
import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
import java.io.File;
import java.io.IOException;
@@ -43,6 +44,7 @@ public class OneClickImportJob
this.fileStore = requireNonNull(fileStore);
}
+ @Transactional
public List<EntityType> getEntityType(Progress progress, String filename)
throws UnknownFileTypeException, IOException, InvalidFormatException
{ | Add @transactional to ImportJob | molgenis_molgenis | train | java |
4bdcf260486a76f02fedb6e13d54a6f599431470 | diff --git a/lib/double_entry/reporting.rb b/lib/double_entry/reporting.rb
index <HASH>..<HASH> 100644
--- a/lib/double_entry/reporting.rb
+++ b/lib/double_entry/reporting.rb
@@ -150,7 +150,8 @@ module DoubleEntry
# which they always should.
#
def reconciled?(account)
- scoped_lines = Line.where(:account => "#{account.identifier}", :scope => "#{account.scope}")
+ scoped_lines = Line.where(:account => "#{account.identifier}")
+ scoped_lines = scoped_lines.where(:scope => "#{account.scope_identity}") if account.scoped?
sum_of_amounts = scoped_lines.sum(:amount)
final_balance = scoped_lines.order(:id).last[:balance]
cached_balance = AccountBalance.find_by_account(account)[:balance] | use the account scope lambda to determine the value to query on | envato_double_entry | train | rb |
45c55296b06616a48923b6fc1f38227b08f691ba | diff --git a/app/models/workflow.rb b/app/models/workflow.rb
index <HASH>..<HASH> 100644
--- a/app/models/workflow.rb
+++ b/app/models/workflow.rb
@@ -92,7 +92,13 @@ module Workflow
def update_user_action(property, statuses)
actions.where(:request_type.in => statuses).limit(1).each do |action|
- self[property] = action.requester.name
+ # This can be invoked by Panopticon when it updates an artefact and associated
+ # editions. The problem is that Panopticon and Publisher users live in different
+ # collections, but share a model and relationships with eg actions.
+ # Therefore, Panopticon might not find a user for an action.
+ if action.requester
+ self[property] = action.requester.name
+ end
end
end | Workaround split users problem
This should enable Panopticon to consistently update editions when updating an
artefact. | alphagov_govuk_content_models | train | rb |
75d7221d06124270eb27aa3788df7d75f5601a1e | diff --git a/mithril.js b/mithril.js
index <HASH>..<HASH> 100644
--- a/mithril.js
+++ b/mithril.js
@@ -857,7 +857,7 @@ Mithril = m = new function app(window, undefined) {
else options.onerror({type: "error", target: xhr})
}
}
- if (options.serialize == JSON.stringify && options.method != "GET") {
+ if (options.serialize == JSON.stringify && options.data && options.method != "GET") {
xhr.setRequestHeader("Content-Type", "application/json; charset=utf-8")
}
if (typeof options.config == "function") {
@@ -865,7 +865,7 @@ Mithril = m = new function app(window, undefined) {
if (maybeXhr != null) xhr = maybeXhr
}
- xhr.send(options.method == "GET" ? "" : options.data)
+ xhr.send(options.method == "GET" || !options.data ? "" : options.data)
return xhr
}
} | don't send content-type header if no data | MithrilJS_mithril.js | train | js |
83fdd81b2fe39363240749f61b588631f49308aa | diff --git a/pyvisa-py/sessions.py b/pyvisa-py/sessions.py
index <HASH>..<HASH> 100644
--- a/pyvisa-py/sessions.py
+++ b/pyvisa-py/sessions.py
@@ -190,10 +190,10 @@ class Session(compat.with_metaclass(abc.ABCMeta)):
self.parsed = parsed
self.open_timeout = open_timeout
- #: Get default timeout from constants
- self.timeout =\
- (attributes.AttributesByID[constants.VI_ATTR_TMO_VALUE].default /
- 1000.0)
+ #: Set the default timeout from constants
+ attr = constants.VI_ATTR_TMO_VALUE
+ default_timeout = attributes.AttributesByID[attr].default
+ self.set_attribute(attr, default_timeout)
#: Used as a place holder for the object doing the lowlevel
#: communication. | sessions: set the default timeout through the API
This allows to respect overridden behavior in subclasses. | pyvisa_pyvisa-py | train | py |
35c4b4b032b5163c9e466008c78a4beeacc66146 | diff --git a/clips/classes.py b/clips/classes.py
index <HASH>..<HASH> 100644
--- a/clips/classes.py
+++ b/clips/classes.py
@@ -196,7 +196,7 @@ class Classes:
ret = lib.EnvBinarySaveInstances(self._env, path.encode(), mode)
else:
ret = lib.EnvSaveInstances(self._env, path.encode(), mode)
- if ret == -1:
+ if ret == 0:
raise CLIPSError(self._env)
return ret | issue #5: fix `save_instances` return value check
According to documentation, `EnvSaveInstances` returns the number of
saved instances. Looking at CLIPS source code, it seems
`EnvSaveInstances` relies on the same logic of `EnvSave` which returns
0 on error. | noxdafox_clipspy | train | py |
0602aad845f0a04cdc535b97b4860469f600d9b0 | diff --git a/django_tablib/datasets.py b/django_tablib/datasets.py
index <HASH>..<HASH> 100644
--- a/django_tablib/datasets.py
+++ b/django_tablib/datasets.py
@@ -9,11 +9,11 @@ class SimpleDataset(BaseDataset):
fields = queryset.model._meta.fields
self.header_list = [field.name for field in fields]
self.attr_list = self.header_list
- elif type(headers) is dict:
+ elif isinstance(headers, dict):
self.header_dict = headers
self.header_list = self.header_dict.keys()
self.attr_list = self.header_dict.values()
- elif type(headers) is list:
+ elif isinstance(headers, list):
self.header_list = headers
self.attr_list = headers
super(SimpleDataset, self).__init__() | Use isinstance to check type
This should also allow to use subtypes like a SortedDict
to pass in headers. | joshourisman_django-tablib | train | py |
715c9c3c2395768d8fc95fc2086467bc11fc2019 | diff --git a/src/qtism/data/ExtendedAssessmentItemRef.php b/src/qtism/data/ExtendedAssessmentItemRef.php
index <HASH>..<HASH> 100644
--- a/src/qtism/data/ExtendedAssessmentItemRef.php
+++ b/src/qtism/data/ExtendedAssessmentItemRef.php
@@ -142,9 +142,14 @@ class ExtendedAssessmentItemRef extends AssessmentItemRef implements IAssessment
/**
* @var string
+ * @qtism-bean-property
*/
private $title = '';
+ /**
+ * @var string
+ * @qtism-bean-property
+ */
private $label = '';
/**
@@ -603,6 +608,11 @@ class ExtendedAssessmentItemRef extends AssessmentItemRef implements IAssessment
return $this->title;
}
+ public function hasTitle()
+ {
+ return !empty($this->getTitle());
+ }
+
public function setLabel($label)
{
if (gettype($label) === 'string') {
@@ -616,4 +626,9 @@ class ExtendedAssessmentItemRef extends AssessmentItemRef implements IAssessment
{
return $this->label;
}
+
+ public function hasLabel()
+ {
+ return !empty($this->getLabel());
+ }
} | Added annotations and hasX like methods. | oat-sa_qti-sdk | train | php |
8c190aa9e90bce2ddd22cfddfbf5968a505bc59d | diff --git a/java/src/playn/java/JavaPlatform.java b/java/src/playn/java/JavaPlatform.java
index <HASH>..<HASH> 100644
--- a/java/src/playn/java/JavaPlatform.java
+++ b/java/src/playn/java/JavaPlatform.java
@@ -151,7 +151,9 @@ public class JavaPlatform extends AbstractPlatform {
touch = new TouchStub();
}
- setTitle(config.appName);
+ if (!config.headless) {
+ setTitle(config.appName);
+ }
convertImagesOnLoad = config.convertImagesOnLoad;
} | Don't try to set the title if we're headless.
Otherwise this tries to load LWJGL which breaks our tests. | threerings_playn | train | java |
5eeaef671b6bb2ac242cec31b535cd27989838f8 | diff --git a/indra/assemblers/cx/assembler.py b/indra/assemblers/cx/assembler.py
index <HASH>..<HASH> 100644
--- a/indra/assemblers/cx/assembler.py
+++ b/indra/assemblers/cx/assembler.py
@@ -58,10 +58,11 @@ class NiceCxAssembler(object):
if len(not_none_agents) < 2:
continue
for a1, a2 in itertools.combinations(not_none_agents, 2):
+ if not self_loops and \
+ self.get_agent_key(a1) == self.get_agent_key(a2):
+ continue
a1_id = self.add_node(a1)
a2_id = self.add_node(a2)
- if not self_loops and a1_id == a2_id:
- continue
edge_id = self.add_edge(a1_id, a2_id, stmt)
prefixes = {k: v for k, v in url_prefixes.items()} | Rearrange to not add standalone nodes | sorgerlab_indra | train | py |
ec0ffa84a49e5cbeb7e1f2f671436bcb2c32230c | diff --git a/client.go b/client.go
index <HASH>..<HASH> 100644
--- a/client.go
+++ b/client.go
@@ -818,6 +818,7 @@ func (me *Client) replenishConnRequests(torrent *Torrent, conn *Connection) {
}
}
}
+ conn.SetInterested(false)
}
func (me *Client) downloadedChunk(torrent *Torrent, msg *peer_protocol.Message) (err error) { | If no requests can be found for a connection, set it to uninterested | anacrolix_torrent | train | go |
27a40b24ce67b1e50a4457f92e691474af11c395 | diff --git a/shakedown/cli/main.py b/shakedown/cli/main.py
index <HASH>..<HASH> 100644
--- a/shakedown/cli/main.py
+++ b/shakedown/cli/main.py
@@ -242,7 +242,13 @@ def cli(**args):
if report.skipped:
state = 'skip'
- if state and report.when == 'call':
+ if state and secname != 'Captured stdout call':
+ if not 'setup' in shakedown.tests['test'][report.nodeid]:
+ module = report.nodeid.split('::', 1)[0]
+ cap_type = secname.split(' ')[-1]
+ shakedown.tests['test'][report.nodeid]['setup'] = True
+ shakedown.output(module + ' ' + cap_type, state, content, False)
+ elif state and report.when == 'call':
if 'tested' in shakedown.tests['test'][report.nodeid]:
shakedown.output(report.nodeid, state, content, False)
else: | (DCOS-<I>) Print output from setup/teardown phases | dcos_shakedown | train | py |
c59e77d945fbca4f21dd43cedf2e640c1a82685a | diff --git a/src/FluxBB/Server/Router.php b/src/FluxBB/Server/Router.php
index <HASH>..<HASH> 100644
--- a/src/FluxBB/Server/Router.php
+++ b/src/FluxBB/Server/Router.php
@@ -78,7 +78,7 @@ class Router
return $part;
}, $parts));
- $path = ltrim($path, '/');
+ $path = '/' . ltrim($path, '/');
return $path;
}
diff --git a/src/FluxBB/Server/ServiceProvider.php b/src/FluxBB/Server/ServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/FluxBB/Server/ServiceProvider.php
+++ b/src/FluxBB/Server/ServiceProvider.php
@@ -54,7 +54,7 @@ class ServiceProvider extends Base
$app->resolving('view', function ($view) use ($app) {
$view->share('route', function ($name, $parameters = []) use ($app) {
- return '/' . $app['fluxbb.router']->getPath($name, $parameters);
+ return $app['fluxbb.router']->getPath($name, $parameters);
});
$view->share('method', function ($name) use ($app) { | Prepend slash in router method. | fluxbb_core | train | php,php |
6ca6319fb93e2fc4de022095c9c2faa43ecda639 | diff --git a/public/js/knockout/custom-bindings.js b/public/js/knockout/custom-bindings.js
index <HASH>..<HASH> 100644
--- a/public/js/knockout/custom-bindings.js
+++ b/public/js/knockout/custom-bindings.js
@@ -551,9 +551,15 @@
{
window.admin.resizePage();
}, 50)
- })
+ });
+
+ //handle destroying an editor (based on what jQuery plugin does)
+ ko.utils.domNodeDisposal.addDisposeCallback(element, function () {
+ var existingEditor = CKEDITOR.instances[element.name];
- editor.setData(value);
+ if (existingEditor)
+ existingEditor.destroy(true);
+ });
},
update: function (element, valueAccessor, allBindingsAccessor, context)
{ | fixing ckeditor bug when instantiated many times | FrozenNode_Laravel-Administrator | train | js |
95929cd5b655bce5b877d78f39cdfcddab5391cb | diff --git a/auditlog_tests/tests.py b/auditlog_tests/tests.py
index <HASH>..<HASH> 100644
--- a/auditlog_tests/tests.py
+++ b/auditlog_tests/tests.py
@@ -1279,6 +1279,7 @@ class DiffMsgTest(TestCase):
{"field one": ["value before deletion", None], "field two": [11, None]},
)
+ self.assertEqual(self.admin.msg_short(log_entry), "")
self.assertEqual(
self.admin.msg(log_entry),
(
@@ -1300,6 +1301,9 @@ class DiffMsgTest(TestCase):
)
self.assertEqual(
+ self.admin.msg_short(log_entry), "2 changes: field two, field one"
+ )
+ self.assertEqual(
self.admin.msg(log_entry),
(
"<table>"
@@ -1320,6 +1324,9 @@ class DiffMsgTest(TestCase):
)
self.assertEqual(
+ self.admin.msg_short(log_entry), "2 changes: field two, field one"
+ )
+ self.assertEqual(
self.admin.msg(log_entry),
(
"<table>"
@@ -1343,6 +1350,7 @@ class DiffMsgTest(TestCase):
},
)
+ self.assertEqual(self.admin.msg_short(log_entry), "1 change: some_m2m_field")
self.assertEqual(
self.admin.msg(log_entry),
( | Add assertions for msg_short | jjkester_django-auditlog | train | py |
69bf2b760dad784bc788b06e365265348af2e211 | diff --git a/grr/config/grr-response-server/setup.py b/grr/config/grr-response-server/setup.py
index <HASH>..<HASH> 100644
--- a/grr/config/grr-response-server/setup.py
+++ b/grr/config/grr-response-server/setup.py
@@ -89,6 +89,8 @@ setup_args = dict(
"portpicker==1.1.1",
"python-crontab==2.0.1",
"rekall-core~=1.6.0",
+ # TODO(user): remove as soon as this is added to rekall-core itself.
+ "SPARQLWrapper~=1.6.4",
"Werkzeug==0.11.3",
"wsgiref==0.1.2",
], | Fixing GRR PIP dependencies. | google_grr | train | py |
4accb9198d4d9ac334a679359b6b4ebc45e2cbb1 | diff --git a/limpyd/model.py b/limpyd/model.py
index <HASH>..<HASH> 100644
--- a/limpyd/model.py
+++ b/limpyd/model.py
@@ -47,6 +47,7 @@ class RedisModel(RedisProxyCommand):
__metaclass__ = MetaRedisModel
cacheable = True
+ DoesNotExist = DoesNotExist
def __init__(self, *args, **kwargs):
""" | Make DoesNotExist exception available as RedisModel property | limpyd_redis-limpyd | train | py |
4e488ac7970974f489ffe4757283544a3add1717 | diff --git a/authapi/tests/test_api.py b/authapi/tests/test_api.py
index <HASH>..<HASH> 100644
--- a/authapi/tests/test_api.py
+++ b/authapi/tests/test_api.py
@@ -412,6 +412,23 @@ class TeamTests(AuthAPITestCase):
team.refresh_from_db()
self.assertEqual(team.title, data['title'])
+ def test_update_team_organization(self):
+ '''You shouldn't be able to change a team's organization.'''
+ org1 = SeedOrganization.objects.create(title='test org')
+ org2 = SeedOrganization.objects.create(title='test org')
+ team = SeedTeam.objects.create(organization=org1, title='test team')
+ url = reverse('seedteam-detail', args=[team.id])
+
+ data = {
+ 'title': 'new title',
+ 'organization': org2.pk,
+ }
+ response = self.client.put(url, data=data)
+ self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
+ self.assertEqual(response.data, {
+ 'organization': ['This field can only be set on creation.']
+ })
+
def test_get_team(self):
'''A GET request to a team's endpoint should return that team's
details.''' | Add test for updating the team's organization | praekeltfoundation_seed-auth-api | train | py |
eb9218fe8463cd300a1f1f0e3319b750a90d9ce3 | diff --git a/authority/tests.py b/authority/tests.py
index <HASH>..<HASH> 100644
--- a/authority/tests.py
+++ b/authority/tests.py
@@ -83,12 +83,11 @@ class AssignBehaviourTest(TestCase):
def test_all(self):
result = self.check.assign(content_object=self.user)
-
self.assertTrue(isinstance(result, list))
- self.assertTrue(self.check.browse_user())
- self.assertTrue(self.check.delete_user())
- self.assertTrue(self.check.add_user())
- self.assertTrue(self.check.change_user())
+ self.assertTrue(self.check.browse_user(self.user))
+ self.assertTrue(self.check.delete_user(self.user))
+ self.assertTrue(self.check.add_user(self.user))
+ self.assertTrue(self.check.change_user(self.user))
class GenericAssignBehaviourTest(TestCase):
''' | Fixed test_all() method of test.py
- It's necessary to pass the object to be checked against the
permission types. | jazzband_django-authority | train | py |
f83212eac6dd7884e96d21f496c410f760b6b2f2 | diff --git a/Minimal-J/src/main/java/ch/openech/mj/db/Table.java b/Minimal-J/src/main/java/ch/openech/mj/db/Table.java
index <HASH>..<HASH> 100644
--- a/Minimal-J/src/main/java/ch/openech/mj/db/Table.java
+++ b/Minimal-J/src/main/java/ch/openech/mj/db/Table.java
@@ -226,11 +226,6 @@ public class Table<T> extends AbstractTable<T> {
}
}
- public T read(T object) {
- int id = getId(object);
- return read(id);
- }
-
@SuppressWarnings("unchecked")
private void loadRelations(T object, int id) throws SQLException {
for (Entry<String, AbstractTable<?>> subTableEntry : subTables.entrySet()) { | Table: removed dead (and dangerous) method | BrunoEberhard_minimal-j | train | java |
4d5cdd82bf0cdaafa5ebf2fa20504b4022032eed | diff --git a/pysmi/codegen/pysnmp.py b/pysmi/codegen/pysnmp.py
index <HASH>..<HASH> 100644
--- a/pysmi/codegen/pysnmp.py
+++ b/pysmi/codegen/pysnmp.py
@@ -75,8 +75,8 @@ class PySnmpCodeGen(AbstractCodeGen):
# - or import base ASN.1 types from implementation-specific MIBs
fakeMibs = ('ASN1',
'ASN1-ENUMERATION',
- 'ASN1-REFINEMENT',
- 'SNMP-FRAMEWORK-MIB',
+ 'ASN1-REFINEMENT')
+ baseMibs = ('SNMP-FRAMEWORK-MIB',
'SNMP-TARGET-MIB',
'TRANSPORT-ADDRESS-MIB') + AbstractCodeGen.baseMibs | fix to fake MIBs classifier | etingof_pysmi | train | py |
1a235f57b12cdf49d73b0444fbf632362151985b | diff --git a/test/env/environment.test.js b/test/env/environment.test.js
index <HASH>..<HASH> 100644
--- a/test/env/environment.test.js
+++ b/test/env/environment.test.js
@@ -1,6 +1,7 @@
'use strict';
var fs = require('fs');
+var mkdirp = require('mkdirp');
var path = require('path');
var assert = require('assert');
var sinon = require('sinon');
@@ -153,6 +154,7 @@ describe('#environment', function () {
env.load();
env.postProcess();
env.data = [];
+ mkdirp.sync('.sassdoc');
return env.theme('.sassdoc', env);
});
@@ -175,6 +177,7 @@ describe('#environment', function () {
env.load({ theme: 'fail' });
env.postProcess();
env.data = [];
+ mkdirp.sync('.sassdoc');
return env.theme('.sassdoc', env);
}); | Ensure directory exists before rendering a theme | SassDoc_sassdoc | train | js |
bbabc58572adb344f15683f80bfe3a7de663fe04 | diff --git a/tools/compute_font_metrics.py b/tools/compute_font_metrics.py
index <HASH>..<HASH> 100755
--- a/tools/compute_font_metrics.py
+++ b/tools/compute_font_metrics.py
@@ -93,7 +93,7 @@ BLACKLIST = [
"Droid",
#IOError: execution context too long (issue #703)
"FiraSans",
- "FiraMono"
+ "FiraMono",
# Its pure black so it throws everything off
"Redacted"
]
@@ -303,11 +303,13 @@ def get_gfn(fontfile):
def analyse_fonts(files):
fontinfo = {}
# run the analysis for each file, in sorted order
- for fontfile in sorted(files):
+ for count, fontfile in enumerate(sorted(files)):
# if blacklisted the skip it
if is_blacklisted(fontfile):
print >> sys.stderr, "%s is blacklisted." % fontfile
continue
+ else:
+ print count, "of", len(files), fontfile, "..."
# put metadata in dictionary
darkness, img_d = get_darkness(fontfile)
width, img_w = get_width(fontfile) | compute: Fix blacklist, show progress | googlefonts_fontbakery | train | py |
901cf8024b5b663a96dbec92a2309fc6e3f7cebf | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -6,31 +6,10 @@
'use strict';
exports.func =
-function func(options, callback) {
- if (!callback && typeof options === 'function') {
- callback = options;
- options = undefined;
- }
-
- if (!callback) {
- return new Promise((resolve, reject) => {
- func(options, (err, result) => {
- if (err) { reject(err); } else { resolve(result); }
- });
- });
- }
-
- if (typeof callback !== 'function') {
- throw new TypeError('callback must be a function');
- }
-
+async function func(options) {
if (options !== undefined && typeof options !== 'object') {
- process.nextTick(() => {
- callback(new TypeError('options must be an object'));
- });
- return undefined;
+ throw new TypeError('options must be an object');
}
// Do stuff
- return undefined;
}; | Make modulename.func async
I don't think the complexity of supporting callback functions is
warranted anymore. Promises are preferable for most use cases and async
functions are supported on all current versions of Node.js. Simplify
the func example by making it async and removing the callback code. | kevinoid_travis-status | train | js |
8be7a14c68bf5d69a6301da9ce0bd53370af9b34 | diff --git a/twitter4j-core/src/test/java/twitter4j/SearchAPITest.java b/twitter4j-core/src/test/java/twitter4j/SearchAPITest.java
index <HASH>..<HASH> 100644
--- a/twitter4j-core/src/test/java/twitter4j/SearchAPITest.java
+++ b/twitter4j-core/src/test/java/twitter4j/SearchAPITest.java
@@ -137,10 +137,9 @@ public class SearchAPITest extends TwitterTestBase {
// Don't test since_id here -- it gets clobbered by since
// Don't test locale here -- only JP is valid
- // #tbt is "throwback thursday" -- a fabulously popular hashtag
- Query query=new Query("#tbt")
- .lang("en")
- .geoCode(new GeoLocation(40.7903, -73.9597), 10, "mi")
+ Query query = new Query("starbucks")
+ .lang("en")
+ .geoCode(new GeoLocation(47.6097271,-122.3465704), 10, "mi")
.resultType(Query.ResultType.recent)
.since("2014-1-1")
.until(until); | don't see #tbt often now. | Twitter4J_Twitter4J | train | java |
78681f37556fec8721573fc2fdfd3d71f4069d80 | diff --git a/angr/analyses/vfg.py b/angr/analyses/vfg.py
index <HASH>..<HASH> 100644
--- a/angr/analyses/vfg.py
+++ b/angr/analyses/vfg.py
@@ -320,7 +320,7 @@ class VFG(Analysis):
tracing_times, retn_target_sources
)
- if time.time() - self._start_timestamp > self._timeout:
+ if self._timeout is not None and time.time() - self._start_timestamp > self._timeout:
l.debug('Times out. Terminate the analysis.')
break | Bug fix in handling the VFG timeout setting | angr_angr | train | py |
0037d061a406a630ff13048fbd5e0c8887d8e525 | diff --git a/lhc/file_format/vcf_/iterator.py b/lhc/file_format/vcf_/iterator.py
index <HASH>..<HASH> 100644
--- a/lhc/file_format/vcf_/iterator.py
+++ b/lhc/file_format/vcf_/iterator.py
@@ -36,8 +36,12 @@ class VcfLineIterator(object):
return self
def next(self):
- parts = self.fhndl.next().split('\t', 9)
+ line = self.fhndl.next().rstrip('\r\n')
+ if line == '':
+ raise StopIteration()
+ parts = line.split('\t', 9)
parts[1] = int(parts[1]) - 1
+ self.line_no += 1
return VcfLine(*parts)
def close(self): | implemented empty last line detection for vcf | childsish_sofia | train | py |
79b1fcaee16ad7d5b0c24f3e4d7dea9f91099a29 | 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
@@ -507,6 +507,8 @@ WebGLRenderer.prototype.destroy = function (removeView)
this.drawCount = 0;
+ this.gl.useProgram(null);
+
this.gl = null;
}; | Ensure no program stays active in GPU memory | pixijs_pixi.js | train | js |
d2b07058f4287a00f367f90eb8f95eed220321e2 | diff --git a/src/Symfony/Component/Form/Type/CsrfType.php b/src/Symfony/Component/Form/Type/CsrfType.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/Form/Type/CsrfType.php
+++ b/src/Symfony/Component/Form/Type/CsrfType.php
@@ -34,9 +34,10 @@ class CsrfType extends AbstractType
$builder
->setData($csrfProvider->generateCsrfToken($pageId))
->addValidator(new CallbackValidator(
- function (FormInterface $field) use ($csrfProvider, $pageId) {
- if (!$csrfProvider->isCsrfTokenValid($pageId, $field->getData())) {
- $field->addError(new FormError('The CSRF token is invalid. Please try to resubmit the form'));
+ function (FormInterface $form) use ($csrfProvider, $pageId) {
+ if ($form->hasParent() && $form->getParent()->isRoot()
+ && !$csrfProvider->isCsrfTokenValid($pageId, $form->getData())) {
+ $form->addError(new FormError('The CSRF token is invalid. Please try to resubmit the form'));
}
}
)); | [Form] CSRF token is now only validated for root form | symfony_symfony | train | php |
f12db64d850df09ef5c194b565888fdbc8543cc3 | diff --git a/src/contrib/langcheck.php b/src/contrib/langcheck.php
index <HASH>..<HASH> 100644
--- a/src/contrib/langcheck.php
+++ b/src/contrib/langcheck.php
@@ -453,8 +453,8 @@ if(!$error_abort) {
report_error(TYPE_WARNING, "Language file contains an non-string entry at \$language_data['KEYWORDS'][$key][$id]!");
} else if (!strlen($kw)) {
report_error(TYPE_ERROR, "Language file contains an empty string entry at \$language_data['KEYWORDS'][$key][$id]!");
- } else if (!preg_match('/[a-zA-Z]{2,}/i', $kw)) {
- report_error(TYPE_NOTICE, "Language file contains an keyword ('$kw') entry with not at least 2 subsequent letters at \$language_data['KEYWORDS'][$key][$id]!");
+// } else if (!preg_match('/[a-zA-Z]{2,}/i', $kw)) {
+// report_error(TYPE_NOTICE, "Language file contains an keyword ('$kw') entry with not at least 2 subsequent letters at \$language_data['KEYWORDS'][$key][$id]!");
}
}
if(count($keywords) != count(array_unique($keywords))) { | del: Removed check for keywords containing at least 2 subsequent letters | GeSHi_geshi-1.0 | train | php |
27c60860ce52928fb53b8ee7b60f41193a6729a7 | diff --git a/src/LiveDevelopment/LiveDevelopment.js b/src/LiveDevelopment/LiveDevelopment.js
index <HASH>..<HASH> 100644
--- a/src/LiveDevelopment/LiveDevelopment.js
+++ b/src/LiveDevelopment/LiveDevelopment.js
@@ -250,9 +250,18 @@ define(function LiveDevelopment(require, exports, module) {
/** Triggered by Inspector.error */
function _onError(error) {
- console.error(error.message);
- }
+ var message = error.message;
+
+ // Additional information, like exactly which parameter could not be processed.
+ var data = error.data;
+ if ($.isArray(data)) {
+ message += "\n" + data.join("\n");
+ }
+ // Show the message, but include the error object for further information (e.g. error code)
+ console.error(message, error);
+ }
+
/** Run when all agents are loaded */
function _onLoad() {
var doc = _getCurrentDocument(); | Improve console output of LiveDevelopment errors
Before:
Some arguments of method 'Debugger.setBreakpointByUrl' can't be processed
After:
Some arguments of method 'Debugger.setBreakpointByUrl' can't be processed
Parameter 'lineNumber' has wrong type. It must be 'Number'.
Parameter 'url' has wrong type. It must be 'String'.
[expandable error object] | adobe_brackets | train | js |
b89c2ff20d3c69bcd22111467963d65179af7503 | diff --git a/src/Validator.php b/src/Validator.php
index <HASH>..<HASH> 100644
--- a/src/Validator.php
+++ b/src/Validator.php
@@ -93,7 +93,7 @@ class Validator
return false;
}
- if (0 === preg_match('/^'.$this->patterns[$countryCode].'$/', $vatin)) {
+ if (0 === preg_match('/^(?:'.$this->patterns[$countryCode].')$/', $vatin)) {
return false;
}
diff --git a/tests/ValidatorTest.php b/tests/ValidatorTest.php
index <HASH>..<HASH> 100644
--- a/tests/ValidatorTest.php
+++ b/tests/ValidatorTest.php
@@ -158,6 +158,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase
array(''),
array('123456789'),
array('XX123'),
+ array('GB999999973dsflksdjflsk'),
array('BE2999999999'), // Belgium - "the first digit following the prefix is always zero ("0") or ("1")"
);
} | Added a surrounding non-matching group, and accompanying test (#<I>) | ddeboer_vatin | train | php,php |
a03ab57bc02f1fe445bdcaef0638b36b01053b9d | diff --git a/.buildkite/pipeline.py b/.buildkite/pipeline.py
index <HASH>..<HASH> 100644
--- a/.buildkite/pipeline.py
+++ b/.buildkite/pipeline.py
@@ -20,7 +20,7 @@ TOX_MAP = {
}
# https://github.com/dagster-io/dagster/issues/1662
-DO_COVERAGE = True
+DO_COVERAGE = False
# GCP tests need appropriate credentials
GCP_CREDS_LOCAL_FILE = "/tmp/gcp-key-elementl-dev.json" | Disable coveralls
Summary:
Coveralls is breaking master
Tracking <URL> | dagster-io_dagster | train | py |
d294ccba7c5b59df911c92953c1e20884c8af4e5 | diff --git a/packages/themify/src/index.js b/packages/themify/src/index.js
index <HASH>..<HASH> 100755
--- a/packages/themify/src/index.js
+++ b/packages/themify/src/index.js
@@ -56,7 +56,6 @@ function writeToFile(filePath, output) {
return fs.outputFileSync(filePath, output);
}
-
/** Define the default variation */
const defaultVariation = ColorVariation.LIGHT;
@@ -304,9 +303,7 @@ function themify(options) {
}
// define which modes need to be processed
- const execModes = [
- ExecutionMode.CSS_COLOR,
- ];
+ const execModes = [ExecutionMode.CSS_COLOR];
walkFallbackAtRules(root, execModes, output);
walkFallbackRules(root, execModes, output); | fix: fix prettier lint issues | bolt-design-system_bolt | train | js |
6a3c76af36fd20c98b41dfbb5a0733d1cad56bff | diff --git a/web/concrete/core/Database/Connection.php b/web/concrete/core/Database/Connection.php
index <HASH>..<HASH> 100644
--- a/web/concrete/core/Database/Connection.php
+++ b/web/concrete/core/Database/Connection.php
@@ -239,6 +239,15 @@ class Connection extends \Doctrine\DBAL\Connection
return true;
}
+ /**
+ * @deprecated Alias to old ADODB method
+ */
+ public function StartTrans()
+ {
+ $db->BeginTrans();
+
+ return true;
+ }
/**
* @deprecated Alias to old ADODB method
@@ -249,6 +258,15 @@ class Connection extends \Doctrine\DBAL\Connection
return true;
}
+ /**
+ * @deprecated Alias to old ADODB method
+ */
+ public function CompleteTrans()
+ {
+ $this->commit();
+
+ return true;
+ }
/**
* @deprecated Alias to old ADODB method
@@ -259,5 +277,14 @@ class Connection extends \Doctrine\DBAL\Connection
return true;
}
+ /**
+ * @deprecated Alias to old ADODB method
+ */
+ public function FailTrans()
+ {
+ $this->rollBack();
+
+ return true;
+ }
} | Add transaction-related functions
Let's implement some transaction-related compatible with old ADODB methods
Former-commit-id: e<I>d1ee<I>dca<I>eac<I>ddddb1af0eeb7bac<I> | concrete5_concrete5 | train | php |
f27414ae543ac7b4faed989cdc9adc0857f15fc1 | diff --git a/crud/ActiveNavigation.php b/crud/ActiveNavigation.php
index <HASH>..<HASH> 100644
--- a/crud/ActiveNavigation.php
+++ b/crud/ActiveNavigation.php
@@ -196,7 +196,8 @@ class ActiveNavigation extends Behavior
'linkOptions' => $enabled ? ['data-confirm' => $confirms['disable']] : [],
];
}
- if (class_exists('netis\fsm\components\StateAction') && $model instanceof \netis\fsm\components\IStateful
+ if (!$model->isNewRecord && class_exists('netis\fsm\components\StateAction')
+ && $model instanceof \netis\fsm\components\IStateful
&& $privs['state']
) {
$transitions = $model->getTransitionsGroupedByTarget(); | don't display state transitions menu for new records | netis-pl_yii2-crud | train | php |
c274921f2b2205400d7ee2946ec477721ca135fb | diff --git a/tests/external/py2/testfixture_test.py b/tests/external/py2/testfixture_test.py
index <HASH>..<HASH> 100644
--- a/tests/external/py2/testfixture_test.py
+++ b/tests/external/py2/testfixture_test.py
@@ -1,11 +1,23 @@
#!/usr/bin/env python
# ----------------------------------------------------------------------
-# Copyright (C) 2013 Numenta Inc. All rights reserved.
+# Numenta Platform for Intelligent Computing (NuPIC)
+# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
+# Numenta, Inc. a separate commercial license for this software code, the
+# following terms and conditions apply:
#
-# The information and source code contained herein is the
-# exclusive property of Numenta Inc. No part of this software
-# may be used, reproduced, stored or distributed in any form,
-# without explicit written authorization from Numenta Inc.
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see http://www.gnu.org/licenses.
+#
+# http://numenta.org/licenses/
# ----------------------------------------------------------------------
""" | Added numenta.org file header | numenta_nupic | train | py |
fcedb33a34b35f86315ca3daf58c5f7a7f7e3e5a | diff --git a/upload/admin/controller/openbay/amazonus.php b/upload/admin/controller/openbay/amazonus.php
index <HASH>..<HASH> 100644
--- a/upload/admin/controller/openbay/amazonus.php
+++ b/upload/admin/controller/openbay/amazonus.php
@@ -757,8 +757,6 @@ class ControllerOpenbayAmazonus extends Controller {
$page = 1;
}
- $data = array();
-
$data['start'] = ($page - 1) * $this->config->get('config_limit_admin');
$data['limit'] = $this->config->get('config_limit_admin'); | Fix Amazon US bulk listing data array. | opencart_opencart | train | php |
aa96077850189220282b08d251555f2c882b26dd | diff --git a/interp/interp.go b/interp/interp.go
index <HASH>..<HASH> 100644
--- a/interp/interp.go
+++ b/interp/interp.go
@@ -49,12 +49,16 @@ func (r *Runner) interpErr(pos syntax.Pos, format string, a ...interface{}) {
}
}
-// Run starts the interpreter and returns any error.
-func (r *Runner) Run() error {
- r.node(r.File)
+func (r *Runner) lastExit() {
if r.err == nil && r.exit != 0 {
r.err = ExitCode(r.exit)
}
+}
+
+// Run starts the interpreter and returns any error.
+func (r *Runner) Run() error {
+ r.node(r.File)
+ r.lastExit()
return r.err
}
@@ -153,9 +157,7 @@ func (r *Runner) call(prog *syntax.Word, args []*syntax.Word) {
case "exit":
switch len(args) {
case 0:
- if r.exit != 0 {
- r.err = ExitCode(r.exit)
- }
+ r.lastExit()
case 1:
str := r.word(args[0])
if n, err := strconv.Atoi(str); err != nil { | interp: factor out exit without args | mvdan_sh | train | go |
ad38db47bd1efd42f8664105dd460af5d14da00c | diff --git a/PHPCI/Plugin/PhpSpec.php b/PHPCI/Plugin/PhpSpec.php
index <HASH>..<HASH> 100644
--- a/PHPCI/Plugin/PhpSpec.php
+++ b/PHPCI/Plugin/PhpSpec.php
@@ -21,15 +21,10 @@ use PHPCI\Model\Build;
class PhpSpec implements \PHPCI\Plugin
{
protected $phpci;
- protected $bootstrap;
public function __construct(Builder $phpci, Build $build, array $options = array())
{
$this->phpci = $phpci;
-
- if (!empty($options['bootstrap'])) {
- $this->bootstrap = $this->buildPath . $options['bootstrap'];
- }
}
/**
@@ -47,11 +42,7 @@ class PhpSpec implements \PHPCI\Plugin
return false;
}
- if ($this->bootstrap) {
- $success = $this->phpci->executeCommand($phpspec . ' -f d');
- } else {
- $success = $this->phpci->executeCommand($phpspec . ' -f d --bootstrap "%s"', $this->bootstrap);
- }
+ $success = $this->phpci->executeCommand($phpspec . ' --format=pretty --no-code-generation');
chdir($curdir); | Updating PHPSpec plugin to work with v2. Fixes #<I> | dancryer_PHPCI | train | php |
f6a61620273ea37c0b2cd665553d4e1c3c69e3d7 | diff --git a/src/webroot/cms/content-manager/sitemap/modules/tree/tree-node.js b/src/webroot/cms/content-manager/sitemap/modules/tree/tree-node.js
index <HASH>..<HASH> 100644
--- a/src/webroot/cms/content-manager/sitemap/modules/tree/tree-node.js
+++ b/src/webroot/cms/content-manager/sitemap/modules/tree/tree-node.js
@@ -1366,6 +1366,11 @@ YUI().add('website.sitemap-tree-node', function (Y) {
this.children().forEach(function (item) {
if (item._dnd) {
item._dnd.target.addToGroup('default');
+
+ //Unlock
+ if (Y.DD.DDM.activeDrag) {
+ item._dnd.target.set('lock', false);
+ }
}
}, this); | #<I> After page expend on children pages user can drop dragged item | sitesupra_sitesupra | train | js |
dbb5d46d4bb322d35211a772e9eb448091240c35 | diff --git a/src/library/styles/__tests__/createStyledComponent.spec.js b/src/library/styles/__tests__/createStyledComponent.spec.js
index <HASH>..<HASH> 100644
--- a/src/library/styles/__tests__/createStyledComponent.spec.js
+++ b/src/library/styles/__tests__/createStyledComponent.spec.js
@@ -1,6 +1,7 @@
/* @flow */
import React from 'react';
import { mount } from 'enzyme';
+import semver from 'semver';
import { createStyledComponent } from '../../styles';
const mountButton = (props = {}, styles = {}, options = {}) => {
@@ -53,6 +54,13 @@ describe('createStyledComponent', () => {
});
describe('with forwardProps option', () => {
+ if (semver.lt(React.version, '16.0.0')) {
+ // eslint-disable-next-line no-console
+ console.log(
+ 'NOTE: The following warning is expected and safe to ignore.'
+ );
+ }
+
const wrapper = mountButton(
{ forwardme: 'true' },
{}, | test(styles): Add note about warning that is safe to ignore | mineral-ui_mineral-ui | train | js |
9a2188618195514c78d813bd8bafd9a5e6579914 | diff --git a/sos/__main__.py b/sos/__main__.py
index <HASH>..<HASH> 100755
--- a/sos/__main__.py
+++ b/sos/__main__.py
@@ -391,7 +391,16 @@ def check_task(task):
if not os.path.isfile(status_file):
return 'not started'
elif os.path.isfile(res_file):
- return 'completed'
+ import pickle
+ try:
+ with open(res_file, 'rb') as result:
+ res = pickle.load(result)
+ if res['succ'] == 0:
+ return 'completed'
+ else:
+ return 'failed'
+ except Exception as e:
+ return 'failed'
# dead?
import time
from .utils import env | Actually check the result file to see if a remote job has failed | vatlab_SoS | train | py |
a54f58c3c8f3fcf014f46b796a9d5942547e8038 | diff --git a/client/js/uploader.basic.js b/client/js/uploader.basic.js
index <HASH>..<HASH> 100644
--- a/client/js/uploader.basic.js
+++ b/client/js/uploader.basic.js
@@ -44,9 +44,9 @@ qq.FineUploaderBasic = function(o){
alert(message);
},
retry: {
- enableAuto: true,
+ enableAuto: true, //TODO default to false
maxAuto: 3,
- delay: 2000
+ delay: 5000
}
}; | auto-retry working for XHR and form uploaders, many additional items TODO before this feature is complete | FineUploader_fine-uploader | train | js |
e19dc1aa141b30f2ba59bbd478b1e1f6f082d795 | diff --git a/generators/entity/index.js b/generators/entity/index.js
index <HASH>..<HASH> 100644
--- a/generators/entity/index.js
+++ b/generators/entity/index.js
@@ -192,6 +192,12 @@ module.exports = class extends BaseGenerator {
context.mainClass = this.getMainClassName(context.baseName);
context.microserviceAppName = '';
+ if (context.applicationType === 'microservice') {
+ context.microserviceName = context.baseName;
+ if (!context.clientRootFolder) {
+ context.clientRootFolder = context.microserviceName;
+ }
+ }
context.filename = `${context.jhipsterConfigDirectory}/${context.entityNameCapitalized}.json`;
if (shelljs.test('-f', context.filename)) {
this.log(chalk.green(`\nFound the ${context.filename} configuration file, entity can be automatically generated!\n`)); | set default clientRootFolder for microservice entities
fixes the i<I>n header sent on entity CRUD actions from
the microservice entity's Resource.java
Fix #<I> | jhipster_generator-jhipster | train | js |
e7894d8829dc11ae8b113db1c5d25ce9b7d758fd | diff --git a/src/main/java/org/agmip/translators/dssat/DssatRunFileOutput.java b/src/main/java/org/agmip/translators/dssat/DssatRunFileOutput.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/agmip/translators/dssat/DssatRunFileOutput.java
+++ b/src/main/java/org/agmip/translators/dssat/DssatRunFileOutput.java
@@ -14,7 +14,7 @@ import java.util.Map;
* @author Meng Zhang
* @version 1.0
*/
-public class DssatRunFileOutput extends DssatCommonOutput {
+public class DssatRunFileOutput extends DssatCommonOutput implements DssatBtachFile {
/**
* DSSAT Run File Output method | 1. update to multi-thread mode | agmip_translator-dssat | train | java |
e79829b5b368617d8a95051f986afbe3621a8a4b | diff --git a/cmd/config/identity/ldap/config.go b/cmd/config/identity/ldap/config.go
index <HASH>..<HASH> 100644
--- a/cmd/config/identity/ldap/config.go
+++ b/cmd/config/identity/ldap/config.go
@@ -283,6 +283,11 @@ func (l *Config) Bind(username, password string) (string, []string, error) {
errRet := fmt.Errorf("LDAP auth failed for DN %s: %v", bindDN, err)
return "", nil, errRet
}
+
+ // Bind to the lookup user account again to perform group search.
+ if err = l.lookupBind(conn); err != nil {
+ return "", nil, err
+ }
} else {
// Verify login credentials by checking the username formats.
bindDN, err = l.usernameFormatsBind(conn, username, password) | Bind to lookup user after user auth to lookup ldap groups (#<I>) | minio_minio | train | go |
50e069c4f7ef1aad6140d822a0c94090cd3fbc8e | diff --git a/src/main/java/org/asteriskjava/manager/internal/EventBuilderImpl.java b/src/main/java/org/asteriskjava/manager/internal/EventBuilderImpl.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/asteriskjava/manager/internal/EventBuilderImpl.java
+++ b/src/main/java/org/asteriskjava/manager/internal/EventBuilderImpl.java
@@ -306,8 +306,8 @@ class EventBuilderImpl implements EventBuilder
// it seems silly to warn if it's a user event -- maybe it was intentional
if (setter == null && !(event instanceof UserEvent))
{
- logger.error("Unable to set property '" + name + "' to '" + attributes.get(name) + "' on "
- + event.getClass().getName() + ": no setter");
+ logger.warn("Unable to set property '" + name + "' to '" + attributes.get(name) + "' on "
+ + event.getClass().getName() + ": no setter. Please report at http://jira.reucon.org/browse/AJ");
}
if(setter == null) { | [AJ-<I>] Decreased log level to warning for missing setters and added a note to report the issue. | asterisk-java_asterisk-java | train | java |
7b68ef13b3435e0ee5ae4155f4bf01b1a28e2606 | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,9 +1,8 @@
-/* eslint comma-dangle: 0 */
+/* eslint-disable comma-dangle */
'use strict';
module.exports = function(grunt) {
-
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'), | Fix small style issues in Gruntfile
[ci skip] | nwoltman_string-natural-compare | train | js |
b32a89805e24c1c1ee8b872c12710e5a124aa662 | diff --git a/test/transformer.base.js b/test/transformer.base.js
index <HASH>..<HASH> 100644
--- a/test/transformer.base.js
+++ b/test/transformer.base.js
@@ -546,6 +546,28 @@ module.exports = function base(transformer, pathname, transformer_name) {
done();
});
+ it('supports async connection events', function (done) {
+ var pre;
+
+ primus.on('connection', function (spark, next) {
+ setTimeout(function () {
+ pre = 'async';
+ next();
+ }, 10);
+ });
+
+ primus.on('connection', function (spark) {
+ expect(pre).to.equal('async');
+ spark.end();
+ done();
+ });
+
+ //
+ // Connect AFTER the things are called
+ //
+ var socket = new Socket(server.addr);
+ });
+
describe('#transform', function () {
it('thrown an error if an invalid type is given', function (done) {
var socket = new Socket(server.addr); | [test] Add test for async execution of the `connection` event. | primus_primus | train | js |
cdef24b01caec70e80ec8d3166d5475c428eed8b | diff --git a/core/src/main/java/hudson/model/Slave.java b/core/src/main/java/hudson/model/Slave.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/hudson/model/Slave.java
+++ b/core/src/main/java/hudson/model/Slave.java
@@ -308,7 +308,7 @@ public abstract class Slave extends Node implements Serializable {
}
public RetentionStrategy getRetentionStrategy() {
- return retentionStrategy == null ? RetentionStrategy.INSTANCE : retentionStrategy;
+ return retentionStrategy == null ? RetentionStrategy.Always.INSTANCE : retentionStrategy;
}
@DataBoundSetter | Go back to original way of referring to RetentionStrategy.Always.INSTANCE | jenkinsci_jenkins | train | java |
481b55e31e55b0c591d794c11150fb2e8c881068 | diff --git a/lib/ronin/database.rb b/lib/ronin/database.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/database.rb
+++ b/lib/ronin/database.rb
@@ -24,6 +24,11 @@
require 'ronin/exceptions/invalid_database_config'
require 'ronin/extensions/kernel'
require 'ronin/config'
+require 'ronin/arch'
+require 'ronin/platform'
+require 'ronin/author'
+require 'ronin/license'
+require 'ronin/product'
require 'yaml'
require 'dm-core'
diff --git a/lib/ronin/models.rb b/lib/ronin/models.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/models.rb
+++ b/lib/ronin/models.rb
@@ -23,11 +23,6 @@
require 'ronin/extensions/kernel'
require 'ronin/model'
-require 'ronin/arch'
-require 'ronin/platform'
-require 'ronin/author'
-require 'ronin/license'
-require 'ronin/product'
module Ronin
ronin_require 'ronin/models' | * Require basic models along with the database. | ronin-ruby_ronin | train | rb,rb |
735301bcd2913f3ca3ac4c67e9f6ce735cae8f23 | diff --git a/words/actions.js b/words/actions.js
index <HASH>..<HASH> 100644
--- a/words/actions.js
+++ b/words/actions.js
@@ -30,7 +30,7 @@ actions.getWords = (req, res, next) => {
.then((flattenedWords) => {
return _.sortBy(flattenedWords, [
(word) => {
- return word.dateCreated ? word.dateCreated.valueOf() * -1 : word.datePublished.valueOf() * -1;
+ return word.dateCreated ? word.dateCreated.valueOf() * -1 : word.datePublished ? word.datePublished.valueOf() * -1 : 0;
}
]);
}) | Hmmm. Apparently `datePublished` can be falsy, so guard against it.
Need to figure out exactly where I left off with this... | randytarampi_me | train | js |
5f253d6a4b859c6d0aea9d85c913c0a889673af5 | diff --git a/lib/instance_methods.js b/lib/instance_methods.js
index <HASH>..<HASH> 100644
--- a/lib/instance_methods.js
+++ b/lib/instance_methods.js
@@ -63,7 +63,7 @@ var InstanceMethods = {
collection = new EmbeddedCollection(docs, that, Model)
} else {
query = {}
- query[_.uncapitalize(this.modelName) + "Id"] = that.get("_id")
+ query[_.uncapitalize(that.modelName) + "Id"] = that.get("_id")
collection = Model.read(query)
}
that.manyAssociations[collectionName] = function(callback) { | w<I>ps binding | xcoderzach_LiveDocument | train | js |
fc6019467d6880afa7fa70461a014207fd1ae7ba | diff --git a/onnxmltools/__init__.py b/onnxmltools/__init__.py
index <HASH>..<HASH> 100644
--- a/onnxmltools/__init__.py
+++ b/onnxmltools/__init__.py
@@ -9,7 +9,7 @@ Main entry point to onnxmltools.
This framework converts any machine learned model into onnx format
which is a common language to describe any machine learned model.
"""
-__version__ = "1.3.1"
+__version__ = "1.3.2"
__author__ = "Microsoft"
__producer__ = "OnnxMLTools"
__producer_version__ = __version__ | Upgrade the minor version for pypi package release. | onnx_onnxmltools | train | py |
68efc95a6080f8ff0167389b3828d1a9b5245591 | diff --git a/test/leafnode_test.go b/test/leafnode_test.go
index <HASH>..<HASH> 100644
--- a/test/leafnode_test.go
+++ b/test/leafnode_test.go
@@ -608,7 +608,8 @@ func waitForOutboundGateways(t *testing.T, s *server.Server, expected int, timeo
}
checkFor(t, timeout, 15*time.Millisecond, func() error {
if n := s.NumOutboundGateways(); n != expected {
- return fmt.Errorf("Expected %v outbound gateway(s), got %v", expected, n)
+ return fmt.Errorf("Expected %v outbound gateway(s), got %v (ulimt -n too low?)",
+ expected, n)
}
return nil
}) | Modifying unit test error message to hint at ulimit -n possibly being too low | nats-io_gnatsd | train | go |
fcdd91bac3423d87eed4ba7ff29da6ee07fde48e | diff --git a/bbs/run_once_bbs_test.go b/bbs/run_once_bbs_test.go
index <HASH>..<HASH> 100644
--- a/bbs/run_once_bbs_test.go
+++ b/bbs/run_once_bbs_test.go
@@ -21,6 +21,8 @@ var _ = Describe("RunOnce BBS", func() {
ContainerHandle: "container-handle",
CreatedAt: time.Now(),
}
+
+ println("runonce createdat:", runOnce.CreatedAt.String())
})
itRetriesUntilStoreComesBack := func(action func(*BBS, models.RunOnce) error) {
@@ -300,7 +302,9 @@ var _ = Describe("RunOnce BBS", func() {
err := bbs.DesireRunOnce(runOnce)
Ω(err).ShouldNot(HaveOccurred())
- Expect(<-events).To(Equal(runOnce))
+ e := <-events
+ println("---", e.CreatedAt.String())
+ Expect(e).To(Equal(runOnce))
err = bbs.DesireRunOnce(runOnce)
Ω(err).ShouldNot(HaveOccurred()) | Add debug to see why times aren't matching. | cloudfoundry_runtimeschema | train | go |
72dc6220ff3b24be8c75aee6dfe2e50221f2b46f | diff --git a/lib/plezi/common/cache.rb b/lib/plezi/common/cache.rb
index <HASH>..<HASH> 100644
--- a/lib/plezi/common/cache.rb
+++ b/lib/plezi/common/cache.rb
@@ -21,7 +21,8 @@ module Plezi
# initialize a Cached object
def initialize d = nil, t = Time.now
- @data, @mtime = d, t
+ @data = t
+ @mtime = d
end
end | multi-assignment is slower | boazsegev_plezi | train | rb |
d4e46dab60bb7821737460a07e4ec71fcb407519 | diff --git a/runtime/types.go b/runtime/types.go
index <HASH>..<HASH> 100644
--- a/runtime/types.go
+++ b/runtime/types.go
@@ -2,6 +2,7 @@ package runtime
import (
"errors"
+ "fmt"
"github.com/mailru/easyjson"
"github.com/mailru/easyjson/jlexer"
@@ -181,6 +182,13 @@ type ExceptionDetails struct {
ExecutionContextID ExecutionContextID `json:"executionContextId,omitempty"` // Identifier of the context where exception happened.
}
+// Error satisfies the error interface.
+func (e *ExceptionDetails) Error() string {
+ // TODO: watch script parsed events and match the ExceptionDetails.ScriptID
+ // to the name/location of the actual code and display here
+ return fmt.Sprintf("encountered exception '%s' (%d:%d)", e.Text, e.LineNumber, e.ColumnNumber)
+}
+
// CallFrame stack entry for runtime errors and assertions.
type CallFrame struct {
FunctionName string `json:"functionName,omitempty"` // JavaScript function name. | Expanding Evaluate API
- fixed issues with Evaluate
- added examples/eval | chromedp_cdproto | train | go |
5a774b2eb8a3c5c98bc01d3c8c218802e6c8d9ca | diff --git a/tests/Assetic/Test/Filter/ScssphpFilterTest.php b/tests/Assetic/Test/Filter/ScssphpFilterTest.php
index <HASH>..<HASH> 100644
--- a/tests/Assetic/Test/Filter/ScssphpFilterTest.php
+++ b/tests/Assetic/Test/Filter/ScssphpFilterTest.php
@@ -88,8 +88,7 @@ EOF;
{
$this->setExpectedExceptionRegExp(
"Exception",
- preg_quote("/Undefined mixin box-shadow: failed at `@include box-shadow(10px 10px 8px red);`").
- ".*?".preg_quote(" line 4/")
+ "/Undefined mixin box\-shadow\: failed at `@include box\-shadow\(10px 10px 8px red\);`.*? line 4/"
);
$asset = new FileAsset(__DIR__.'/fixtures/sass/main_compass.scss'); | Single regular expression instead of preg_quote and string concatenations | kriswallsmith_assetic | train | php |
cd3e3f547652c5c7b2e53091f2dc2ff9d3b032b5 | diff --git a/public/examples/scripts/gamesupport.js b/public/examples/scripts/gamesupport.js
index <HASH>..<HASH> 100644
--- a/public/examples/scripts/gamesupport.js
+++ b/public/examples/scripts/gamesupport.js
@@ -87,6 +87,7 @@ define([
var run = function(globals, fn) {
var clock = new GameClock();
+ var requestId;
var loop = function() {
stats.begin();
@@ -96,9 +97,28 @@ define([
fn();
stats.end();
- requestAnimationFrame(loop);
+ requestId = requestAnimationFrame(loop);
};
- loop();
+
+ var start = function() {
+ if (requestId === undefined) {
+ loop();
+ }
+ };
+
+ var stop = function() {
+ if (requestId !== undefined) {
+ cancelAnimationFrame(requestId);
+ requestId = undefined;
+ }
+ };
+
+ if (!globals.haveServer || globals.pauseOnBlur) {
+ window.addEventListener('blur', stop, false);
+ window.addEventListener('focus', start, false);
+ }
+
+ start();
};
var setStatus = function(str) { | make game pause haveServer is false and it's not the top window | greggman_HappyFunTimes | train | js |
2809e0e6ff89d0464fa7b46891034ce101453f1a | diff --git a/vyper/parser/arg_clamps.py b/vyper/parser/arg_clamps.py
index <HASH>..<HASH> 100644
--- a/vyper/parser/arg_clamps.py
+++ b/vyper/parser/arg_clamps.py
@@ -1,6 +1,7 @@
import functools
import uuid
+from vyper.opcodes import version_check
from vyper.parser.lll_node import LLLnode
from vyper.types.types import (
ByteArrayLike,
@@ -60,9 +61,11 @@ def make_arg_clamper(datapos, mempos, typ, is_init=False):
)
# Booleans: make sure they're zero or one
elif is_base_type(typ, "bool"):
- return LLLnode.from_list(
- ["uclamplt", data_decl, 2], typ=typ, annotation="checking bool input",
- )
+ if version_check("constantinople"):
+ lll = ["assert", ["iszero", ["shr", 1, data_decl]]]
+ else:
+ lll = ["uclamplt", data_decl, 2]
+ return LLLnode.from_list(lll, typ=typ, annotation="checking bool input")
# Addresses: make sure they're in range
elif is_base_type(typ, "address"):
return LLLnode.from_list( | feat: use shr for clamping booleans | ethereum_vyper | train | py |
1ca1ad4086b9550f1e9fb46a00c48ded7426434d | diff --git a/openquake/hazard/disagg/core.py b/openquake/hazard/disagg/core.py
index <HASH>..<HASH> 100644
--- a/openquake/hazard/disagg/core.py
+++ b/openquake/hazard/disagg/core.py
@@ -242,7 +242,7 @@ class DisaggMixin(Mixin):
constructed like so: <base_path>/disagg-results/job-<job_id>.
For example:
- >>> DisaggMixin.create_result_dir('/var/lib/openquake', '2847')
+ >>> DisaggMixin.create_result_dir('/var/lib/openquake', 2847)
'/var/lib/openquake/disagg-results/job-2847'
:param base_path: base result storage directory (a path to an NFS | fixed a doctest, per review comments
Former-commit-id: 8a<I>c<I>c4e6df<I>d7e4c<I>ecfac<I>d | gem_oq-engine | train | py |
d364c68476f25b0b86fcfd3f96476b0e842b4931 | diff --git a/classes/PodsUI.php b/classes/PodsUI.php
index <HASH>..<HASH> 100644
--- a/classes/PodsUI.php
+++ b/classes/PodsUI.php
@@ -2303,7 +2303,7 @@ class PodsUI {
if ( !empty( $this->data ) ) {
if ( empty( $this->data_keys ) || count( $this->data ) != count( $this->data_keys ) ) {
- $this->data_keys = array_keys( $this->data[ 0 ] );
+ $this->data_keys = array_keys( $this->data );
}
if ( count( $this->data ) == $this->total && isset( $this->data_keys[ $counter ] ) && isset( $this->data[ $this->data_keys[ $counter ] ] ) ) { | Fix PodsUI Bug Error in Pods UI #<I> | pods-framework_pods | train | php |
90fee686e509aca198379681b9c4b2aaa1ffed9f | diff --git a/AbstractCollection.php b/AbstractCollection.php
index <HASH>..<HASH> 100644
--- a/AbstractCollection.php
+++ b/AbstractCollection.php
@@ -5,6 +5,7 @@ namespace Aircury\Collection;
use Aircury\Collection\Exceptions\InvalidKeyException;
use Aircury\Collection\Exceptions\ProtectedKeyException;
use Aircury\Collection\Exceptions\UnexpectedElementException;
+use Closure;
abstract class AbstractCollection implements CollectionInterface
{
@@ -294,6 +295,22 @@ abstract class AbstractCollection implements CollectionInterface
/**
* @inheritdoc
*/
+ public function map(Closure $func, bool $returnNewCollection = true)
+ {
+ $elements = array_map($func, $this->elements);
+
+ if ($returnNewCollection) {
+ return new static($elements);
+ }
+
+ $this->setElements($elements);
+
+ return $this;
+ }
+
+ /**
+ * @inheritdoc
+ */
public function removeElement($element): bool
{
$key = array_search($element, $this->elements, true); | Collection | Added map method to AbstractCollection
(cherry picked from commit 5aa<I>bd<I>e7d7a2fb5b<I>cc<I>e<I>fcb9e) | aircury_collection | train | php |
94f4da924845c5741ede6e77e356ef0e68ef92d5 | diff --git a/discord/ui/view.py b/discord/ui/view.py
index <HASH>..<HASH> 100644
--- a/discord/ui/view.py
+++ b/discord/ui/view.py
@@ -252,9 +252,10 @@ class View:
view.add_item(_component_to_item(component))
return view
- def add_item(self, item: Item[Any]) -> None:
+ def add_item(self, item: Item[Any]) -> Self:
"""Adds an item to the view.
-
+ This function returns the class instance to allow for fluent-style
+ chaining.
Parameters
-----------
item: :class:`Item`
@@ -279,9 +280,12 @@ class View:
item._view = self
self.children.append(item)
+ return self
- def remove_item(self, item: Item[Any]) -> None:
+ def remove_item(self, item: Item[Any]) -> Self:
"""Removes an item from the view.
+ This function returns the class instance to allow for fluent-style
+ chaining.
Parameters
-----------
@@ -295,11 +299,16 @@ class View:
pass
else:
self.__weights.remove_item(item)
+ return self
- def clear_items(self) -> None:
- """Removes all items from the view."""
+ def clear_items(self) -> Self:
+ """Removes all items from the view.
+ This function returns the class instance to allow for fluent-style
+ chaining.
+ """
self.children.clear()
self.__weights.clear()
+ return self
async def interaction_check(self, interaction: Interaction) -> bool:
"""|coro| | Change View child mutators to be fluent-style methods | Rapptz_discord.py | train | py |
29bc0e6eb152e911ae9c07653c09365b6de8c6d4 | diff --git a/openquake/calculators/base.py b/openquake/calculators/base.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/base.py
+++ b/openquake/calculators/base.py
@@ -188,7 +188,8 @@ def parallel_split_filter(csm, srcfilter, split, monitor):
split_filter if split else only_filter,
(sources, srcfilter, seed, monitor),
maxweight=RUPTURES_PER_BLOCK,
- weight=operator.attrgetter('num_ruptures'))
+ weight=operator.attrgetter('num_ruptures'),
+ progress=logging.debug)
if monitor.hdf5:
source_info = monitor.hdf5['source_info']
source_info.attrs['has_dupl_sources'] = csm.has_dupl_sources | Better logging [skip CI] | gem_oq-engine | train | py |
5e5aad8c549ef13fd5a8a24450b6cdcc097d3b9f | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -187,7 +187,7 @@ var styles = StyleSheet.create({
height: Ratio.getHeightPercent(2.5)
},
imgStyle: {
- resizeMode: 'stretch',
+ resizeMode: 'contain',
width: 25,
height: 19,
borderWidth: 1 / PixelRatio.get(), | Fixed bug on Android that caused wrong rendering of the flag images | xcarpentier_react-native-country-picker-modal | train | js |
e46e447b03eaf696f48eb1ac4043d82e738f4caf | diff --git a/core/src/utilities/helpers/navigation-helpers.js b/core/src/utilities/helpers/navigation-helpers.js
index <HASH>..<HASH> 100644
--- a/core/src/utilities/helpers/navigation-helpers.js
+++ b/core/src/utilities/helpers/navigation-helpers.js
@@ -3,7 +3,7 @@ import { LuigiAuth, LuigiConfig, LuigiFeatureToggles, LuigiI18N } from '../../co
import { AuthHelpers, GenericHelpers, RoutingHelpers } from './';
import { Navigation } from '../../navigation/services/navigation';
import { Routing } from '../../services/routing';
-import { reject } from 'lodash';
+import { reject, get } from 'lodash';
class NavigationHelpersClass {
constructor() {
@@ -369,14 +369,7 @@ class NavigationHelpersClass {
if (!propChain || !obj) {
return fallback;
}
- const propArray = propChain.split('.');
- let val = obj;
- propArray.forEach(el => {
- if (val) {
- val = val[el];
- }
- });
- return val || fallback;
+ return get(obj, propChain, fallback);
}
substituteVars(resolver, context) { | array index access to result in title resolver (#<I>) | kyma-project_luigi | train | js |
6a169cd41a5ea23b4371bfe2c1b39c6687bfebcd | diff --git a/python-package/xgboost/callback.py b/python-package/xgboost/callback.py
index <HASH>..<HASH> 100644
--- a/python-package/xgboost/callback.py
+++ b/python-package/xgboost/callback.py
@@ -209,6 +209,10 @@ def early_stop(stopping_rounds, maximize=False, verbose=True):
state['best_score'] = float('-inf')
else:
state['best_score'] = float('inf')
+ msg = '[%d]\t%s' % (
+ env.iteration,
+ '\t'.join([_fmt_metric(x) for x in env.evaluation_result_list]))
+ state['best_msg'] = msg
if bst is not None:
if bst.attr('best_score') is not None: | Fix uninitialized value bug in xgboost callback (#<I>) | dmlc_xgboost | train | py |
3510d5d344d3d03829c429a631f3bdff71d9c1c3 | diff --git a/lib/byebug.rb b/lib/byebug.rb
index <HASH>..<HASH> 100644
--- a/lib/byebug.rb
+++ b/lib/byebug.rb
@@ -131,6 +131,7 @@ module Byebug
Byebug.const_set('INITIAL_DIR', Dir.pwd) unless defined? Byebug::INITIAL_DIR
end
Byebug.tracing = options[:tracing] unless options[:tracing].nil?
+ Byebug.start_sentinal=caller(0)[1]
if Byebug.started?
retval = block && block.call(self)
else | Prevent some backtraces from wronly reporting truncation | deivid-rodriguez_byebug | train | rb |
a5132aa45f50699c3828ef90f48659e59927f955 | diff --git a/lib/Core/ComposerJsonFetcher.php b/lib/Core/ComposerJsonFetcher.php
index <HASH>..<HASH> 100644
--- a/lib/Core/ComposerJsonFetcher.php
+++ b/lib/Core/ComposerJsonFetcher.php
@@ -15,7 +15,7 @@ class ComposerJsonFetcher
*/
public function fetch()
{
- $composerJsonFileLocation = dirname(__FILE__) . '/../composer.json';
+ $composerJsonFileLocation = dirname(__FILE__) . '/../../composer.json';
return (array) json_decode(file_get_contents($composerJsonFileLocation), true);
} | Fix composer json fetcher bug | Autodesk-Forge_core-php-client | train | php |
49fe5ab637550e56757216eb4252f78cc41444b9 | diff --git a/server/database/route.js b/server/database/route.js
index <HASH>..<HASH> 100644
--- a/server/database/route.js
+++ b/server/database/route.js
@@ -19,6 +19,10 @@ module.exports = function(Database) {
zoom: { type: Sequelize.INTEGER.UNSIGNED, allowNull: false, validate: { min: 1, max: 20 } },
idx: { type: Sequelize.INTEGER.UNSIGNED, allowNull: false },
ele: { type: Sequelize.INTEGER, allowNull: true }
+ }, {
+ indexes: [
+ { fields: [ "routeId" ] }
+ ]
});
}); | Greatly increase routing performance by adding and index on routeId | FacilMap_facilmap2 | train | js |
5c17d14339450a385a0ef3848c0bbd1cb667f3e6 | diff --git a/MediaInfo.php b/MediaInfo.php
index <HASH>..<HASH> 100644
--- a/MediaInfo.php
+++ b/MediaInfo.php
@@ -34,7 +34,7 @@ class MediaInfo
*/
public function scan($filepath, $format='array')
{
- $proc = new Process(sprintf('%s %s --Output=XML', $this->path, $filepath));
+ $proc = new Process(sprintf('%s %s --Output=XML --Full', $this->path, $filepath));
$proc->run();
if (!$proc->isSuccessful()) { | Updated mediainfo command to give more details | AmericanCouncils_MediaInfoBundle | train | php |
a1cdc760ca4485364b6cb32eb5346ebca505eaa2 | diff --git a/db/db.py b/db/db.py
index <HASH>..<HASH> 100644
--- a/db/db.py
+++ b/db/db.py
@@ -39,9 +39,15 @@ except ImportError:
try:
import MySQLdb
+ mysql_connect = MySQLdb.connect
HAS_MYSQL = True
except ImportError:
- HAS_MYSQL = False
+ try:
+ import pymysql
+ mysql_connect = pymysql.connect
+ HAS_MYSQL = True
+ except ImportError:
+ HAS_MYSQL = False
try:
import sqlite3 as sqlite
@@ -753,7 +759,7 @@ class DB(object):
self._create_sqlite_metatable()
elif self.dbtype=="mysql":
if not HAS_MYSQL:
- raise Exception("Couldn't find MySQLdb library. Please ensure it is installed")
+ raise Exception("Couldn't find MySQLdb or pymysql library. Please ensure it is installed")
creds = {}
for arg in ["username", "password", "hostname", "port", "dbname"]:
if getattr(self, arg):
@@ -767,7 +773,7 @@ class DB(object):
elif arg=="hostname":
arg = "host"
creds[arg] = value
- self.con = MySQLdb.connect(**creds)
+ self.con = mysql_connect(**creds)
self.cur = self.con.cursor()
elif self.dbtype=="mssql":
if not HAS_ODBC: | Added support of additional mysql driver pymysql. | yhat_db.py | train | py |
54fcc8bf5a98c2dc5919b91190955a8bc01b40b0 | diff --git a/structr-ui/src/main/resources/structr/js/elements.js b/structr-ui/src/main/resources/structr/js/elements.js
index <HASH>..<HASH> 100644
--- a/structr-ui/src/main/resources/structr/js/elements.js
+++ b/structr-ui/src/main/resources/structr/js/elements.js
@@ -845,8 +845,14 @@ var _Elements = {
},
appendContextMenu: function(div, entity) {
- $('#menu-area').on("contextmenu",function(){
- return false;
+ $('#menu-area').on("contextmenu",function(e){
+ e.stopPropagation();
+ e.preventDefault();
+ });
+
+ $(div).on("contextmenu",function(e){
+ e.stopPropagation();
+ e.preventDefault();
});
$(div).on('mousedown', function(e) { | Added disable context menu fix for Internet Explorer. | structr_structr | train | js |
9bdb0f504eaadc7ef777707cdf821f41caa56833 | diff --git a/lib/URLUtil.php b/lib/URLUtil.php
index <HASH>..<HASH> 100644
--- a/lib/URLUtil.php
+++ b/lib/URLUtil.php
@@ -76,7 +76,7 @@ class URLUtil {
static function decodePathSegment($path) {
$path = rawurldecode($path);
- $encoding = mb_detect_encoding($path, array('UTF-8','ISO-8859-1'));
+ $encoding = mb_detect_encoding($path, ['UTF-8','ISO-8859-1']);
switch($encoding) {
@@ -109,11 +109,11 @@ class URLUtil {
*/
static function splitPath($path) {
- $matches = array();
+ $matches = [];
if(preg_match('/^(?:(?:(.*)(?:\/+))?([^\/]+))(?:\/?)$/u',$path,$matches)) {
- return array($matches[1],$matches[2]);
+ return [$matches[1], $matches[2]];
} else {
- return array(null,null);
+ return [null, null];
}
} | Update to PHP <I> array syntax.
I think this is @Hywan saw when he opened ticket #<I>. So I think we can
say that this fixes #<I>.
If not, reopen :) | sabre-io_http | train | php |
f08dba2805df31445cc0d09a4223e9a027db2d0f | diff --git a/lib/compiler/index.js b/lib/compiler/index.js
index <HASH>..<HASH> 100644
--- a/lib/compiler/index.js
+++ b/lib/compiler/index.js
@@ -15,8 +15,6 @@ var _ = require('underscore');
var JuttleMoment = require('../runtime/types/juttle-moment');
var juttle = require('../runtime').runtime;
-var Juttle = require('../runtime').Juttle;
-
var stages = {
semantic: function(ast, options) {
var s = new SemanticPass(options);
@@ -36,7 +34,7 @@ var stages = {
var program = new Graph();
program.built_graph = graph;
_.each(options.fg_processors, function(processor) {
- processor(program, Juttle);
+ processor(program);
});
return program;
}, | Do not pass the Juttle object to flowgraph processors
It is not used there. | juttle_juttle | train | js |
eca2b0c63917624a52cb31f52dde358d5c6e8b3c | diff --git a/blimpy/waterfall.py b/blimpy/waterfall.py
index <HASH>..<HASH> 100755
--- a/blimpy/waterfall.py
+++ b/blimpy/waterfall.py
@@ -54,9 +54,6 @@ MAX_BLOB_MB = 1024
class Waterfall():
""" Class for loading and writing blimpy data (.fil, .h5) """
- """ Get the frequency array for this Waterfall object"""
- get_freqs = lambda self: np.arange(0, self.header['nchans'], 1, dtype=float) * self.header['foff'] + self.header['fch1']
-
def __repr__(self):
return "Waterfall data: %s" % self.filename
@@ -128,6 +125,19 @@ class Waterfall():
self.data = self.container.data
+ def get_freqs(self):
+ """
+ Get the frequency array for this Waterfall object.
+
+ Returns
+ -------
+ numpy array
+ Values for all of the fine frequency channels.
+
+ """
+ return np.arange(0, self.header['nchans'], 1, dtype=float) \
+ * self.header['foff'] + self.header['fch1']
+
def read_data(self, f_start=None, f_stop=None,t_start=None, t_stop=None):
""" Reads data selection if small enough. | Fix issue #<I> documentation - no change to version. | UCBerkeleySETI_blimpy | train | py |
8fc7853dc0b5ec38978bb6b34cbc4af17a2849f1 | diff --git a/astrodbkit/astrodb.py b/astrodbkit/astrodb.py
index <HASH>..<HASH> 100755
--- a/astrodbkit/astrodb.py
+++ b/astrodbkit/astrodb.py
@@ -1116,7 +1116,12 @@ def convert_spectrum(File):
# If no wl axis generated, then clear out all retrieved data for object
if not spectrum[0]: spectrum = None
- except: pass
+ except:
+ # Check if the FITS file is just Numpy arrays
+ try:
+ spectrum, header = pf.getdata(File, cache=True, header=True)
+ except:
+ pass
# For .txt files
if File.endswith('.txt'): | Updated add_data() method to read in FITS files that are just Numpy arrays and headers. | BDNYC_astrodbkit | train | py |
5f0cda4a4f36b79a515ca1912c686eb347b2683f | diff --git a/src/Rollerworks/Bundle/MultiUserBundle/EventListener/AuthenticationListener.php b/src/Rollerworks/Bundle/MultiUserBundle/EventListener/AuthenticationListener.php
index <HASH>..<HASH> 100644
--- a/src/Rollerworks/Bundle/MultiUserBundle/EventListener/AuthenticationListener.php
+++ b/src/Rollerworks/Bundle/MultiUserBundle/EventListener/AuthenticationListener.php
@@ -76,8 +76,8 @@ class AuthenticationListener implements EventSubscriberInterface
public static function getSubscribedEvents()
{
return array(
- FOSUserEvents::SECURITY_IMPLICIT_LOGIN => 'onSecurityImplicitLogin',
- SecurityEvents::INTERACTIVE_LOGIN => 'onSecurityInteractiveLogin',
+ FOSUserEvents::SECURITY_IMPLICIT_LOGIN => array('onSecurityImplicitLogin', 255),
+ SecurityEvents::INTERACTIVE_LOGIN => array('onSecurityInteractiveLogin', 255),
);
} | AuthenticationListener needs to run before anything uses the UserDiscriminator, otherwise the $currentUser won't be set | rollerworks-graveyard_RollerworksMultiUserBundle | train | php |
c251fdea9098c823829b1064484ecc034b50b668 | diff --git a/jodd-json/src/test/java/jodd/json/JSONSerializationTest.java b/jodd-json/src/test/java/jodd/json/JSONSerializationTest.java
index <HASH>..<HASH> 100644
--- a/jodd-json/src/test/java/jodd/json/JSONSerializationTest.java
+++ b/jodd-json/src/test/java/jodd/json/JSONSerializationTest.java
@@ -697,6 +697,19 @@ class JSONSerializationTest {
assertEquals(expected_json, actual_json);
}
+ @Test
+ void testSerializeFloatArray() throws Exception {
+ final float[] input = new float[]{0, -0, 1.23f, -1.23f, Float.NaN, -Float.NaN, 5784374.34F, -3453321.99f};
+
+ final String expected_json = "[0.0,0.0,1.23,-1.23,NaN,NaN,5784374.5,-3453322.0]";
+
+ final String actual_json = new JsonSerializer().serialize(input);
+
+ // asserts
+ assertNotNull(actual_json);
+ assertEquals(expected_json, actual_json);
+ }
+
// ---------------------------------------------------------------- custom asserts | tests for FloatArraySerializer added | oblac_jodd | train | java |
35b224ba362af711077f2c80ae17e9fbd50d1730 | diff --git a/connection.go b/connection.go
index <HASH>..<HASH> 100644
--- a/connection.go
+++ b/connection.go
@@ -420,10 +420,12 @@ func (cn *connection) request(r request, mw messageWriter) bool {
if !cn.PeerHasPiece(r.Index.Int()) {
panic("requesting piece peer doesn't have")
}
- cn.requests[r] = struct{}{}
if _, ok := cn.t.conns[cn]; !ok {
panic("requesting but not in active conns")
}
+ if cn.closed.IsSet() {
+ panic("requesting when connection is closed")
+ }
if cn.PeerChoked {
if cn.peerAllowedFast.Get(int(r.Index)) {
torrent.Add("allowed fast requests sent", 1)
@@ -431,6 +433,7 @@ func (cn *connection) request(r request, mw messageWriter) bool {
panic("requesting while choked and not allowed fast")
}
}
+ cn.requests[r] = struct{}{}
cn.t.pendingRequests[r]++
return mw(pp.Message{
Type: pp.Request,
@@ -1384,6 +1387,9 @@ func (c *connection) deleteAllRequests() {
for r := range c.requests {
c.deleteRequest(r)
}
+ if len(c.requests) != 0 {
+ panic(len(c.requests))
+ }
// for c := range c.t.conns {
// c.tickleWriter()
// } | Add extra pedantic checks to requesting to try and flush out @deranjer's panics | anacrolix_torrent | train | go |
ce5430d759059bb010c5797936607c6c940af345 | diff --git a/compiler/natives/src/syscall/fs_js.go b/compiler/natives/src/syscall/fs_js.go
index <HASH>..<HASH> 100644
--- a/compiler/natives/src/syscall/fs_js.go
+++ b/compiler/natives/src/syscall/fs_js.go
@@ -23,7 +23,7 @@ func fsCall(name string, args ...interface{}) (js.Value, error) {
var res callResult
if len(args) >= 1 {
- if jsErr := args[0]; !jsErr.IsNull() {
+ if jsErr := args[0]; !jsErr.IsUndefined() && !jsErr.IsNull() {
res.err = mapJSError(jsErr)
}
} | Protect against jsFS callback error argument being undefined | gopherjs_gopherjs | train | go |
1486fb8108da832c2b189d8c9ebcf9003a64dfbf | diff --git a/src/transformers/models/mobilebert/modeling_mobilebert.py b/src/transformers/models/mobilebert/modeling_mobilebert.py
index <HASH>..<HASH> 100644
--- a/src/transformers/models/mobilebert/modeling_mobilebert.py
+++ b/src/transformers/models/mobilebert/modeling_mobilebert.py
@@ -964,7 +964,7 @@ class MobileBertForPreTraining(MobileBertPreTrainedModel):
>>> input_ids = torch.tensor(tokenizer.encode("Hello, my dog is cute", add_special_tokens=True)).unsqueeze(0) # Batch size 1
>>> outputs = model(input_ids)
- >>> prediction_logits = outptus.prediction_logits
+ >>> prediction_logits = outputs.prediction_logits
>>> seq_relationship_logits = outputs.seq_relationship_logits
""" | Fix typo in the example of MobileBertForPreTraining (#<I>) | huggingface_pytorch-pretrained-BERT | train | py |
eeecf155fcb049e67646f8dab521b898f8723f2a | diff --git a/spec_test.go b/spec_test.go
index <HASH>..<HASH> 100644
--- a/spec_test.go
+++ b/spec_test.go
@@ -263,3 +263,12 @@ func getTimeTZ(value string) time.Time {
return t
}
+
+// https://github.com/robfig/cron/issues/144
+func TestSlash0NoHang(t *testing.T) {
+ schedule := "TZ=America/New_York 15/0 * * * *"
+ _, err := ParseStandard(schedule)
+ if err == nil {
+ t.Error("expected an error on 0 increment")
+ }
+} | spec_test.go: ensure an error is returned on 0 increment
Fixes issue #<I> | robfig_cron | train | go |
cb34b30e4b28d1fbcc83645119aa95bfac8009b8 | diff --git a/src/ol/tilegrid/TileGrid.js b/src/ol/tilegrid/TileGrid.js
index <HASH>..<HASH> 100644
--- a/src/ol/tilegrid/TileGrid.js
+++ b/src/ol/tilegrid/TileGrid.js
@@ -634,9 +634,18 @@ class TileGrid {
/**
* @param {number} resolution Resolution.
- * @param {number} [opt_direction] If 0, the nearest resolution will be used.
- * If 1, the nearest lower resolution will be used. If -1, the nearest
- * higher resolution will be used. Default is 0.
+ * @param {number|import("../array.js").NearestDirectionFunction} [opt_direction]
+ * If 0, the nearest resolution will be used.
+ * If 1, the nearest higher resolution (lower Z) will be used. If -1, the
+ * nearest lower resolution (higher Z) will be used. Default is 0.
+ * Use a {@link module:ol/array~NearestDirectionFunction} for more precise control.
+ *
+ * For example to change tile Z at the midpoint of zoom levels
+ * ```js
+ * function(value, high, low) {
+ * return value - low * Math.sqrt(high / low);
+ * }
+ * ```
* @return {number} Z.
* @api
*/ | Update description for getZForResolution direction | openlayers_openlayers | train | js |
103e3fd2686252d8f13dbc3f70328a59a1f6c794 | diff --git a/presto-main/src/main/java/com/facebook/presto/operator/scalar/annotations/ScalarImplementation.java b/presto-main/src/main/java/com/facebook/presto/operator/scalar/annotations/ScalarImplementation.java
index <HASH>..<HASH> 100644
--- a/presto-main/src/main/java/com/facebook/presto/operator/scalar/annotations/ScalarImplementation.java
+++ b/presto-main/src/main/java/com/facebook/presto/operator/scalar/annotations/ScalarImplementation.java
@@ -46,6 +46,7 @@ import java.lang.invoke.MethodType;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
@@ -507,7 +508,9 @@ public class ScalarImplementation
return new OperatorImplementationDependency(
operator.operator(),
parseTypeSignature(operator.returnType()),
- asList(operator.argumentTypes()).stream().map(TypeSignature::parseTypeSignature).collect(toImmutableList()));
+ Arrays.stream(operator.argumentTypes())
+ .map(TypeSignature::parseTypeSignature)
+ .collect(toImmutableList()));
}
if (annotation instanceof LiteralParameter) {
return new LiteralImplementationDependency(((LiteralParameter) annotation).value()); | Fix warning in ScalarImplementation | prestodb_presto | train | java |
ab8c078bb8fa04bb828a0994ff476bbfef6211c9 | diff --git a/test/alg_none_verification_vows.py b/test/alg_none_verification_vows.py
index <HASH>..<HASH> 100644
--- a/test/alg_none_verification_vows.py
+++ b/test/alg_none_verification_vows.py
@@ -42,7 +42,8 @@ class AlgNoneVerification(Vows.Context):
expect([
'Verification failed for all signatures[\'Failed: [InvalidJWSSignature(\\\'Verification failed {InvalidSignature(\\\\\\\'The "none" signature cannot be verified\\\\\\\',)}\\\',)]\']',
'Verification failed for all signatures[\'Failed: [InvalidJWSSignature(\\\'Verification failed {InvalidSignature(\\\\\\\'The "none" signature cannot be verified\\\\\\\')}\\\')]\']',
- 'Verification failed for all signatures["Failed: [InvalidJWSSignature(\'Verification failed\')]"]' # python3 uses raise from and doesn't put reason in exception
+ 'Verification failed for all signatures["Failed: [InvalidJWSSignature(\'Verification failed\')]"]', # python3 uses raise from and doesn't put reason in exception
+ 'Verification failed for all signatures["Failed: [InvalidJWSSignature(\'Verification failed\',)]"]'
]).to_include(str(r))
class VerifyJWTPublicKeyNoneNotAllowed(Vows.Context): | Cope with commas in error string | davedoesdev_python-jwt | train | py |
297b74d527861f2133e0ff92bf41de5e3b902038 | diff --git a/tests/framework/i18n/FormatterTest.php b/tests/framework/i18n/FormatterTest.php
index <HASH>..<HASH> 100644
--- a/tests/framework/i18n/FormatterTest.php
+++ b/tests/framework/i18n/FormatterTest.php
@@ -327,10 +327,20 @@ class FormatterTest extends TestCase
protected function ensureIntlUnitDataAvailable()
{
+ $skip = function () {
+ $this->markTestSkipped('ICU data does not contain measure units information.');
+ };
+
try {
- new \ResourceBundle($this->formatter->locale, 'ICUDATA-unit');
+ $bundle = new \ResourceBundle($this->formatter->locale, 'ICUDATA-unit');
+ $massUnits = $bundle['units']['mass'];
+ $lengthUnits = $bundle['units']['length'];
+
+ if ($massUnits === null || $lengthUnits === null) {
+ $skip();
+ }
} catch (\IntlException $e) {
- $this->markTestSkipped('ICU data does not contain measure units information.');
+ $skip();
}
}
} | One more try to fix tests on Travis | yiisoft_yii-core | train | php |
7440391f1c5e31164880841dd72e70f872603855 | diff --git a/firecloud/__about__.py b/firecloud/__about__.py
index <HASH>..<HASH> 100644
--- a/firecloud/__about__.py
+++ b/firecloud/__about__.py
@@ -1,2 +1,2 @@
# Package version
-__version__ = "0.16.7"
+__version__ = "0.16.8" | Post-release version bump
Ensure dev version is ahead of latest release | broadinstitute_fiss | train | py |
235e7f99dd6d6c8ade0f499b12fba14c28a015f5 | diff --git a/server/client.go b/server/client.go
index <HASH>..<HASH> 100644
--- a/server/client.go
+++ b/server/client.go
@@ -721,10 +721,11 @@ func (c *client) readLoop() {
// Budget to spend in place flushing outbound data.
// Client will be checked on several fronts to see
- // if applicable. Routes will never wait in place.
- budget := time.Millisecond
- if c.kind == ROUTER {
- budget = 0
+ // if applicable. Routes and Gateways will never
+ // wait in place.
+ var budget time.Duration
+ if c.kind == CLIENT {
+ budget = time.Millisecond
}
// Check pending clients for flush. | Fixed use of flush budget for connections other than ROUTER
Need to be explicit about the connection type to apply the budget to. | nats-io_gnatsd | train | go |
ea0871e869748032b7ba534d2b213f83b399c4a9 | diff --git a/src/com/xtremelabs/droidsugar/view/FakeView.java b/src/com/xtremelabs/droidsugar/view/FakeView.java
index <HASH>..<HASH> 100644
--- a/src/com/xtremelabs/droidsugar/view/FakeView.java
+++ b/src/com/xtremelabs/droidsugar/view/FakeView.java
@@ -59,8 +59,11 @@ public class FakeView {
public void addView(View child) {
children.add(child);
- FakeView childProxy = (FakeView) ProxyDelegatingHandler.getInstance().proxyFor(child);
- childProxy.parent = this;
+ childProxy(child).parent = this;
+ }
+
+ private FakeView childProxy(View child) {
+ return (FakeView) ProxyDelegatingHandler.getInstance().proxyFor(child);
}
public int getChildCount() {
@@ -71,6 +74,13 @@ public class FakeView {
return children.get(index);
}
+ public void removeAllViews() {
+ for (View child : children) {
+ childProxy(child).parent = null;
+ }
+ children.clear();
+ }
+
public final Context getContext() {
return context;
} | Created ContextAreaBuilder to encapsulate access to action pane. | robolectric_robolectric | train | java |
2326f53ae2ba7769a99e07d76acc32b0558bab24 | diff --git a/hazelcast-sql/src/test/java/com/hazelcast/sql/SqlBasicTest.java b/hazelcast-sql/src/test/java/com/hazelcast/sql/SqlBasicTest.java
index <HASH>..<HASH> 100644
--- a/hazelcast-sql/src/test/java/com/hazelcast/sql/SqlBasicTest.java
+++ b/hazelcast-sql/src/test/java/com/hazelcast/sql/SqlBasicTest.java
@@ -71,6 +71,7 @@ import java.util.Set;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
/**
* Test that covers basic column read operations through SQL.
@@ -185,7 +186,7 @@ public class SqlBasicTest extends SqlTestSupport {
assertEquals(rowMetadata, res.getRowMetadata());
Long key0 = row.getObject(rowMetadata.findColumn(adjustFieldName("key")));
- assert key0 != null;
+ assertNotNull(key0);
AbstractPojoKey key = key(key0);
AbstractPojo val = map.get(key); | Minor change to SqlBasicTest. | hazelcast_hazelcast | train | java |
009467ec9e0033c47724b15dd0e775c4fe696522 | diff --git a/src/modules/core/index.js b/src/modules/core/index.js
index <HASH>..<HASH> 100644
--- a/src/modules/core/index.js
+++ b/src/modules/core/index.js
@@ -6,8 +6,7 @@ var passThrough = require('../pass-through');
var capitalize = require('capitalize');
-module.exports = function() {
-
+module.exports = function(opts) {
var grid = {};
// the order here matters because some of these depend on each other
@@ -28,7 +27,9 @@ module.exports = function() {
grid.navigationModel = require('../navigation-model')(grid);
grid.pixelScrollModel = require('../pixel-scroll-model')(grid);
grid.colResize = require('../col-resize')(grid);
- grid.colReorder = require('../col-reorder')(grid);
+ if (!(opts && opts.col && opts.col.disableReorder)) {
+ grid.colReorder = require('../col-reorder')(grid);
+ }
grid.showHiddenCols = require('../show-hidden-cols')(grid);
grid.copyPaste = require('../copy-paste')(grid);
@@ -346,4 +347,4 @@ module.exports = function() {
grid.textarea = createFocusTextArea();
return grid;
-};
\ No newline at end of file
+}; | make col reordering an option | gridgrid_grid | train | js |
5afc82de6e617f8613577401b0e9e612703b97b6 | diff --git a/p2p/peer_error.go b/p2p/peer_error.go
index <HASH>..<HASH> 100644
--- a/p2p/peer_error.go
+++ b/p2p/peer_error.go
@@ -89,7 +89,7 @@ var discReasonToString = [...]string{
}
func (d DiscReason) String() string {
- if len(discReasonToString) < int(d) {
+ if len(discReasonToString) <= int(d) {
return fmt.Sprintf("unknown disconnect reason %d", d)
}
return discReasonToString[d] | p2p: fix array out of bounds issue (#<I>) | ethereum_go-ethereum | 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.