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 |
|---|---|---|---|---|---|
11a4c829eb81f895f3b19b892e002071b8608316 | diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/PermissionTemplateService.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/PermissionTemplateService.java
index <HASH>..<HASH> 100644
--- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/PermissionTemplateService.java
+++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/PermissionTemplateService.java
@@ -154,7 +154,7 @@ public class PermissionTemplateService {
.setRole(gp.getPermission())
.setComponentUuid(project.uuid())
.setComponentName(project.name());
- dbClient.groupPermissionDao().insert(dbSession, dto, null, template);
+ dbClient.groupPermissionDao().insert(dbSession, dto, project, template);
});
List<PermissionTemplateCharacteristicDto> characteristics = dbClient.permissionTemplateCharacteristicDao().selectByTemplateUuids(dbSession, singletonList(template.getUuid())); | SONAR-<I> fixing a bug where sometimes we didnt pass information about component key to the audit table | SonarSource_sonarqube | train | java |
1e9ccac8e8a3a33f1ed3ba1be7de870e45091ede | diff --git a/pyinfra/api/util.py b/pyinfra/api/util.py
index <HASH>..<HASH> 100644
--- a/pyinfra/api/util.py
+++ b/pyinfra/api/util.py
@@ -322,6 +322,10 @@ def make_hash(obj):
ID's for operations based on their name & arguments.
'''
+ # pyinfra attr key where available (host/inventory data), see attrs.py
+ if isinstance(obj, AttrBase):
+ return obj.pyinfra_attr_key
+
if isinstance(obj, (set, tuple, list)):
hash_string = ''.join([make_hash(e) for e in obj])
@@ -333,8 +337,9 @@ def make_hash(obj):
else:
hash_string = (
- # pyinfra attr key where available (host/inventory data), see attrs.py
- obj.pyinfra_attr_key if isinstance(obj, AttrBase)
+ # Constants - the values can change between hosts but we should still
+ # group them under the same operation hash.
+ '' if obj in (True, False, None)
# Plain strings
else obj if isinstance(obj, six.string_types)
# Objects with __name__s | Has True/False/None constants as the same when hashing operation arguments, so they can be different values between hosts (ie conditionals). | Fizzadar_pyinfra | train | py |
2004f422c224547315937eb35a2cbbca779ec9e8 | diff --git a/src/log.js b/src/log.js
index <HASH>..<HASH> 100644
--- a/src/log.js
+++ b/src/log.js
@@ -110,7 +110,7 @@ const prepareInternalPlainLogLine = function (message, data, level, exception) {
if (exception) exception = limitDepth(exception, MAX_DEPTH);
return exception
- ? `${line}\n${JSON.stringify(exception)}`
+ ? `${line}\n ${exception.stack || exception}`
: line;
}; | Better logging of exceptions in text mode | apifytech_apify-shared-js | train | js |
7ef1d37730997a06386670c343782e55fe4c029f | diff --git a/core/src/main/java/hudson/tasks/junit/History.java b/core/src/main/java/hudson/tasks/junit/History.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/hudson/tasks/junit/History.java
+++ b/core/src/main/java/hudson/tasks/junit/History.java
@@ -228,8 +228,8 @@ public class History {
}
};
plot.setRenderer(ar);
- ar.setSeriesPaint(0,ColorPalette.RED); // Failures.
- ar.setSeriesPaint(1,ColorPalette.YELLOW); // Skips.
+ ar.setSeriesPaint(0,ColorPalette.YELLOW); // Skips.
+ ar.setSeriesPaint(1,ColorPalette.RED); // Failures.
ar.setSeriesPaint(2,ColorPalette.BLUE); // Total.
// crop extra space around the graph | [JENKINS-<I>] - Fix failed tests displaying as Yellow on "History for Test Results" page.
The colours where added in a different order to the data, resulting in failed tests displying as yellow and skipped tests displaying as red. | jenkinsci_jenkins | train | java |
6261b9bbc12020f1e43acdbb1b9397baf54b0d78 | diff --git a/core/DataTable/Renderer/Console.php b/core/DataTable/Renderer/Console.php
index <HASH>..<HASH> 100644
--- a/core/DataTable/Renderer/Console.php
+++ b/core/DataTable/Renderer/Console.php
@@ -152,11 +152,13 @@ class Console extends Renderer
$metadata = $table->getAllTableMetadata();
if (!empty($metadata)) {
$output .= "<hr />Metadata<br />";
- foreach ($metadata as $id => $metadata) {
+ foreach ($metadata as $id => $metadataIn) {
$output .= "<br />";
$output .= $prefix . " <b>$id</b><br />";
- foreach ($metadata as $name => $value) {
- $output .= $prefix . $prefix . "$name => $value";
+ if(is_array($metadataIn)) {
+ foreach ($metadataIn as $name => $value) {
+ $output .= $prefix . $prefix . "$name => $value";
+ }
}
}
} | Fix error when metadata are objects and not array | matomo-org_matomo | train | php |
4bfafdd9a1f9dc2951152663e5dcc7ba5b4a0098 | diff --git a/src/UrlHandlers/UrlCapturedDataUrlHandler.php b/src/UrlHandlers/UrlCapturedDataUrlHandler.php
index <HASH>..<HASH> 100644
--- a/src/UrlHandlers/UrlCapturedDataUrlHandler.php
+++ b/src/UrlHandlers/UrlCapturedDataUrlHandler.php
@@ -36,6 +36,16 @@ class UrlCapturedDataUrlHandler extends ClassMappedUrlHandler
}
/**
+ * Returns the data captured by the handler.
+ *
+ * @return mixed
+ */
+ public function getCapturedData()
+ {
+ return $this->capturedData;
+ }
+
+ /**
* Should be implemented to return a true or false as to whether this handler supports the given request.
*
* Normally this involves testing the request URI. | UrlHandle added method to return getCapturedData | RhubarbPHP_Rhubarb | train | php |
125abe7415b65ca68e7812544d7c4064ffeeacdf | diff --git a/kademlia/routing.py b/kademlia/routing.py
index <HASH>..<HASH> 100644
--- a/kademlia/routing.py
+++ b/kademlia/routing.py
@@ -4,7 +4,7 @@ import operator
import asyncio
from collections import OrderedDict
-from kademlia.utils import OrderedSet, sharedPrefix
+from kademlia.utils import OrderedSet, sharedPrefix, bytesToBitString
class KBucket(object):
@@ -65,7 +65,7 @@ class KBucket(object):
return True
def depth(self):
- sp = sharedPrefix([n.id for n in self.nodes.values()])
+ sp = sharedPrefix([bytesToBitString(n.id) for n in self.nodes.values()])
return len(sp)
def head(self):
diff --git a/kademlia/utils.py b/kademlia/utils.py
index <HASH>..<HASH> 100644
--- a/kademlia/utils.py
+++ b/kademlia/utils.py
@@ -49,3 +49,8 @@ def sharedPrefix(args):
break
i += 1
return args[0][:i]
+
+
+def bytesToBitString(bytes):
+ bits = [bin(byte)[2:].rjust(8, '0') for byte in bytes]
+ return "".join(bits) | fix issue with bit prefix finding in sharedPrefix | bmuller_kademlia | train | py,py |
b35f282c7caa6e31bc65f21a6a973ab88cd052aa | diff --git a/lib/drp/emir/__init__.py b/lib/drp/emir/__init__.py
index <HASH>..<HASH> 100644
--- a/lib/drp/emir/__init__.py
+++ b/lib/drp/emir/__init__.py
@@ -22,3 +22,5 @@
from numina.core import drp_load
__numina_drp__ = drp_load('emir', 'drp.yaml')
+
+__numina_store__ = {'default': 'emir.store'}
\ No newline at end of file | Publish the dictionary of store backends | guaix-ucm_pyemir | train | py |
610ea0a3bf269584ef10dd173562a3b98d0eea9f | diff --git a/lib/ohai/plugins/windows/network.rb b/lib/ohai/plugins/windows/network.rb
index <HASH>..<HASH> 100644
--- a/lib/ohai/plugins/windows/network.rb
+++ b/lib/ohai/plugins/windows/network.rb
@@ -65,6 +65,7 @@ iface_instance.keys.each do |i|
if _ip.ipv6?
# inet6 address
iface[cint][:addresses][ip][:family] = "inet6"
+ iface[cint][:addresses][ip][:scope] = "Link" if ip =~ /^fe80/i
else
# should be an inet4 address
iface[cint][:addresses][ip][:netmask] = _ip.netmask.to_s | detecting link local scope for ipv6 | chef_ohai | train | rb |
5c8d21e16b4a9332d76c2084d8f220cb99825593 | diff --git a/pyvista/plotting/plotting.py b/pyvista/plotting/plotting.py
index <HASH>..<HASH> 100644
--- a/pyvista/plotting/plotting.py
+++ b/pyvista/plotting/plotting.py
@@ -1501,10 +1501,10 @@ class BasePlotter(PickingHelper, WidgetHelper):
if interpolate_before_map:
self.mapper.InterpolateScalarsBeforeMappingOn()
- actor, prop = self.add_actor(self.mapper,
- reset_camera=reset_camera,
- name=name, culling=culling,
- pickable=pickable)
+ actor = vtk.vtkActor()
+ prop = vtk.vtkProperty()
+ actor.SetMapper(self.mapper)
+ actor.SetProperty(prop)
# Make sure scalars is a numpy array after this point
original_scalar_name = None
@@ -1762,6 +1762,11 @@ class BasePlotter(PickingHelper, WidgetHelper):
if stitle is not None and show_scalar_bar and (not rgb or _custom_opac):
self.add_scalar_bar(stitle, **scalar_bar_args)
+ self.add_actor(actor,
+ reset_camera=reset_camera,
+ name=name, culling=culling,
+ pickable=pickable)
+
self.renderer.Modified()
return actor | Remove the temporary blue color on meshes when using add_mesh on large datasets (#<I>)
* Create actor in add_mesh after setting properties
* Add missing prop to actor | vtkiorg_vtki | train | py |
70dea450d881fc5692f503e925a404757fe7792b | diff --git a/faq-bundle/contao/ModuleFaq.php b/faq-bundle/contao/ModuleFaq.php
index <HASH>..<HASH> 100644
--- a/faq-bundle/contao/ModuleFaq.php
+++ b/faq-bundle/contao/ModuleFaq.php
@@ -73,7 +73,7 @@ class ModuleFaq extends Frontend
$arrProcessed[$objFaq->jumpTo] = false;
// Get target page
- $objParent = $this->Database->prepare("SELECT id, alias FROM tl_page WHERE id=? AND (start='' OR start<$time) AND (stop='' OR stop>$time) AND published=1")
+ $objParent = $this->Database->prepare("SELECT id, alias FROM tl_page WHERE id=? AND (start='' OR start<$time) AND (stop='' OR stop>$time) AND published=1 AND noSearch!=1")
->limit(1)
->execute($objFaq->jumpTo); | [Faq] Unsearchable news/events being added to the sitemap (#<I>) | contao_contao | train | php |
87abb73eae07f62ee28f27c2c277262913064e8d | diff --git a/assembla/tests/assembla_tests.py b/assembla/tests/assembla_tests.py
index <HASH>..<HASH> 100644
--- a/assembla/tests/assembla_tests.py
+++ b/assembla/tests/assembla_tests.py
@@ -174,7 +174,10 @@ class TestAssembla(TestCase):
def test_api_space_filtering(self):
test_space = self.assembla.spaces()[-1]
- filtered_spaces = self.assembla.spaces(id=test_space.get('id'))
+ filtered_spaces = self.assembla.spaces(
+ id=test_space.get('id'),
+ name=test_space.get('name'),
+ )
self.assertEqual(len(filtered_spaces), 1)
for space in filtered_spaces:
self.assertEqual( | Expanded the filtering test cases to include multiple clauses. | markfinger_assembla | train | py |
609f5b3152c5c863ae206e0b6b9472ccb2e813d4 | diff --git a/playground/scripts/e2e.ios.js b/playground/scripts/e2e.ios.js
index <HASH>..<HASH> 100644
--- a/playground/scripts/e2e.ios.js
+++ b/playground/scripts/e2e.ios.js
@@ -16,6 +16,8 @@ function buildProjForDetox() {
shellUtils.exec.execSync(`./scripts/detoxDebugFix.rb ${release ? '' : 'debug'}`);
+ shellUtils.exec.execSync(`echo -en 'travis_fold:start:xcodebuild'`);
+
const cmd = `RCT_NO_LAUNCH_PACKAGER=true
cd ios && xcodebuild
-scheme ${scheme} build
@@ -28,6 +30,8 @@ function buildProjForDetox() {
} else {
shellUtils.exec.execSync(`${cmd}`);
}
+
+ shellUtils.exec.execSync(`echo -en 'travis_fold:end:xcodebuild'`);
}
function hasXcpretty() {
try { | travis fold xcodebuild | wix_react-native-navigation | train | js |
d1f40533211e530bc2c301a3ebbd2d16c430e600 | diff --git a/insteonplm/ipdb.py b/insteonplm/ipdb.py
index <HASH>..<HASH> 100644
--- a/insteonplm/ipdb.py
+++ b/insteonplm/ipdb.py
@@ -69,7 +69,8 @@ class IPDB(object):
Product(0x07, 0x00, None, 'I/O Linc', '2450', ['switch', 'binary_sensor', 'relay']),
- Product(0x09, 0x0a, None, '240v Load Controler', '2477SA1', ['switch']),
+ Product(0x09, 0x0a, None, '220/240V 30A Load Controller NO', '2477SA1', ['switch']),
+ Product(0x09, 0x0b, None, '220/240V 30A Load Controller NC', '2477SA2', ['switch']),
Product(0x10, 0x01, None, 'Motion Sensor', '2842-222', ['binary_sensor']),
Product(0x10, 0x02, None, 'TriggerLinc', '2421', ['binary_sensor']), | Added <I>v Load Controler NC (<I>SA2) | nugget_python-insteonplm | train | py |
86cc13ce39047db2d4019b0bfccf6c16e696db56 | diff --git a/tests/regression/issue60Test.php b/tests/regression/issue60Test.php
index <HASH>..<HASH> 100644
--- a/tests/regression/issue60Test.php
+++ b/tests/regression/issue60Test.php
@@ -15,4 +15,13 @@ class issue60Test extends TestCase
$this->assertEquals(0.05005, $value->div($divisor)->asFloat());
$this->assertEquals(0.000434077479319, $value->log10()->asFloat());
}
+
+ public function test_that_fromFloat_less_than_1_still_correct()
+ {
+ $value = Decimal::fromFloat(0.175);
+ $divisor = Decimal::fromFloat(20);
+
+ $this->assertEquals(0.009, $value->div($divisor)->asFloat());
+ $this->assertEquals(-0.7569, $value->log10()->asFloat());
+ }
} | ISSUE-<I>: Added extra test to verify log<I> for numbers between 0 - 1 | Litipk_php-bignumbers | train | php |
c8174db52dab1daef2b8dc22a591b890b54f98f5 | diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -1152,7 +1152,7 @@ class Chef
action = action.to_sym
new_action_provider_class.action(action, &recipe_block)
self.allowed_actions += [ action ]
- default_action action if default_action == [:nothing]
+ default_action action if Array(default_action) == [:nothing]
end
# | Be paranoid about potential weird overrides of default_action.
Always compare them as arrays, just in case. | chef_chef | train | rb |
aa82ffef0cb23515c3b51aff93ba5eca74f9b8f5 | diff --git a/blargg/models.py b/blargg/models.py
index <HASH>..<HASH> 100644
--- a/blargg/models.py
+++ b/blargg/models.py
@@ -149,7 +149,7 @@ class Entry(models.Model):
appear "Published", and send the ``entry_published`` signal."""
self.published = True
self.published_on = utc_now()
- entry_published.send(sender=self, entry=self)
+ return True
def save(self, *args, **kwargs):
"""Auto-generate a slug from the name."""
@@ -161,11 +161,16 @@ class Entry(models.Model):
# NOTE: if this is unpublished, and then republished, this method won't
# get called; e.g. the date won't get changed and the
# ``entry_published`` signal won't get re-sent.
+ send_published_signal = False
if self.published and self.published_on is None:
- self._set_published()
+ send_published_signal = self._set_published()
super(Entry, self).save(*args, **kwargs)
+ # We need an ID before we can send this signal.
+ if send_published_signal:
+ entry_published.send(sender=self, entry=self)
+
def get_absolute_url(self):
"""URL based on the entry's slug."""
return reverse('entry_detail', args=[self.slug]) | need an id prior to sending signals | bradmontgomery_django-blargg | train | py |
92499c86bc7fcc4c7b7d5de838973868a5e0aba2 | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -6,7 +6,6 @@ dir = File.expand_path(File.dirname(__FILE__))
$LOAD_PATH.unshift("#{dir}/")
$LOAD_PATH.unshift("#{dir}/lib") # a spec-specific test lib dir
$LOAD_PATH.unshift("#{dir}/../lib")
-$LOAD_PATH.unshift("#{dir}/../test/lib")
# Don't want puppet getting the command line arguments for rake or autotest
ARGV.clear
@@ -20,9 +19,6 @@ module PuppetSpec
FIXTURE_DIR = File.join(dir = File.expand_path(File.dirname(__FILE__)), "fixtures") unless defined?(FIXTURE_DIR)
end
-module PuppetTest
-end
-
require 'lib/puppet_spec/files'
require 'lib/puppet_spec/fixtures'
require 'monkey_patches/alias_should_to_must' | (#<I>) Eliminate the last vestige of the unit tests from the specs.
This eliminates a stub module in spec_helper, which was used for compatibility
with code that didn't bother to require the right files out of the unit tests.
It also removes test/lib from LOAD_PATH when running specs, since we don't run
with that code, and now we detect that as a larger scale test failure. | puppetlabs_puppet | train | rb |
d03337ac180534cfae16c293762c93c324f93060 | diff --git a/rules-java/tests/src/test/java/org/jboss/windup/rules/java/ip/DiscoverHardcodedIPAddressTest.java b/rules-java/tests/src/test/java/org/jboss/windup/rules/java/ip/DiscoverHardcodedIPAddressTest.java
index <HASH>..<HASH> 100644
--- a/rules-java/tests/src/test/java/org/jboss/windup/rules/java/ip/DiscoverHardcodedIPAddressTest.java
+++ b/rules-java/tests/src/test/java/org/jboss/windup/rules/java/ip/DiscoverHardcodedIPAddressTest.java
@@ -100,7 +100,7 @@ public class DiscoverHardcodedIPAddressTest
int numberFound = 0;
for (InlineHintModel hint : service.findAll())
{
- if (StringUtils.equals("Hard-coded IP Address Detected", hint.getTitle()))
+ if (StringUtils.equals("Hard-coded IP Address", hint.getTitle()))
{
Matcher matcher = ipExtractor.matcher(hint.getHint());
if (matcher.find()) | T<I> Hardcoded IP cloud-mandatory: fixed tests in rules-java too | windup_windup | train | java |
6723cd03643ad24b98a8897b9bee4909c873c49e | diff --git a/allauth/socialaccount/providers/github/views.py b/allauth/socialaccount/providers/github/views.py
index <HASH>..<HASH> 100644
--- a/allauth/socialaccount/providers/github/views.py
+++ b/allauth/socialaccount/providers/github/views.py
@@ -4,6 +4,7 @@ from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter,
OAuth2LoginView,
OAuth2CallbackView)
from .provider import GitHubProvider
+from allauth.socialaccount import app_settings
class GitHubOAuth2Adapter(OAuth2Adapter):
@@ -17,7 +18,7 @@ class GitHubOAuth2Adapter(OAuth2Adapter):
resp = requests.get(self.profile_url,
params={'access_token': token.token})
extra_data = resp.json()
- if not extra_data.get('email'):
+ if app_settings.QUERY_EMAIL and not extra_data.get('email'):
extra_data['email'] = self.get_email(token)
return self.get_provider().sociallogin_from_response(request,
extra_data) | Getting github's email only if SOCIALACCOUNT_QUERY_EMAIL is true | pennersr_django-allauth | train | py |
3dfbdd6dfeb01f464e3acf8f3529987ba6959bbe | diff --git a/src/Services/PaymentInfo.php b/src/Services/PaymentInfo.php
index <HASH>..<HASH> 100644
--- a/src/Services/PaymentInfo.php
+++ b/src/Services/PaymentInfo.php
@@ -40,6 +40,11 @@ class PaymentInfo extends HttpService
try {
$this->switchMode($isSandbox);
$response = $this->client->paymentInfo($adapter->transform());
+
+ //PHP 5.4
+ } catch(Exception $e) {
+ throw $e;
+
} finally {
$this->switchMode(null);
} | Added old php compatibility code | ebanx_benjamin | train | php |
8419f6b1beb5932241ef9af19fe8d88bbadd4d22 | diff --git a/packages/vaex-core/vaex/expression.py b/packages/vaex-core/vaex/expression.py
index <HASH>..<HASH> 100644
--- a/packages/vaex-core/vaex/expression.py
+++ b/packages/vaex-core/vaex/expression.py
@@ -55,7 +55,7 @@ class Meta(type):
if isinstance(b, Expression):
assert b.ds == a.ds
b = b.expression
- expression = '({0}) {1} ({2})'.format(a.expression, op['code'], b)
+ expression = '({0} {1} {2})'.format(a.expression, op['code'], b)
return Expression(self.ds, expression=expression)
attrs['__%s__' % op['name']] = f
if op['name'] in reversable:
@@ -65,7 +65,7 @@ class Meta(type):
if isinstance(b, Expression):
assert b.ds == a.ds
b = b.expression
- expression = '({2}) {1} ({0})'.format(a.expression, op['code'], b)
+ expression = '({2} {1} {0})'.format(a.expression, op['code'], b)
return Expression(self.ds, expression=expression)
attrs['__r%s__' % op['name']] = f | slightly better default representation for expressions, less parenthesis | vaexio_vaex | train | py |
fade32c2dc7d744bb7912232083c34bdeefc9943 | diff --git a/src/Domain/Generic/Model.php b/src/Domain/Generic/Model.php
index <HASH>..<HASH> 100644
--- a/src/Domain/Generic/Model.php
+++ b/src/Domain/Generic/Model.php
@@ -32,7 +32,7 @@ abstract class Model implements ModelInterface
{
$class = $this->getIdClass();
- return $class($this->id);
+ return new $class($this->id);
} | Corrected ModelId instantiation | cubicmushroom_hexagonal-components | train | php |
1bfc0d043f750e4d5ed42a2406db76df4d2aefee | diff --git a/update.php b/update.php
index <HASH>..<HASH> 100644
--- a/update.php
+++ b/update.php
@@ -92,6 +92,11 @@
## Build is no longer used
unset($settings['symphony']['build']);
+ ## Set the default language
+ if(!isset($settings['symphony']['lang'])){
+ $settings['symphony']['lang'] = 'en';
+ }
+
if(writeConfig(DOCROOT . '/manifest', $settings, $settings['file']['write_mode']) === true){
// build a Frontend page instance to initialise database | Updater will set default language in config if it isnt set already | symphonycms_symphony-2 | train | php |
f8813bed5e035a4b7f3deba54949439e846c8125 | diff --git a/ez_setup.py b/ez_setup.py
index <HASH>..<HASH> 100644
--- a/ez_setup.py
+++ b/ez_setup.py
@@ -30,7 +30,7 @@ try:
except ImportError:
USER_SITE = None
-DEFAULT_VERSION = "12.3"
+DEFAULT_VERSION = "12.4"
DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/"
diff --git a/setuptools/version.py b/setuptools/version.py
index <HASH>..<HASH> 100644
--- a/setuptools/version.py
+++ b/setuptools/version.py
@@ -1 +1 @@
-__version__ = '12.3'
+__version__ = '12.4' | Bumped to <I> in preparation for next release. | pypa_setuptools | train | py,py |
d1597160cdcab2fc401094c194bfb283ddfd5653 | diff --git a/Main.py b/Main.py
index <HASH>..<HASH> 100755
--- a/Main.py
+++ b/Main.py
@@ -8,6 +8,7 @@ import sys
import Config
import Filter
from PrettyPrinter import pretty_print
+from Recurrence import advance_recurring_todo
from RelativeDate import relative_date_to_date
import Sorter
import TodoFile
@@ -174,11 +175,18 @@ class Application(object):
self.todolist.todo(child).set_completed()
self.print_todo(child)
+ def handle_recurrence(todo):
+ if todo.has_tag('rec'):
+ new_todo = advance_recurring_todo(todo)
+ self.todolist.add_todo(new_todo)
+ self.print_todo(self.todolist.count())
+
number = convert_number(argument(2))
todo = self.todolist.todo(number)
if todo and not todo.is_completed():
complete_children(number)
+ handle_recurrence(todo)
todo.set_completed()
self.print_todo(number) | Handle recurrence when completing a task. | bram85_topydo | train | py |
36ca121874525336fe7dd678cfe2d8576de9d7ee | diff --git a/lib/puppetdb_query/version.rb b/lib/puppetdb_query/version.rb
index <HASH>..<HASH> 100644
--- a/lib/puppetdb_query/version.rb
+++ b/lib/puppetdb_query/version.rb
@@ -1,3 +1,3 @@
module PuppetDBQuery
- VERSION = "0.0.29".freeze
+ VERSION = "0.0.30".freeze
end | m<I>'s version bumper | m-31_puppetdb_query | train | rb |
e202b41522cfc23b2723cfb8e65bc4d6073d8112 | diff --git a/salt/grains/core.py b/salt/grains/core.py
index <HASH>..<HASH> 100644
--- a/salt/grains/core.py
+++ b/salt/grains/core.py
@@ -1679,7 +1679,9 @@ def os_data():
grains['lsb_distrib_codename'] = codename
if 'CPE_NAME' in os_release:
cpe = _parse_cpe_name(os_release['CPE_NAME'])
- if cpe['vendor'].lower() in ['suse', 'opensuse']:
+ if not cpe:
+ log.error('Broken CPE_NAME format in /etc/os-release!')
+ elif cpe.get('vendor', '').lower() in ['suse', 'opensuse']:
grains['os'] = "SUSE"
# openSUSE `osfullname` grain normalization
if os_release.get("NAME") == "openSUSE Leap": | Prevent possible crash if CPE_NAME is wrongly written in the distro | saltstack_salt | train | py |
6ca92de1633069aee25df9a4bdf42dd6ba516897 | diff --git a/test/specs/real-world/fetch-api-list.js b/test/specs/real-world/fetch-api-list.js
index <HASH>..<HASH> 100644
--- a/test/specs/real-world/fetch-api-list.js
+++ b/test/specs/real-world/fetch-api-list.js
@@ -37,6 +37,10 @@ function deleteProblematicAPIs (apis) {
delete apis["docusign.net"];
delete apis["kubernetes.io"];
delete apis["microsoft.com:graph"];
+
+ // hangs
+ delete apis["presalytics.io:ooxml"]
+
}
/** | Skip real work api that hangs during validate | APIDevTools_swagger-parser | train | js |
c4e071a7d5e1575eb6695dea70c0d166fcc1cce7 | diff --git a/lib/data_mapper/relation/aliases/index.rb b/lib/data_mapper/relation/aliases/index.rb
index <HASH>..<HASH> 100644
--- a/lib/data_mapper/relation/aliases/index.rb
+++ b/lib/data_mapper/relation/aliases/index.rb
@@ -116,14 +116,14 @@ module DataMapper
def renamed_entries(aliases)
aliases.each_with_object(entries.dup) { |(from, to), renamed|
- original_attributes(from).each do |original, current|
- renamed[original] = Attribute.build(to, current.prefix)
+ original_attributes(from).each do |original|
+ renamed[original] = Attribute.build(to, original.prefix)
end
}
end
def original_attributes(field)
- Hash[entries.select { |original, current| current.field == field }]
+ Hash[entries.select { |original, current| current.field == field }].keys
end
def assert_valid_relation_aliases(index, aliases) | Simplify private Aliases::Index#renamed_entries | rom-rb_rom | train | rb |
141c0993d41b8908ba9d53efacfecba4ab4001e8 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -24,8 +24,8 @@ setup(
'pygsp.pointclouds', 'pygsp.tests'],
package_data={'pygsp.pointclouds': ['misc/*.mat']},
test_suite='pygsp.tests.test_all.suite',
- dependency_links=['git+https://github.com/pyqtgraph/pyqtgraph@develop#egg=pyqtgraph-dev'],
- install_requires=['numpy', 'scipy', 'pyopengl', 'pyqtgraph==dev',
+ dependency_links=['https://github.com/pyqtgraph/pyqtgraph@develop#egg=pyqtgraph-0.10.1fork'],
+ install_requires=['numpy', 'scipy', 'pyopengl', 'pyqtgraph<=0.10.1',
'matplotlib==1.4.3' if sys.version_info.major == 3 and sys.version_info.minor < 4 else 'matplotlib',
'PyQt5' if sys.version_info.major == 3 and sys.version_info.minor == 5 else 'PySide'],
license="BSD", | Fix dependency of pyqtgraph | epfl-lts2_pygsp | train | py |
a5346ac07d016d9432668424d1e3a2ded27ec4c7 | diff --git a/grimoire_elk/raw/git.py b/grimoire_elk/raw/git.py
index <HASH>..<HASH> 100644
--- a/grimoire_elk/raw/git.py
+++ b/grimoire_elk/raw/git.py
@@ -22,6 +22,7 @@
from .elastic import ElasticOcean
from ..elastic_mapping import Mapping as BaseMapping
from ..identities.git import GitIdentities
+from ..enriched.utils import anonymize_url
class Mapping(BaseMapping):
@@ -61,6 +62,9 @@ class GitOcean(ElasticOcean):
mapping = Mapping
identities = GitIdentities
+ def _fix_item(self, item):
+ item['origin'] = anonymize_url(item['origin'])
+
@classmethod
def get_perceval_params_from_url(cls, url):
params = [] | [raw-git] Remove credentials from origin
This code redefines the method _fix_item
for the git raw data in order to remove
credentials that may appear in the origin.
This change is needed to prevent storing
the credentials to access git private repos
in the raw index. | chaoss_grimoirelab-elk | train | py |
b44462996f1b72093595a282b31bb1fd24d28881 | diff --git a/lib/serve.js b/lib/serve.js
index <HASH>..<HASH> 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -213,7 +213,7 @@ function sendHtml(res) {
}
function addFiles(content) {
- return content.replace('>', '>' + injectedCss) + injectedJs + injectedSocket
+ return content.replace('>', '>' + injectedCss + injectedSocket) + injectedJs
}
function html(title) { | Inject wright hook at top | porsager_wright | train | js |
6137e6b13d2276ad043da248076c683ab81623a6 | diff --git a/logger.go b/logger.go
index <HASH>..<HASH> 100644
--- a/logger.go
+++ b/logger.go
@@ -61,7 +61,7 @@ func (mw *MutexWrap) Disable() {
// var log = &logrus.Logger{
// Out: os.Stderr,
// Formatter: new(logrus.JSONFormatter),
-// Hooks: make(LevelHooks),
+// Hooks: make(logrus.LevelHooks),
// Level: logrus.DebugLevel,
// }
// | Fix typo in docs for New() | sirupsen_logrus | train | go |
81817afbffa87bb532087cd6bc12c32e7f34f236 | diff --git a/lib/chef/win32/version.rb b/lib/chef/win32/version.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/win32/version.rb
+++ b/lib/chef/win32/version.rb
@@ -50,7 +50,7 @@ class Chef
WIN_VERSIONS = {
"Windows Server 2022" => { major: 10, minor: 0, callable: lambda { |product_type, suite_mask, build_number| product_type != VER_NT_WORKSTATION && build_number >= 20348 } },
- "Windows Server 2019" => { major: 10, minor: 0, callable: lambda { |product_type, suite_mask, build_number| product_type != VER_NT_WORKSTATION && build_number >= 17763 } },
+ "Windows Server 2019" => { major: 10, minor: 0, callable: lambda { |product_type, suite_mask, build_number| product_type != VER_NT_WORKSTATION && build_number >= 17763 && build_number < 20348 } },
"Windows 10" => { major: 10, minor: 0, callable: lambda { |product_type, suite_mask, build_number| product_type == VER_NT_WORKSTATION } },
"Windows Server 2016" => { major: 10, minor: 0, callable: lambda { |product_type, suite_mask, build_number| product_type != VER_NT_WORKSTATION && build_number <= 14393 } },
"Windows 8.1" => { major: 6, minor: 3, callable: lambda { |product_type, suite_mask, build_number| product_type == VER_NT_WORKSTATION } }, | CHEF<I> - Windows<I> - Version ceiling lib/chef/win<I>/version.rb
Update lib/chef/win<I>/version.rb - Add less than <I> build number
This was an oversight
Follow up to: <URL> | chef_chef | train | rb |
6b812a4a2ced994655f59a43dee16189b71ae808 | diff --git a/spec/dummy_app/db/migrate/00000000000006_devise_create_users.rb b/spec/dummy_app/db/migrate/00000000000006_devise_create_users.rb
index <HASH>..<HASH> 100644
--- a/spec/dummy_app/db/migrate/00000000000006_devise_create_users.rb
+++ b/spec/dummy_app/db/migrate/00000000000006_devise_create_users.rb
@@ -5,16 +5,12 @@ class DeviseCreateUsers < ActiveRecord::Migration
t.recoverable
t.rememberable
t.trackable
- # t.confirmable
- # t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
- # t.token_authenticatable
+ t.encryptable
t.timestamps
end
add_index :users, :email, :unique => true
add_index :users, :reset_password_token, :unique => true
- # add_index :users, :confirmation_token, :unique => true
- # add_index :users, :unlock_token, :unique => true
end
def self.down | Add encryptable to old migration | sferik_rails_admin | train | rb |
5179748fb717649e6922b0678c81e9a449284f9f | diff --git a/django_tablib/base.py b/django_tablib/base.py
index <HASH>..<HASH> 100644
--- a/django_tablib/base.py
+++ b/django_tablib/base.py
@@ -24,7 +24,7 @@ class BaseDataset(tablib.Dataset):
if t is str:
return value
elif t in [datetime.date, datetime.datetime]:
- return date(value, 'SHORT_DATE_FORMAT')
+ return date(value, 'SHORT_DATE_FORMAT').encode("utf-8")
else:
return smart_unicode(value).encode('utf8') | Avoid UnicodeDecodeErrors caused by mixing UTF-8 text and Unicode strings | joshourisman_django-tablib | train | py |
12ccb1cd2d4d1ac3e813afca50278404ecb3c3b7 | diff --git a/src/ServiceProvider/LoggerServiceProvider.php b/src/ServiceProvider/LoggerServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/ServiceProvider/LoggerServiceProvider.php
+++ b/src/ServiceProvider/LoggerServiceProvider.php
@@ -11,6 +11,7 @@ namespace FastD\ServiceProvider;
use FastD\Container\Container;
use FastD\Container\ServiceProviderInterface;
+use Monolog\Formatter\LineFormatter;
use Monolog\Handler\AbstractHandler;
/**
@@ -32,7 +33,10 @@ class LoggerServiceProvider implements ServiceProviderInterface
$handle = new $handle($path.'/'.$name, $level);
}
if ($handle instanceof AbstractHandler) {
- null !== $format && $handle->setFormatter(is_string($format) ? new $format() : $format);
+ if (null === $format) {
+ $format = new LineFormatter();
+ }
+ $handle->setFormatter(is_string($format) ? new $format() : $format);
Logger()->pushHandler($handle);
}
} | fixed logger stream bug into ubuntu | fastdlabs_fastD | train | php |
99ab9c06b8c62147c2dada39b378053aa9cda049 | diff --git a/django_extensions/management/commands/runserver_plus.py b/django_extensions/management/commands/runserver_plus.py
index <HASH>..<HASH> 100644
--- a/django_extensions/management/commands/runserver_plus.py
+++ b/django_extensions/management/commands/runserver_plus.py
@@ -47,7 +47,10 @@ class Command(BaseCommand):
except ImportError:
USE_ADMINMEDIAHANDLER = False
- from django.core.handlers.wsgi import WSGIHandler
+ try:
+ from django.core.servers.basehttp import get_internal_wsgi_application as WSGIHandler
+ except ImportError:
+ from django.core.handlers.wsgi import WSGIHandler
try:
from werkzeug import run_simple, DebuggedApplication
except ImportError: | Django <I> WSGI_APPLICATION support
Django <I> adds a setting to specify the WSGI_APPLICATION. This allows
wsgi middlewares to be applied.
This patch use
django.core.servers.basehttp.get_internal_wsgi_application in order to
respect the setting. | django-extensions_django-extensions | train | py |
9e8f3c1925833eb0b576c3b0b9c19fc187e50edc | diff --git a/model/entity/thumbnail.php b/model/entity/thumbnail.php
index <HASH>..<HASH> 100644
--- a/model/entity/thumbnail.php
+++ b/model/entity/thumbnail.php
@@ -25,6 +25,17 @@ class ComFilesModelEntityThumbnail extends ComFilesModelEntityFile
parent::_initialize($config);
}
+ public function getHandle()
+ {
+ if ($version = $this->version) {
+ $handle = $version;
+ } else {
+ $handle = parent::getHandle();
+ }
+
+ return $handle;
+ }
+
public function setAdapter()
{
$this->_adapter = $this->getContainer()->getAdapter('file', array( | #<I> Override getHandle method so that version is used when supported | joomlatools_joomlatools-framework | train | php |
d8ab82a9b2f7c482cd49bb325e5f9973220b2aa4 | diff --git a/remi/gui.py b/remi/gui.py
index <HASH>..<HASH> 100644
--- a/remi/gui.py
+++ b/remi/gui.py
@@ -2253,7 +2253,7 @@ class SpinBox(Input):
js = 'var key = event.keyCode || event.charCode;'
js += 'return (event.charCode >= 48 && event.charCode <= 57)'
if allow_editing:
- js += ' || (key == 8 || key == 46)' # allow backspace and delete
+ js += ' || (key == 8 || key == 46 || key == 45|| key == 44 )' # allow backspace and delete and minus and coma
js += ' || (key == 13)' # allow enter
self.attributes[self.EVENT_ONKEYPRESS] = '%s;' % js
#FIXES Edge behaviour where onchange event not fires in case of key arrow Up or Down | BugFix SpinBox doesn't accept float numbers. | dddomodossola_remi | train | py |
9c7478840e2f0e376755c5251d5b08d502c59084 | diff --git a/lib/foundation_rails_helper/action_view_extension.rb b/lib/foundation_rails_helper/action_view_extension.rb
index <HASH>..<HASH> 100644
--- a/lib/foundation_rails_helper/action_view_extension.rb
+++ b/lib/foundation_rails_helper/action_view_extension.rb
@@ -2,14 +2,14 @@ module ActionView
module Helpers
module FormHelper
def form_for_with_foundation(record, options = {}, &block)
- options[:builder] = FoundationRailsHelper::FormBuilder
+ options[:builder] ||= FoundationRailsHelper::FormBuilder
options[:html] ||= {}
options[:html][:class] ||= 'nice'
form_for_without_foundation(record, options, &block)
end
def fields_for_with_foundation(record_name, record_object = nil, options = {}, &block)
- options[:builder] = FoundationRailsHelper::FormBuilder
+ options[:builder] ||= FoundationRailsHelper::FormBuilder
options[:html] ||= {}
options[:html][:class] ||= 'nice'
fields_for_without_foundation(record_name, record_object, options, &block)
diff --git a/lib/foundation_rails_helper/version.rb b/lib/foundation_rails_helper/version.rb
index <HASH>..<HASH> 100644
--- a/lib/foundation_rails_helper/version.rb
+++ b/lib/foundation_rails_helper/version.rb
@@ -1,3 +1,3 @@
module FoundationRailsHelper
- VERSION = "0.2"
+ VERSION = "0.3.alpha"
end | allows other form builder, just use foundation if nothing is set | sgruhier_foundation_rails_helper | train | rb,rb |
3fcb84e48fcce9e8f377b6787bd1cb06ea787a52 | diff --git a/src/chemcoord/cartesian_coordinates/xyz_functions.py b/src/chemcoord/cartesian_coordinates/xyz_functions.py
index <HASH>..<HASH> 100644
--- a/src/chemcoord/cartesian_coordinates/xyz_functions.py
+++ b/src/chemcoord/cartesian_coordinates/xyz_functions.py
@@ -107,7 +107,9 @@ def to_molden(cartesian_list, buf=None, sort_index=True,
+ '[GEOMETRIES] (XYZ)\n').format
values = len(cartesian_list) * '1\n'
- header = give_header(energy=values, max_force=values, rms_force=values)
+ energy = '\n'.join([m.metadata.get('energy', 1) for m in cartesian_list])
+
+ header = give_header(energy=energy, max_force=values, rms_force=values)
coordinates = [x.to_xyz(sort_index=sort_index, float_format=float_format)
for x in cartesian_list] | MAIN: to_molden now writes also energies | mcocdawc_chemcoord | train | py |
2aeceb8f18c621db2f215de604bcfe69745354ef | diff --git a/test/functional/signals.rb b/test/functional/signals.rb
index <HASH>..<HASH> 100644
--- a/test/functional/signals.rb
+++ b/test/functional/signals.rb
@@ -11,7 +11,7 @@
#
trap 'INT' do
- if $_dashboard
+ if $_dashboard && ! (ARGV.include?('-N') || ENV['NOISY'])
puts
puts '-' * 80
puts $_dashboard.context.logger.fancy_log | let's not output the fancy log twice | jmettraux_ruote | train | rb |
a972b423f3bc5d0d8524672d85d03ad14b9242d1 | diff --git a/netmiko/ssh_autodetect.py b/netmiko/ssh_autodetect.py
index <HASH>..<HASH> 100644
--- a/netmiko/ssh_autodetect.py
+++ b/netmiko/ssh_autodetect.py
@@ -180,6 +180,12 @@ SSH_MAPPER_DICT = {
"priority": 99,
"dispatch": "_autodetect_std",
},
+ "extreme_exos": {
+ "cmd": "show version",
+ "search_patterns": [r"ExtremeXOS"],
+ "priority": 99,
+ "dispatch": "_autodetect_std",
+ },
"extreme_netiron": {
"cmd": "show version",
"search_patterns": [r"(NetIron|MLX)"], | added extreme_exos to autodetect (#<I>) | ktbyers_netmiko | train | py |
b6831dc9e3889791405b373fe03cd13dc2458319 | diff --git a/src/js/components/Tiles.js b/src/js/components/Tiles.js
index <HASH>..<HASH> 100644
--- a/src/js/components/Tiles.js
+++ b/src/js/components/Tiles.js
@@ -143,7 +143,10 @@ export default class Tiles extends Component {
_announceTile (label) {
const { intl } = this.context;
const enterSelectMessage = Intl.getMessage(intl, 'Enter Select');
- announce(`${label} ${enterSelectMessage}`);
+ // avoid a long text to be read by the screen reader
+ const labelMessage = label.length > 15 ?
+ `${label.substring(0, 15)}...` : label;
+ announce(`${labelMessage} ${enterSelectMessage}`);
}
_onPreviousTile (event) {
@@ -230,8 +233,11 @@ export default class Tiles extends Component {
this._fireClick(rows[activeTile], event.shiftKey);
rows[activeTile].classList.remove(ACTIVE_CLASS);
const label = rows[activeTile].innerText;
+ // avoid a long text to be read by the screen reader
+ const labelMessage = label.length > 15 ?
+ `${label.substring(0, 15)}...` : label;
const selectedMessage = Intl.getMessage(intl, 'Selected');
- announce(`${label} ${selectedMessage}`);
+ announce(`${labelMessage} ${selectedMessage}`);
}
} | Tiles: added max length to the label text. | grommet_grommet | train | js |
db208252ed36ba19b447602322e6d5e86d3c8505 | diff --git a/live.js b/live.js
index <HASH>..<HASH> 100644
--- a/live.js
+++ b/live.js
@@ -3,6 +3,7 @@ var steal = require("@steal");
// This is a map of listeners, those who have registered reload callbacks.
loader._liveListeners = {};
+loader.liveReloadInstalled = true;
// A simple emitter
function E () { | Provide a flag on the loader to indicate that live-reload is running.
This adds a flag `liveReloadInstalled` on the loader object so that
plugins can detect that live-reload is running. | stealjs_live-reload | train | js |
96ae1ef6508bec7e5462709fef0f2e84e4d5bdef | diff --git a/src/main/java/net/malisis/core/util/MBlockState.java b/src/main/java/net/malisis/core/util/MBlockState.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/malisis/core/util/MBlockState.java
+++ b/src/main/java/net/malisis/core/util/MBlockState.java
@@ -213,10 +213,10 @@ public class MBlockState
if (nbt == null)
return null;
- Block block;
+ Block block = null;
if (nbt.hasKey(blockName, NBT.TAG_INT))
block = Block.getBlockById(nbt.getInteger(blockName));
- else
+ else if (nbt.hasKey(blockName))
block = Block.getBlockFromName(nbt.getString(blockName));
if (block == null) | Added extra check on nbt key presence | Ordinastie_MalisisCore | train | java |
6f0c39b62c565adf41f2f01347488d37b999dfb9 | diff --git a/fudge/__init__.py b/fudge/__init__.py
index <HASH>..<HASH> 100644
--- a/fudge/__init__.py
+++ b/fudge/__init__.py
@@ -192,11 +192,17 @@ class Fake(object):
def _guess_asn_from_file(self, frame):
if frame.f_code.co_filename:
if os.path.exists(frame.f_code.co_filename):
- f = open(frame.f_code.co_filename,'r')
- possible_asn = f.readlines()[frame.f_lineno-1]
- m = self._assignment.match(possible_asn)
- if m:
- return m.group('name')
+ cofile = open(frame.f_code.co_filename,'r')
+ try:
+ for ln, line in enumerate(cofile):
+ # I'm not sure why -1 is needed
+ if ln==frame.f_lineno-1:
+ possible_asn = line
+ m = self._assignment.match(possible_asn)
+ if m:
+ return m.group('name')
+ finally:
+ cofile.close()
def _guess_name(self):
if not hasattr(sys, '_getframe'): | slightly more efficient hunt/peck for assignment in code file | fudge-py_fudge | train | py |
579bc18742f2251237a1fa673d2dd09a981ebc2f | diff --git a/troposphere/autoscaling.py b/troposphere/autoscaling.py
index <HASH>..<HASH> 100644
--- a/troposphere/autoscaling.py
+++ b/troposphere/autoscaling.py
@@ -53,7 +53,7 @@ class AutoScalingGroup(AWSObject):
'LaunchConfigurationName': (basestring, True),
'LoadBalancerNames': (list, False),
'MaxSize': (positive_integer, True),
- 'MetricsCollection': (list, False),
+ 'MetricsCollection': ([MetricsCollection], False),
'MinSize': (positive_integer, True),
'NotificationConfiguration': (NotificationConfiguration, False),
'Tags': (list, False), # Although docs say these are required | Instead of just list for MetricsCollection, use [MetricsCollection] | cloudtools_troposphere | train | py |
486d6a555eff17db35341ec3d967c771e934fafb | diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/articles_controller.rb
+++ b/app/controllers/articles_controller.rb
@@ -11,7 +11,7 @@ class ArticlesController < ApplicationController
private
def messenger_data
- article_setting = ArticleSetting.find_by(subdomain: request.subdomains.first)
+ article_setting = ArticleSetting.find_by(subdomain: request.subdomains.join("."))
@app = article_setting.app
key = @app.encryption_key
@sessionless = params[:sessionless]
diff --git a/lib/subdomain_routes.rb b/lib/subdomain_routes.rb
index <HASH>..<HASH> 100644
--- a/lib/subdomain_routes.rb
+++ b/lib/subdomain_routes.rb
@@ -18,7 +18,7 @@ end
class SubdomainOrDomain
def self.matches?(request)
if (subdomains = request.subdomains) && subdomains.any?
- subdomain = subdomains.first
+ subdomain = subdomains.join(".")
APP_SUBDOMAINS.exclude?(subdomain)
end
end | Subdomain fix (#<I>)
* Subdomain fix
* Support multiple subdomains
* Fix subdomains for articles controller | michelson_chaskiq | train | rb,rb |
408a6f69296f0fab320fd79d30c2bf00cd24fbca | diff --git a/src/main/java/com/github/ansell/csvsum/CSVMapping.java b/src/main/java/com/github/ansell/csvsum/CSVMapping.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/github/ansell/csvsum/CSVMapping.java
+++ b/src/main/java/com/github/ansell/csvsum/CSVMapping.java
@@ -198,7 +198,7 @@ class CSVMapping {
return (String) ((Invocable) scriptEngine).invokeFunction("mapFunction", inputHeaders,
this.getInputField(), nextInputValue, this.getOutputField(), line);
} else if (compiledScript != null) {
- Bindings bindings = new SimpleBindings();
+ Bindings bindings = scriptEngine.createBindings();
// inputHeaders, inputField, inputValue, outputField, line
bindings.put("inputHeaders", inputHeaders);
bindings.put("inputField", this.getInputField()); | create bindings from the script engine instead of hardcoding the
implementation | ansell_csvsum | train | java |
5ea94f0e395130c4a08351f1d41dcf65a6d53dc0 | diff --git a/files/public/js/we.js b/files/public/js/we.js
index <HASH>..<HASH> 100644
--- a/files/public/js/we.js
+++ b/files/public/js/we.js
@@ -225,6 +225,8 @@ we.structure = {
regionTag.find('widgets').prepend(r.widget[0].html);
}).always(function(){
modal.modal('hide');
+
+ modal.find('form').off( event );
});
});
}); | fix widget creation how are trigering submit event multiple times | wejs_we-core | train | js |
ddb169eeda5dedf4c905f8bd964f3b08d341bcc6 | diff --git a/glances/core/glances_stats.py b/glances/core/glances_stats.py
index <HASH>..<HASH> 100644
--- a/glances/core/glances_stats.py
+++ b/glances/core/glances_stats.py
@@ -106,6 +106,8 @@ class GlancesStats(object):
def load_exports(self, args=None):
"""Load all exports module in the 'exports' folder."""
+ if args is None:
+ return False
header = "glances_"
# Transform the arguments list into a dict
# The aim is to chec if the export module should be loaded
@@ -126,6 +128,7 @@ class GlancesStats(object):
self._exports[export_name] = export_module.Export(args=args)
# Log plugins list
logger.debug("Available exports modules list: {0}".format(self.getAllExports()))
+ return True
def getAllPlugins(self):
"""Return the plugins list.""" | Correct an issue if args is None in the export load method | nicolargo_glances | train | py |
92f1c7099b3d25a0bf55c45170269170f7f2bf22 | diff --git a/npm/build.js b/npm/build.js
index <HASH>..<HASH> 100644
--- a/npm/build.js
+++ b/npm/build.js
@@ -152,6 +152,11 @@ Build.prototype.commit = function(releaseVersion, callback) {
}
Build.prototype.publish = function(callback) {
+ if (process.env.SKIP_PUBLISH) {
+ log.info('SKIP_PUBLISH environment variable is defined, skipping "publish" task');
+ callback();
+ return;
+ }
this.execSync('npm publish');
callback();
} | Allow to skip publish task (debug release process) | asciidoctor_asciidoctor.js | train | js |
9a861d674e7ab1f4d7bfe4baf4d3f1956628448b | diff --git a/textcounter.js b/textcounter.js
index <HASH>..<HASH> 100644
--- a/textcounter.js
+++ b/textcounter.js
@@ -94,6 +94,7 @@
if (textCount === base.options.max && base.options.max !== 0) {
// TextCounter: maxcount(el) Callback
base.options.maxcount(base.el);
+ base.clearErrors('max');
} else if (textCount > base.options.max && base.options.max !== 0) {
if (base.options.stopInputAtMaximum) { // if the string should be trimmed at the maximum length | Fixed error message for text count is in maximum limit | ractoon_jQuery-Text-Counter | train | js |
9388cd9b0b3dbe96544473a71f98a268900e159a | diff --git a/src/main/java/com/codeborne/selenide/Stopwatch.java b/src/main/java/com/codeborne/selenide/Stopwatch.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/codeborne/selenide/Stopwatch.java
+++ b/src/main/java/com/codeborne/selenide/Stopwatch.java
@@ -8,15 +8,17 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS;
@ParametersAreNonnullByDefault
public class Stopwatch {
- private final long endTimeNano;
+ private final long startTimeNano;
+ private final long timeoutNano;
public Stopwatch(long timeoutMs) {
- this.endTimeNano = nanoTime() + MILLISECONDS.toNanos(timeoutMs);
+ startTimeNano = nanoTime();
+ timeoutNano = MILLISECONDS.toNanos(timeoutMs);
}
@CheckReturnValue
public boolean isTimeoutReached() {
- return nanoTime() > endTimeNano;
+ return nanoTime() - startTimeNano > timeoutNano;
}
public void sleep(long milliseconds) { | fix flaky StopwatchTest
according to `System.nanoTime()` javadoc, to compare two nanoTime values one should use `t1 - t0 < 0`, not `t1 < t0`, because of the possibility of numerical overflow. | selenide_selenide | train | java |
0064ce06c469c8e18f5de98a06eb35b8e7f0c284 | diff --git a/lib/model/item.rb b/lib/model/item.rb
index <HASH>..<HASH> 100644
--- a/lib/model/item.rb
+++ b/lib/model/item.rb
@@ -33,11 +33,12 @@ module Viewpoint
# @todo Add support to fetch an item with a ChangeKey
def self.get_item(item_id, shape = :default)
item_shape = {:base_shape => shape.to_s.camelcase}
+ shallow = item_shape[:base_shape] != 'AllProperties'
resp = (Viewpoint::EWS::EWS.instance).ews.get_item([item_id], item_shape)
if(resp.status == 'Success')
item = resp.items.shift
type = item.keys.first
- eval "#{type.to_s.camel_case}.new(item[type])"
+ eval "#{type.to_s.camel_case}.new(item[type], :shallow => #{shallow})"
else
raise EwsError, "Could not retrieve item. #{resp.code}: #{resp.message}"
end | Shallow support on get_item operation. | WinRb_Viewpoint | train | rb |
912f90d0c34acfcaef2f53b7ae3d402c11962292 | diff --git a/packages/ember-runtime/lib/mixins/registry_proxy.js b/packages/ember-runtime/lib/mixins/registry_proxy.js
index <HASH>..<HASH> 100644
--- a/packages/ember-runtime/lib/mixins/registry_proxy.js
+++ b/packages/ember-runtime/lib/mixins/registry_proxy.js
@@ -286,7 +286,11 @@ function buildFakeRegistryFunction(instance, typeForMessage, deprecatedProperty,
deprecate(
`Using \`${typeForMessage}.registry.${deprecatedProperty}\` is deprecated. Please use \`${typeForMessage}.${nonDeprecatedProperty}\` instead.`,
false,
- { id: 'ember-application.app-instance-registry', until: '3.0.0' }
+ {
+ id: 'ember-application.app-instance-registry',
+ until: '3.0.0',
+ url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-application-registry-ember-applicationinstance-registry'
+ }
);
return instance[nonDeprecatedProperty](...arguments);
}; | [DOC beta] Add links to app.registry.* deprecations. | emberjs_ember.js | train | js |
96242b25b61150aad20d86de354c53e0206faa1d | diff --git a/openquake/calculators/classical.py b/openquake/calculators/classical.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/classical.py
+++ b/openquake/calculators/classical.py
@@ -332,7 +332,7 @@ class PSHACalculator(base.HazardCalculator):
num_tasks += 1
num_sources += len(args[0])
yield args + (monitor,)
- logging.info('Sent %d sources in %d tasks', num_sources, num_tasks)
+ logging.info('Sent %d sources in %d tasks', num_sources, num_tasks)
source.split_map.clear()
def _args_by_grp(self, csm, src_filter, param, num_tiles, maxweight): | More logging [skip CI] | gem_oq-engine | train | py |
79fae7998b3ced4a5b6b3fc99859a4dd82d944f8 | diff --git a/src/ReflectionEngine.php b/src/ReflectionEngine.php
index <HASH>..<HASH> 100644
--- a/src/ReflectionEngine.php
+++ b/src/ReflectionEngine.php
@@ -175,19 +175,22 @@ class ReflectionEngine
/**
* Parses a file and returns an AST for it
*
- * @param string $fileName Name of the file
+ * @param string $fileName Name of the file
+ * @param string|null $fileContent Optional content of the file
*
- * @return Node[]
+ * @return \PhpParser\Node[]
*/
- public static function parseFile($fileName)
+ public static function parseFile($fileName, $fileContent = null)
{
if (isset(self::$parsedFiles[$fileName])) {
return self::$parsedFiles[$fileName];
}
- $fileContent = file_get_contents($fileName);
- $treeNode = self::$parser->parse($fileContent);
- $treeNode = self::$traverser->traverse($treeNode);
+ if (!isset($fileContent)) {
+ $fileContent = file_get_contents($fileName);
+ }
+ $treeNode = self::$parser->parse($fileContent);
+ $treeNode = self::$traverser->traverse($treeNode);
self::$parsedFiles[$fileName] = $treeNode; | Allow to send custom content of the file | goaop_parser-reflection | train | php |
f91543a9e9fc2e49cedacfe4575ace0fb56391de | diff --git a/test/TestImportWithMalformed.py b/test/TestImportWithMalformed.py
index <HASH>..<HASH> 100644
--- a/test/TestImportWithMalformed.py
+++ b/test/TestImportWithMalformed.py
@@ -13,6 +13,10 @@ IMPORT_TASKS_MAIN = PlayFile('import-tasks-main.yml', '''
- oops this is invalid
''')
+IMPORT_PING = PlayFile('import-tasks-main.yml', '''
+- ping:
+''')
+
PLAY_IMPORT_TASKS = PlayFile('playbook.yml', '''
- hosts: all
tasks:
@@ -49,6 +53,7 @@ def play_files(tmp_path, request):
@pytest.mark.parametrize(
'play_files',
[
+ pytest.param([IMPORT_PING, PLAY_IMPORT_TASKS], id='Import ping:'),
pytest.param([IMPORT_TASKS_MAIN, PLAY_IMPORT_TASKS], id='import_tasks w/ malformed import')
],
indirect=['play_files'] | Add playbook w/ -ping: in TestImportWithMalformed.py | ansible_ansible-lint | train | py |
665f44b7a80f9f548d2cb5ab2ce7c668c20f628e | diff --git a/lib/engineyard-serverside/version.rb b/lib/engineyard-serverside/version.rb
index <HASH>..<HASH> 100644
--- a/lib/engineyard-serverside/version.rb
+++ b/lib/engineyard-serverside/version.rb
@@ -1,5 +1,5 @@
module EY
module Serverside
- VERSION = '2.0.0.pre4'
+ VERSION = '2.0.0.pre5'
end
end | Bump for prerelease <I>.pre5 | engineyard_engineyard-serverside | train | rb |
09a82d62be2eb9704ea0653bc23a40b4e4dad1c7 | diff --git a/src/harvesters/core.py b/src/harvesters/core.py
index <HASH>..<HASH> 100644
--- a/src/harvesters/core.py
+++ b/src/harvesters/core.py
@@ -1743,7 +1743,9 @@ class Harvester:
AccessDeniedException,
) as e:
self._logger.debug(e, exc_info=True)
- iam = None
+ # Just re-throw the exception. The decision should be made by
+ # the client but not Harvester:
+ raise
else:
self._logger.info(
'Opened Device module, {0}.'.format(device.id_) | Resolve issue #<I> | genicam_harvesters | train | py |
89936c845b2ae92a74cd3796a71b09433012a18d | diff --git a/lib/validate.js b/lib/validate.js
index <HASH>..<HASH> 100644
--- a/lib/validate.js
+++ b/lib/validate.js
@@ -38,7 +38,7 @@ module.exports = {
if (_.isEmpty(files)) {
// If we cannot find any handler we should terminate with an error
- throw new this.serverless.classes.Error(`No matching handler found for '${fileName}'. Check your service definition.`);
+ throw new this.serverless.classes.Error(`No matching handler found for '${fileName}' in '${this.serverless.config.servicePath}'. Check your service definition.`);
}
// Move preferred file extensions to the beginning | Include directory when reporting missing handler
This helped me debug a problem with using the context option
in my webpack configuration. | serverless-heaven_serverless-webpack | train | js |
5fc57c63a09fca3e5d6431cb697936be34b9a321 | diff --git a/tests/Carbon/GenericMacroTest.php b/tests/Carbon/GenericMacroTest.php
index <HASH>..<HASH> 100644
--- a/tests/Carbon/GenericMacroTest.php
+++ b/tests/Carbon/GenericMacroTest.php
@@ -18,7 +18,7 @@ class GenericMacroTest extends AbstractTestCaseWithOldNow
{
public function testGenericMacroBinding()
{
- if (version_compare(PHP_VERSION, '8.0.0-dev', '<')) {
+ if (version_compare(PHP_VERSION, '8.0.0-dev', '>=')) {
$this->markTestSkipped('Not yet implemented for PHP 8.');
}
diff --git a/tests/CarbonImmutable/GenericMacroTest.php b/tests/CarbonImmutable/GenericMacroTest.php
index <HASH>..<HASH> 100644
--- a/tests/CarbonImmutable/GenericMacroTest.php
+++ b/tests/CarbonImmutable/GenericMacroTest.php
@@ -18,7 +18,7 @@ class GenericMacroTest extends AbstractTestCaseWithOldNow
{
public function testGenericMacroBinding()
{
- if (version_compare(PHP_VERSION, '8.0.0-dev', '<')) {
+ if (version_compare(PHP_VERSION, '8.0.0-dev', '>=')) {
$this->markTestSkipped('Not yet implemented for PHP 8.');
} | Set specific tests for each macros in PHP 7 and 8 | briannesbitt_Carbon | train | php,php |
9b4c20f29a2e58ab3decea49ab497445af752f53 | diff --git a/eZ/Bundle/EzPublishLegacyBundle/DependencyInjection/EzPublishLegacyExtension.php b/eZ/Bundle/EzPublishLegacyBundle/DependencyInjection/EzPublishLegacyExtension.php
index <HASH>..<HASH> 100644
--- a/eZ/Bundle/EzPublishLegacyBundle/DependencyInjection/EzPublishLegacyExtension.php
+++ b/eZ/Bundle/EzPublishLegacyBundle/DependencyInjection/EzPublishLegacyExtension.php
@@ -45,8 +45,8 @@ class EzPublishLegacyExtension extends Extension
// View
$loader->load( 'view.yml' );
- // IO Services
- $loader->load( 'io.yml' );
+ // Fieldtype Services
+ $loader->load( 'fieldtype_services.yml' );
// SignalSlot settings
$loader->load( 'slot.yml' ); | IO: renamed io.yml to fieldtype_services.yml in LegacyBundle | ezsystems_ezpublish-kernel | train | php |
764300983fb7dac0a972b450220fc4725d41808e | diff --git a/tests/extended_temporal_memory/extensive_etm_test.py b/tests/extended_temporal_memory/extensive_etm_test.py
index <HASH>..<HASH> 100644
--- a/tests/extended_temporal_memory/extensive_etm_test.py
+++ b/tests/extended_temporal_memory/extensive_etm_test.py
@@ -430,7 +430,6 @@ class ExtensiveExtendedTemporalMemoryTest(AbstractTemporalMemoryTest, unittest.T
"""learnOnOneCell with motor command should not impair behavior.
Using learnOnOneCell, does the same test as E6, using the same parameters.
- It currently needs many more iterations to pass.
"""
self.init({"learnOnOneCell": True})
self.assertTrue(self.tm.learnOnOneCell)
@@ -883,7 +882,6 @@ class ExtensiveExtendedTemporalMemoryTest(AbstractTemporalMemoryTest, unittest.T
activeApicalCellsSequence=feedbackB)
# no burst at last step
unpredictedActiveColumns = self.tm.mmGetTraceUnpredictedActiveColumns().data
- print map(len, unpredictedActiveColumns)
self.assertGreaterEqual(len(unpredictedActiveColumns[-1]), min(self.w))
# many extra predictions
predictedInactiveColumns = self.tm.mmGetTracePredictedInactiveColumns().data | Removed a debugging statement | numenta_htmresearch | train | py |
d11b46dad9186f42f14c29a2fb409a33d093c38e | diff --git a/spec/controllers/controller_oauth2_spec.rb b/spec/controllers/controller_oauth2_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/controllers/controller_oauth2_spec.rb
+++ b/spec/controllers/controller_oauth2_spec.rb
@@ -237,6 +237,7 @@ describe SorceryController, :active_record => true do
after(:all) do
if SORCERY_ORM == :active_record
+ ActiveRecord::Migrator.rollback("#{Rails.root}/db/migrate/external")
ActiveRecord::Migrator.rollback("#{Rails.root}/db/migrate/activation")
end
end
diff --git a/spec/shared_examples/user_shared_examples.rb b/spec/shared_examples/user_shared_examples.rb
index <HASH>..<HASH> 100644
--- a/spec/shared_examples/user_shared_examples.rb
+++ b/spec/shared_examples/user_shared_examples.rb
@@ -532,8 +532,8 @@ shared_examples_for "external_user" do
after(:all) do
if SORCERY_ORM == :active_record
- ActiveRecord::Migrator.rollback("#{Rails.root}/db/migrate/activation")
ActiveRecord::Migrator.rollback("#{Rails.root}/db/migrate/external")
+ ActiveRecord::Migrator.rollback("#{Rails.root}/db/migrate/activation")
end
end | Fix the bug that after running specs there remains the table, users and version in schema_migrations. | Sorcery_sorcery | train | rb,rb |
eed7414717ba3a12f6b0400a82c5be9db77266ae | diff --git a/lib/guard/jasmine/cli.rb b/lib/guard/jasmine/cli.rb
index <HASH>..<HASH> 100644
--- a/lib/guard/jasmine/cli.rb
+++ b/lib/guard/jasmine/cli.rb
@@ -220,7 +220,7 @@ module Guard
result = ::Guard::Jasmine::Runner.new(runner_options).run(paths)
::Guard::Jasmine::Server.stop
- Process.exit result.first ? 0 : 1
+ Process.exit result.empty? ? 0 : 1
else
::Guard::Jasmine::Server.stop
Process.exit 2 | Use hash return from runner to determine success
empty? == success | guard_guard-jasmine | train | rb |
20fc303fa6c00b4f412078769c0db7fa6f80faa4 | diff --git a/tests/PHPUnit/bootstrap.php b/tests/PHPUnit/bootstrap.php
index <HASH>..<HASH> 100644
--- a/tests/PHPUnit/bootstrap.php
+++ b/tests/PHPUnit/bootstrap.php
@@ -60,8 +60,10 @@ foreach($fixturesToLoad as $fixturePath) {
}
}
-// General requirement checks & help: a webserver must be running for tests to work!
-checkPiwikSetupForTests();
+// General requirement checks & help: a webserver must be running for tests to work if not running UnitTests!
+if (empty($_SERVER['argv']) || !in_array('UnitTests', $_SERVER['argv'])) {
+ checkPiwikSetupForTests();
+}
function checkPiwikSetupForTests()
{ | do not check for piwik installation when running unit tests | matomo-org_matomo | train | php |
8f9e3ec0a7775fb6aeece184a832451be73bf5c0 | diff --git a/azurerm/internal/services/media/media_services_account_resource_test.go b/azurerm/internal/services/media/media_services_account_resource_test.go
index <HASH>..<HASH> 100644
--- a/azurerm/internal/services/media/media_services_account_resource_test.go
+++ b/azurerm/internal/services/media/media_services_account_resource_test.go
@@ -78,7 +78,6 @@ func TestAccMediaServicesAccount_multiplePrimaries(t *testing.T) {
Config: r.multiplePrimaries(data),
ExpectError: regexp.MustCompile("Only one Storage Account can be set as Primary"),
},
- data.ImportStep(),
})
} | r/media_services_account: fixing the `TestAccMediaServicesAccount_multiplePrimaries` test
This is a failure so there's nothing to import | terraform-providers_terraform-provider-azurerm | train | go |
4bf91c824244217f35f3dbc0a542c0119d60bb90 | diff --git a/client.js b/client.js
index <HASH>..<HASH> 100644
--- a/client.js
+++ b/client.js
@@ -295,6 +295,11 @@ LimitdClient.prototype._fireAndForgetRequest = function (request) {
}
operation.attempt(() => {
+ if (!this.pending_operations.has(operation)) {
+ //the operation was aborted.
+ return handleError(new Error('The operation was aborted'));
+ }
+
if (!this.stream || !this.stream.writable) {
const err = new Error(`Unable to send ${request.method} to limitd. The socket is closed.`);
return handleError(err); | abort early fireAndForget operations | limitd_node-client | train | js |
dda1d605565caad90597fd7d0e5126838cef3e9c | diff --git a/eth/backend.go b/eth/backend.go
index <HASH>..<HASH> 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -167,13 +167,13 @@ func New(config *Config) (*Ethereum, error) {
extraDb, err := ethdb.NewLDBDatabase(path.Join(config.DataDir, "extra"))
// Perform database sanity checks
- d, _ := extraDb.Get([]byte("ProtocolVersion"))
+ d, _ := blockDb.Get([]byte("ProtocolVersion"))
protov := int(common.NewValue(d).Uint())
if protov != config.ProtocolVersion && protov != 0 {
path := path.Join(config.DataDir, "blockchain")
return nil, fmt.Errorf("Database version mismatch. Protocol(%d / %d). `rm -rf %s`", protov, config.ProtocolVersion, path)
}
- saveProtocolVersion(extraDb, config.ProtocolVersion)
+ saveProtocolVersion(blockDb, config.ProtocolVersion)
servlogger.Infof("Protocol Version: %v, Network Id: %v", config.ProtocolVersion, config.NetworkId)
eth := &Ethereum{ | Store protocol version in the block db **NOT** extra db | ethereum_go-ethereum | train | go |
3c7cb452c9aa06a7b8124f4b78b1851b1322d5b8 | diff --git a/flask_slither.py b/flask_slither.py
index <HASH>..<HASH> 100644
--- a/flask_slither.py
+++ b/flask_slither.py
@@ -229,7 +229,12 @@ class BaseAPI(MethodView):
def _get_instance(self, args):
current_app.logger.debug("GETting instance")
+ print args
+ if '_id' in args and isinstance(args['_id'], unicode):
+ # transform id to objectid so mongo can find it
+ args['_id'] = ObjectId(args['_id'])
cursor = current_app.db[self.collection].find(args)
+
count = cursor.count()
if count == 0:
abort(404) | getting instance by oid works | gevious_flask_slither | train | py |
a4f03454e655c3c198a68864427d4c1ef7f7752d | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ from os import path
from distutils.version import LooseVersion
from setuptools import find_packages, setup
-VERSION = '1.25.4'
+VERSION = '1.25.5'
# Import README.md into long_description
pwd = path.abspath(path.dirname(__file__)) | Bump package to <I> | instana_python-sensor | train | py |
056769bb8ce47276fdff76212c5752c91fc4ce93 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -123,14 +123,12 @@ setuptools.setup(
+ url_requires
+ optional_requires
),
- "build": ["twine", "wheel"],
- "docs": docs_requires,
+ "dev": ["releasecmd>=0.2.0,<1", "twine", "wheel"] + docs_requires + list(tests_requires),
"excel": excel_requires,
"gs": gs_requires,
"logging": logging_requires,
"md": markdown_requires,
"mediawiki": mediawiki_requires,
- "release": ["releasecmd>=0.0.18,<0.1.0"],
"url": url_requires,
"sqlite": sqlite_requires,
"test": tests_requires, | Integrate build/release/docs extras to dev extras | thombashi_pytablereader | train | py |
17af6a50260247f7b6801e152f09062a9fe7f3b3 | diff --git a/model/CreatorConfig.php b/model/CreatorConfig.php
index <HASH>..<HASH> 100644
--- a/model/CreatorConfig.php
+++ b/model/CreatorConfig.php
@@ -127,7 +127,7 @@ Class CreatorConfig extends Config
//as the config overrides the plugins, we get the list from the registry
$registry = QtiCreatorClientConfigRegistry::getRegistry();
- $this->plugins = $registry->getPlugins();
+ $this->plugins = array_merge($this->plugins, $registry->getPlugins());
}
protected function prepare($hook){ | prevent manually added plugin to be overwritten | oat-sa_extension-tao-itemqti | train | php |
072820767c0ede49c94800f57d2b8f113e69cc33 | diff --git a/test/sp.ds.requestExecutor_test.js b/test/sp.ds.requestExecutor_test.js
index <HASH>..<HASH> 100644
--- a/test/sp.ds.requestExecutor_test.js
+++ b/test/sp.ds.requestExecutor_test.js
@@ -73,9 +73,9 @@ describe('ds:', function () {
});
it('should return resource error in case of incorrect request', function (done) {
var cbSpy;
- var uri = '/v1/test';
+ var uri = 'https://api.stormpath.com/v1/test';
var res = {test: 'boom'};
- nock(uri).get('/').reply(400, res);
+ nock(uri).get('/v1/test').reply(400, res);
function cb(err, body) {
err.should.be.an.instanceof(ResourceError);
expect(body).to.be.null;
@@ -84,7 +84,7 @@ describe('ds:', function () {
}
cbSpy = sinon.spy(cb);
- reqExec.execute({uri: '/test', method:'GET', body:{}}, cbSpy);
+ reqExec.execute({uri: uri, method:'GET'}, cbSpy);
});
}); | resolved: one of the test was not hitting mocked uri | stormpath_stormpath-sdk-node | train | js |
9070020c2b22d96930d5d1bf3f5ae0265c3ecbda | diff --git a/src/Template/Directive/GoForeachDirective.php b/src/Template/Directive/GoForeachDirective.php
index <HASH>..<HASH> 100644
--- a/src/Template/Directive/GoForeachDirective.php
+++ b/src/Template/Directive/GoForeachDirective.php
@@ -50,7 +50,7 @@
}
}
return $output;
- } else if (preg_match ('/^([a-z0-9_\\.]+)\s+as\s+([a-z0-9_]+)\s*=>\s*([a-z0-9_])$/i', trim ($stmt), $matches)) {
+ } else if (preg_match ('/^([a-z0-9_\\.]+)\s+as\s+([a-z0-9_]+)\s*=\\>\s*([a-z0-9_])$/i', trim ($stmt), $matches)) {
$data = $execBag->expressionEvaluator->eval($matches[1], $scope);
foreach ($data as $key => $val) {
$scope[$matches[2]] = $key; | Added link element to empty tag list | dermatthes_html-template | train | php |
437b7cca0aabb4c1d1e231f27c8e14cb9603bf61 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -27,8 +27,8 @@ class Tox(TestCommand):
sys.exit(errno)
-def read(fname):
- with(open(os.path.join(os.path.dirname('__file__'), fname))) as fp:
+def read(path):
+ with(open(os.path.join(os.path.dirname(__file__), path))) as fp:
return fp.read()
pkg = {}
@@ -70,6 +70,7 @@ setup(
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Filesystems',
'Programming Language :: Python',
+ 'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
]
) | Changed __file__ back to variable | bharadwajyarlagadda_bingmaps | train | py |
8d253adff0dc99f4a0f99424e4187e0b0a035c14 | diff --git a/Swat/SwatContainer.php b/Swat/SwatContainer.php
index <HASH>..<HASH> 100644
--- a/Swat/SwatContainer.php
+++ b/Swat/SwatContainer.php
@@ -385,6 +385,8 @@ class SwatContainer extends SwatWidget implements SwatUIParent
*/
public function process()
{
+ parent::process();
+
foreach ($this->children as $child) {
if ($child !== null && !$child->isProcessed())
$child->process(); | Call parent::process() in SwatContainer. This automatically processes composite widgets.
svn commit r<I> | silverorange_swat | train | php |
bc746aab91d51746ba955045dc8416532324ad7d | diff --git a/src/Semaphore.php b/src/Semaphore.php
index <HASH>..<HASH> 100644
--- a/src/Semaphore.php
+++ b/src/Semaphore.php
@@ -165,6 +165,14 @@ class Semaphore {
}
/**
+ * Has the semaphore been created?
+ * @return bool true in case the semaphore has been created
+ */
+ public function isCreated() {
+ return is_resource($this->semaphore);
+ }
+
+ /**
* Destroys the semaphore
* @throws SemaphoreException in case of an error
* @return \QXS\WorkerPool\Semaphore the current object | attach your own Semaphore, that can be used within the workers
this is an interesting feature in case you want to tune a bit your maxAcquire or permission settings
By extending the Semaphore object even cooler features would be possible. | qxsch_WorkerPool | train | php |
74fb3cf821d5b5d5bae37e03ba7ccaffc13ce9d0 | diff --git a/lib/phusion_passenger/utils/rewindable_input.rb b/lib/phusion_passenger/utils/rewindable_input.rb
index <HASH>..<HASH> 100644
--- a/lib/phusion_passenger/utils/rewindable_input.rb
+++ b/lib/phusion_passenger/utils/rewindable_input.rb
@@ -41,6 +41,11 @@ module Utils
@rewindable_io.rewind
end
+ def size
+ make_rewindable unless @rewindable_io
+ @rewindable_io.size
+ end
+
# Closes this RewindableInput object without closing the originally
# wrapped IO oject. Cleans up any temporary resources that this RewindableInput
# has created. | Added size delegate method to RewindableInput which is needed in some contexts | phusion_passenger | train | rb |
f2880b105651128c793bfe90279a349e6debbf1e | diff --git a/plenum/config.py b/plenum/config.py
index <HASH>..<HASH> 100644
--- a/plenum/config.py
+++ b/plenum/config.py
@@ -315,7 +315,7 @@ ENABLED_PLUGINS = []
# 2 during replay
STACK_COMPANION = 0
-ENABLE_INCONSISTENCY_WATCHER_NETWORK = False
+ENABLE_INCONSISTENCY_WATCHER_NETWORK = True
# None or 'kv'
METRICS_COLLECTOR_TYPE = None | INDY-<I>: Enable inconsistency watchdog based on network events | hyperledger_indy-plenum | train | py |
b39647b33a5a4d3aaa4c108b142bcb59377eb8c6 | diff --git a/from_markdown.js b/from_markdown.js
index <HASH>..<HASH> 100644
--- a/from_markdown.js
+++ b/from_markdown.js
@@ -2,8 +2,6 @@ const markdownit = require("markdown-it")
const {defaultSchema} = require("../schema")
const {Mark} = require("../model")
-const noMarks = []
-
function maybeMerge(a, b) {
if (a.isText && b.isText && Mark.sameSet(a.marks, b.marks))
return a.copy(a.text + b.text)
@@ -14,7 +12,7 @@ class MarkdownParseState {
constructor(schema, tokenHandlers) {
this.schema = schema
this.stack = [{type: schema.nodes.doc, content: []}]
- this.marks = noMarks
+ this.marks = Mark.none
this.tokenHandlers = tokenHandlers
}
@@ -77,7 +75,7 @@ class MarkdownParseState {
// : () → ?Node
// Close and return the node that is currently on top of the stack.
closeNode() {
- if (this.marks.length) this.marks = noMarks
+ if (this.marks.length) this.marks = Mark.none
let info = this.stack.pop()
return this.addNode(info.type, info.attrs, info.content)
} | Export a Mark.none as the empty set of marks
Replace a number of locally declared static empty arrays
with it | ProseMirror_prosemirror-markdown | train | js |
65646a8b650e97fb6dfc5da7ccac57a82cbea940 | diff --git a/playitagainsam/player.py b/playitagainsam/player.py
index <HASH>..<HASH> 100644
--- a/playitagainsam/player.py
+++ b/playitagainsam/player.py
@@ -29,7 +29,7 @@ class Player(SocketCoordinator):
auto_waypoint=False, live_replay=False, replay_shell=None):
super(Player, self).__init__(sock_path)
self.eventlog = eventlog
- self.terminal = terminal or get_default_terminal()
+ self.terminal = terminal
self.live_replay = live_replay
self.replay_shell = replay_shell
if not auto_type:
@@ -90,7 +90,8 @@ class Player(SocketCoordinator):
env["PIAS_OPT_COMMAND"] = "replay"
env["PIAS_OPT_DATAFILE"] = self.eventlog.datafile
env["PIAS_OPT_TERMINAL"] = self.terminal
- forkexec([self.terminal, "-e", get_pias_script()], env)
+ cmd = self.terminal or get_default_terminal()
+ forkexec([cmd, "-e", get_pias_script()], env)
view_sock, _ = self.sock.accept()
if self.live_replay: | Delay calling get_default_terminal() for as long as possible. | rfk_playitagainsam | train | py |
af813e0e62652e7a5b87a250496ba7a94ee0e309 | diff --git a/src/sync.js b/src/sync.js
index <HASH>..<HASH> 100644
--- a/src/sync.js
+++ b/src/sync.js
@@ -34,6 +34,12 @@ async function sync(cfg, opt) {
cfg = typeof cfg === "function" ? cfg(opt) : cfg;
cfg = mergeWith({}, configDefaults, cfg, merger);
+ if (!cfg.files.length && !cfg.includes.length) {
+ console.warn(
+ 'You have not provided any "files" or "includes". For more information see https://github.com/treshugart/conartist#install for ways you can configure conartist.'
+ );
+ }
+
// Includes are like Babel plugins.
for (let inc of cfg.include) {
let arg; | Warn if not files or includes are present. Fixes #<I>. | treshugart_conartist | train | js |
8cdc95454cd9768930a06d9f9ff3dad5b0b2736d | diff --git a/generators/generator-constants.js b/generators/generator-constants.js
index <HASH>..<HASH> 100644
--- a/generators/generator-constants.js
+++ b/generators/generator-constants.js
@@ -63,7 +63,7 @@ const DOCKER_MSSQL = 'mcr.microsoft.com/mssql/server:2019-CU5-ubuntu-16.04';
const DOCKER_NEO4J = 'neo4j:4.1.1';
const DOCKER_HAZELCAST_MANAGEMENT_CENTER = 'hazelcast/management-center:3.12.9'; // waiting for https://github.com/jhipster/generator-jhipster/issues/11244
const DOCKER_MEMCACHED = 'memcached:1.6.6-alpine';
-const DOCKER_REDIS = 'redis:6.0.4';
+const DOCKER_REDIS = 'redis:6.0.5';
const DOCKER_KEYCLOAK = 'jboss/keycloak:10.0.0'; // The version should match the attribute 'keycloakVersion' from /docker-compose/templates/realm-config/jhipster-realm.json.ejs and /server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs
const DOCKER_ELASTICSEARCH = 'docker.elastic.co/elasticsearch/elasticsearch:6.8.8'; // The version should be coherent with the one from spring-data-elasticsearch project
const DOCKER_KAFKA = `confluentinc/cp-kafka:${KAFKA_VERSION}`; | Update redis docker image version to <I> | jhipster_generator-jhipster | train | js |
0d9e655612c1bd8b83d3912a4f07c71a870b7c14 | diff --git a/src/socketServer.py b/src/socketServer.py
index <HASH>..<HASH> 100644
--- a/src/socketServer.py
+++ b/src/socketServer.py
@@ -34,7 +34,7 @@ class SocketServer(Module):
con, addr, self.n_conn)
return True
def _handle_connection(self, con, addr, n_conn):
- l = logging.getLogger("%s.%s" % (self.l.name, n_conn))
+ l = logging.LoggerAdapter(self.l, {'sid': n_conn})
l.info("Accepted connection from %s" % repr(addr))
handler = self.create_handler(con, addr, l)
with self.lock: | Use LoggerAdapter instead of separate logger for each connection | bwesterb_sarah | train | py |
800ee0f9e86645d64a5df369e92c9148a564c6c5 | diff --git a/lib/active_scaffold/actions/update.rb b/lib/active_scaffold/actions/update.rb
index <HASH>..<HASH> 100644
--- a/lib/active_scaffold/actions/update.rb
+++ b/lib/active_scaffold/actions/update.rb
@@ -75,18 +75,22 @@ module ActiveScaffold::Actions
# If you want to customize this algorithm, consider using the +before_update_save+ callback
def do_update
do_edit
- @record = update_record_from_params(@record, active_scaffold_config.update.columns, params[:record])
update_save
end
def update_save
begin
active_scaffold_config.model.transaction do
+ @record = update_record_from_params(@record, active_scaffold_config.update.columns, params[:record]) unless options[:no_record_param_update]
before_update_save(@record)
self.successful = [@record.valid?, @record.associated_valid?].all? {|v| v == true} # this syntax avoids a short-circuit
if successful?
@record.save! and @record.save_associated!
after_update_save(@record)
+ else
+ # some associations such as habtm are saved before saved is called on parent object
+ # we have to revert these changes if validation fails
+ raise ActiveRecord::Rollback, "don't save habtm associations unless record is valid"
end
end
rescue ActiveRecord::RecordInvalid | Bugfix: habtm associations are saved altough validation failed (issue <I>
reported and fixed by clyfe) | activescaffold_active_scaffold | train | rb |
f712f2ab3d665feca8a16f9392ac9d34205cb7f9 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name = "simple-db-migrate",
- version = "1.2.6",
+ version = "1.2.7",
packages = find_packages("src"),
package_dir = {"":"src"},
scripts = ["src/db-migrate"], | Preparing for version <I>. | guilhermechapiewski_simple-db-migrate | train | py |
7816d293cc54f991a76887d6098afde8837f50a3 | diff --git a/src/Torann/Moderate/Cache.php b/src/Torann/Moderate/Cache.php
index <HASH>..<HASH> 100644
--- a/src/Torann/Moderate/Cache.php
+++ b/src/Torann/Moderate/Cache.php
@@ -116,8 +116,8 @@ class Cache {
*/
public function expired()
{
- // Update if empty
- if (empty($this->entries))
+ // Update if empty or just a timestamp
+ if (empty($this->entries) || count($this->entries) <= 1)
{
return true;
} | Fix bug with entry count in caching | Torann_laravel-moderate | train | php |
d273761c3d1cc900fd57b1b20e14aace4a9c0d3e | diff --git a/ci/behat-tags.php b/ci/behat-tags.php
index <HASH>..<HASH> 100644
--- a/ci/behat-tags.php
+++ b/ci/behat-tags.php
@@ -40,6 +40,26 @@ $skip_tags = array_merge(
# Skip Github API tests by default because of rate limiting. See https://github.com/wp-cli/wp-cli/issues/1612
$skip_tags[] = '@github-api';
+# Require PHP extension, eg 'imagick'.
+function extension_tags() {
+ $extension_tags = array();
+ exec( "grep '@require-extension-[A-Za-z_]*' -h -o features/*.feature | uniq", $extension_tags );
+
+ $skip_tags = array();
+
+ $substr_start = strlen( '@require-extension-' );
+ foreach ( $extension_tags as $tag ) {
+ $extension = substr( $tag, $substr_start );
+ if ( ! extension_loaded( $extension ) ) {
+ $skip_tags[] = $tag;
+ }
+ }
+
+ return $skip_tags;
+}
+
+$skip_tags = array_merge( $skip_tags, extension_tags() );
+
if ( !empty( $skip_tags ) ) {
echo '--tags=~' . implode( '&&~', $skip_tags );
} | Add require-extension tag processing to behat-tags. | wp-cli_core-command | train | php |
42b1d05f49d7f6b268d35989440ffa1b316df8b9 | diff --git a/closure/goog/base.js b/closure/goog/base.js
index <HASH>..<HASH> 100644
--- a/closure/goog/base.js
+++ b/closure/goog/base.js
@@ -1670,6 +1670,8 @@ goog.base = function(me, opt_methodName, var_args) {
* uncompiled code - in compiled code the calls will be inlined and the aliases
* applied. In uncompiled code the function is simply run since the aliases as
* written are valid JavaScript.
+ *
+ *
* @param {function()} fn Function to call. This function can contain aliases
* to namespaces (e.g. "var dom = goog.dom") or classes
* (e.g. "var Timer = goog.Timer"). | Add link to goog.scope doc in the goog.scope jsdoc.
-------------
Created by MOE: <URL> | google_closure-library | train | js |
cd65b88e47a2b2a63913c393bcf01065885dd569 | diff --git a/synapse/lib/socket.py b/synapse/lib/socket.py
index <HASH>..<HASH> 100644
--- a/synapse/lib/socket.py
+++ b/synapse/lib/socket.py
@@ -464,8 +464,16 @@ class Plex(EventBus):
try:
rxlist, txlist, xxlist = select.select(self._plex_rxsocks, self._plex_txsocks, self._plex_xxsocks, 0.2)
- # mask "bad file descriptor" race and go around again...
except Exception as e:
+ # go through ALL of our sockets, and call _finiPlexSock on that socket if it has been fini'd or
+ # if those sockets fileno() call is -1
+ # The .copy() method is used since it is faster for small lists.
+ # The identity check of -1 is reliant on a CPython optimization which keeps a single
+ # addressed copy of integers between -5 and 256 in. memory
+ logger.exception('Error during socket select. Culling fini or fileno==-1 sockets.')
+ [self._finiPlexSock(sck) for sck in self._plex_rxsocks.copy() if sck.isfini or sck.fileno() is -1]
+ [self._finiPlexSock(sck) for sck in self._plex_txsocks.copy() if sck.isfini or sck.fileno() is -1]
+ [self._finiPlexSock(sck) for sck in self._plex_xxsocks.copy() if sck.isfini or sck.fileno() is -1]
continue
try: | Add a fix for closed sockets which haven't been pruned from the plex during fini yet. | vertexproject_synapse | train | py |
50007580a489fdef7ab7ca8f69a5d1727277719e | diff --git a/generators/generator-base-blueprint.js b/generators/generator-base-blueprint.js
index <HASH>..<HASH> 100644
--- a/generators/generator-base-blueprint.js
+++ b/generators/generator-base-blueprint.js
@@ -79,6 +79,10 @@ module.exports = class extends BaseGenerator {
* @return {true} useBlueprints - true if one or more blueprints generators have been constructed; false otherwise
*/
instantiateBlueprints(subGen, extraOptions) {
+ if (this.options.help) {
+ // Ignore blueprint registered options.
+ return false;
+ }
let useBlueprints = false;
const blueprints = jhipsterUtils.parseBluePrints( | Don't instantiate blueprint when running help. | jhipster_generator-jhipster | train | js |
fee76bdf60370638c6028105242c012a80be3f16 | diff --git a/src/createDispatcher.js b/src/createDispatcher.js
index <HASH>..<HASH> 100644
--- a/src/createDispatcher.js
+++ b/src/createDispatcher.js
@@ -65,7 +65,11 @@ export default function createDispatcher() {
})
if (Promise.isPrototypeOf(res)) {
- dispatcher.onNext(Observable.fromPromise(res))
+ dispatcher.onNext(
+ Observable
+ .fromPromise(res)
+ .shareReplay()
+ )
}
return Promise.resolve(res)
@@ -75,7 +79,7 @@ export default function createDispatcher() {
return Promise.resolve(action)
},
schedule(agenda) {
- dispatcher.onNext(agenda)
+ dispatcher.onNext(agenda.shareReplay())
return Promise.resolve(agenda)
},
getState(fn) { | Preserve results of asynchronous observables with shareReplay | kitten_fluorine | train | js |
1effaba47dfd85cfbf05e2632c609e97ad3f9691 | diff --git a/abilian/web/frontend.py b/abilian/web/frontend.py
index <HASH>..<HASH> 100644
--- a/abilian/web/frontend.py
+++ b/abilian/web/frontend.py
@@ -20,7 +20,7 @@ import sqlalchemy as sa
from sqlalchemy import func
from sqlalchemy.sql.expression import asc, desc, nullsfirst, nullslast
from sqlalchemy import orm
-from werkzeug.exceptions import InternalServerError
+from werkzeug.exceptions import BadRequest
from xlwt import Workbook, XFStyle
@@ -567,10 +567,13 @@ class Module(object):
q = args.get("q").replace("%", " ")
if not q or len(q) < 2:
- raise InternalServerError()
+ raise BadRequest()
- query = db.session.query(cls.id, cls.nom)
- query = query.filter(cls.nom.like("%" + q + "%"))
+ query = db.session.query(cls.id, cls.name)
+ query = query.filter(cls.name.ilike("%" + q + "%"))\
+ .distinct()\
+ .order_by(cls.name)\
+ .limit(50)
all = query.all()
result = {'results': [ { 'id': r[0], 'text': r[1]} for r in all ] } | frontend: fix list_json2 | abilian_abilian-core | train | py |
a79974a219b03b7593c0ca89adc33709b2abde06 | diff --git a/scot/__init__.py b/scot/__init__.py
index <HASH>..<HASH> 100644
--- a/scot/__init__.py
+++ b/scot/__init__.py
@@ -26,4 +26,4 @@ from . import datatools
__all__ = ['Workspace', 'Connectivity', 'datatools']
-__version__ = "0.2"
+__version__ = "0.3.dev0" | Moved master branch to <I>.dev0 | scot-dev_scot | train | py |
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.