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
|
---|---|---|---|---|---|
f006d61ad609348d1a2088066a3ebe88068e5514 | diff --git a/core-bundle/src/Resources/contao/library/Contao/Environment.php b/core-bundle/src/Resources/contao/library/Contao/Environment.php
index <HASH>..<HASH> 100644
--- a/core-bundle/src/Resources/contao/library/Contao/Environment.php
+++ b/core-bundle/src/Resources/contao/library/Contao/Environment.php
@@ -62,7 +62,7 @@ class Environment
return static::$arrCache[$strKey];
}
- if (in_array($strKey, get_class_methods('Environment')))
+ if (in_array($strKey, get_class_methods(__CLASS__)))
{
static::$arrCache[$strKey] = static::$strKey();
} | [Core] Use the __CLASS__ constants instead of a hardcoded name in the Environment class. | contao_contao | train | php |
cce4f8d45872c1ff86654bb64add74614533c4ee | diff --git a/test/www/jxcore/lib/testUtils.js b/test/www/jxcore/lib/testUtils.js
index <HASH>..<HASH> 100755
--- a/test/www/jxcore/lib/testUtils.js
+++ b/test/www/jxcore/lib/testUtils.js
@@ -474,6 +474,7 @@ module.exports.getSamePeerWithRetry = function (path, pskIdentity, pskKey,
}
exitCalled = true;
clearTimeout(timeoutId);
+ clearTimeout(cancelGetPortTimeout);
thaliMobileNativeWrapper.emitter
.removeListener('nonTCPPeerAvailabilityChangedEvent',
nonTCPAvailableHandler);
@@ -485,7 +486,6 @@ module.exports.getSamePeerWithRetry = function (path, pskIdentity, pskKey,
}
var timeoutId = setTimeout(function () {
- clearTimeout(cancelGetPortTimeout);
exitCall(null, new Error('Timer expired'));
}, MAX_TIME_TO_WAIT_IN_MILLISECONDS); | Changed exitCall method in testUtils.js | thaliproject_Thali_CordovaPlugin | train | js |
5ee943e617ddc4e2230280450753af83e7bfd5a5 | diff --git a/lib/mandrill-rails/web_hook_processor.rb b/lib/mandrill-rails/web_hook_processor.rb
index <HASH>..<HASH> 100644
--- a/lib/mandrill-rails/web_hook_processor.rb
+++ b/lib/mandrill-rails/web_hook_processor.rb
@@ -74,7 +74,7 @@ module Mandrill::Rails::WebHookProcessor
end
def authenticate_mandrill_request!
- unless request.head?
+ if request.post?
unless Mandrill::WebHook::Processor.new(params, self).authentic?(request)
head(:forbidden, :text => "Mandrill signature did not match.")
return false | Changing check from `unless head?` to `if post?` fixes a bug with Heroku. | evendis_mandrill-rails | train | rb |
6270159e558c1f6a7b2a13bf013cd5c56a00ce6d | diff --git a/eZ/Bundle/EzPublishCoreBundle/DependencyInjection/EzPublishCoreExtension.php b/eZ/Bundle/EzPublishCoreBundle/DependencyInjection/EzPublishCoreExtension.php
index <HASH>..<HASH> 100644
--- a/eZ/Bundle/EzPublishCoreBundle/DependencyInjection/EzPublishCoreExtension.php
+++ b/eZ/Bundle/EzPublishCoreBundle/DependencyInjection/EzPublishCoreExtension.php
@@ -418,6 +418,11 @@ class EzPublishCoreExtension extends Extension
// Now build the related SiteAccesses list, based on the relation map.
foreach ( $saList as $sa )
{
+ if ( $configResolver->getParameter( 'legacy_mode', 'ezsettings', $sa ) === true )
+ {
+ continue;
+ }
+
$repository = $configResolver->getParameter( 'repository', 'ezsettings', $sa );
$rootLocationId = $configResolver->getParameter( 'content.tree_root.location_id', 'ezsettings', $sa );
$container->setParameter( | Fix EZP-<I>: Undefined index in frontend after eZ Publish / ezwebin installation | ezsystems_ezpublish-kernel | train | php |
37ff7f50fd981aef039c7db91ed28584586ff18c | diff --git a/sieve/rules/actions.py b/sieve/rules/actions.py
index <HASH>..<HASH> 100644
--- a/sieve/rules/actions.py
+++ b/sieve/rules/actions.py
@@ -1,17 +1,14 @@
-class SieveActions(object):
+class SieveActions(list):
def __init__(self, implicit_keep=False):
- self.actions = []
+ super(SieveActions, self).__init__()
self.implicit_keep = implicit_keep
def append(self, action, action_args=None):
- self.actions.append((action, action_args))
+ super(SieveActions, self).append((action, action_args))
return self
def cancel_implicit_keep(self):
self.implicit_keep = False
return self
-
- def __getattr__(self, name):
- return getattr(self.actions, name) | make SieveActions inherit from list. simple delegation doesn't work with new-style classes. | garyp_sifter | train | py |
897798246495d537a1ac2216d1ff1401ea62ae92 | diff --git a/tcex/testing/validate_data.py b/tcex/testing/validate_data.py
index <HASH>..<HASH> 100644
--- a/tcex/testing/validate_data.py
+++ b/tcex/testing/validate_data.py
@@ -133,6 +133,7 @@ class Validator(object):
test_data = json.loads(json.dumps(test_data))
except ValueError:
pass
+
try:
if isinstance(app_data, list) and isinstance(test_data, list):
for index, data in enumerate(app_data):
@@ -152,9 +153,10 @@ class Validator(object):
test_data = self.remove_excludes(test_data, paths)
except AttributeError:
pass
+
# run operator
try:
- ddiff = DeepDiff(app_data, test_data, ignore_order=True, **kwargs)
+ ddiff = DeepDiff(app_data, test_data, **kwargs)
except KeyError:
return False, 'Encountered KeyError when running deepdiff'
except NameError: | removed ignore_order param for deepdiff validation | ThreatConnect-Inc_tcex | train | py |
6784b37def5b64a8d91682b4afd5ae4bdeefb93a | diff --git a/src/Binocle/Theme/Template.php b/src/Binocle/Theme/Template.php
index <HASH>..<HASH> 100755
--- a/src/Binocle/Theme/Template.php
+++ b/src/Binocle/Theme/Template.php
@@ -60,7 +60,6 @@ class Template
elseif (is_author() && $template = $finder->get('author') ) :
elseif (is_date() && $template = $finder->get('date') ) :
elseif (is_archive() && $template = $finder->get('archive') ) :
- elseif (is_comments_popup() && $template = $finder->get('comments_popup') ) :
elseif (is_paged() && $template = $finder->get('paged') ) :
else :
$template = $finder->get('index'); | Removed is_comments_popup() check because it is deprecated in WP <I> | hungrylab_binocle-framework | train | php |
315b60e9f45ca3ca166ea8ab9b5154887accba05 | diff --git a/pybar/fei4_run_base.py b/pybar/fei4_run_base.py
index <HASH>..<HASH> 100644
--- a/pybar/fei4_run_base.py
+++ b/pybar/fei4_run_base.py
@@ -870,24 +870,22 @@ class Fei4RunBase(RunBase):
logging.warning("Failed sending pyBAR status report")
def configure(self):
- '''Implementation of the run configuration.
+ '''The module configuration happens here.
- Will be executed before starting the scan routine. Has to be defined in scan.
+ Will be executed before calling the scan method.
+ Any changes of the module configuration will be reverted after after finishing the scan method.
'''
- raise NotImplemented('You have to specify a configure method in your scan!')
+ pass
def scan(self):
- '''Implementation of the scan routine.
-
- Do you want to write your own scan? Here is the place to begin. Has to be defined in scan.
+ '''Implementation of the scan.
'''
- raise NotImplemented('You have to specify a scan method in your scan!')
+ pass
def analyze(self):
- '''Implementation of run data processing.
+ '''Implementation of the data analysis.
- Will be executed after finishing the scan routine.
- Does not have to be defined
+ Will be executed after finishing the scan method.
'''
pass | MAINT: update docstring and allow empty scan | SiLab-Bonn_pyBAR | train | py |
b2c9056d857286454c82717e2dc04025ddce3bc5 | diff --git a/src/Graviton/FileBundle/FileManager.php b/src/Graviton/FileBundle/FileManager.php
index <HASH>..<HASH> 100644
--- a/src/Graviton/FileBundle/FileManager.php
+++ b/src/Graviton/FileBundle/FileManager.php
@@ -202,7 +202,8 @@ class FileManager
// does it really exist??
if (!empty($fileData)) {
$record = $model->find($fileData->getId());
- } elseif (!empty($id)) {
+ }
+ if (empty($record) && !empty($id)) {
$record = $model->find($id);
}
@@ -222,6 +223,10 @@ class FileManager
}
if (!empty($fileData)) {
+ $fId = $fileData->getId();
+ if (empty($fId) && !empty($id)) {
+ $fileData->setId($id);
+ }
$record = $fileData;
} else {
$entityClass = $model->getEntityClass(); | Fixed wrong behavior when PUTting a file with no metadata | libgraviton_graviton | train | php |
51d98b2182c145b6fc4e0184777c28ace6382685 | diff --git a/lib/mongo_mapper/plugins/associations/single_association.rb b/lib/mongo_mapper/plugins/associations/single_association.rb
index <HASH>..<HASH> 100644
--- a/lib/mongo_mapper/plugins/associations/single_association.rb
+++ b/lib/mongo_mapper/plugins/associations/single_association.rb
@@ -5,7 +5,8 @@ module MongoMapper
class SingleAssociation < Base
def setup(model)
@model = model
- model.associations_module.module_eval <<-end_eval
+
+ model.associations_module.module_eval(<<-end_eval, __FILE__, __LINE__)
def #{name}
proxy = get_proxy(associations[#{name.inspect}])
proxy.nil? ? nil : proxy | add file + line numbers when debugging to module_eval | mongomapper_mongomapper | train | rb |
2e6ca1fcd3655aa37b40a2e976b3e44d09d0edbe | diff --git a/lib/requester/requester.js b/lib/requester/requester.js
index <HASH>..<HASH> 100644
--- a/lib/requester/requester.js
+++ b/lib/requester/requester.js
@@ -95,14 +95,15 @@ Requester.prototype.request = function (item, cb, scope) {
_.transform(cookieJar.getCookies(requestOptions.url), function (acc, cookie) {
acc.push(toChromeCookie(cookie));
}, []) : [],
+ codeReason = httpReasons.lookup(responseJSON.statusCode), // returns blank object if not found
legacyResponse = {
responseBody: responseString,
responseHeaders: responseJSON.headers,
responseTime: responseTime,
responseCode: {
code: responseJSON.statusCode,
- name: httpReasons[responseJSON.statusCode] ? httpReasons[responseJSON.statusCode].name : '',
- detail: httpReasons[responseJSON.statusCode] ? httpReasons[responseJSON.statusCode].detail: ''
+ name: codeReason.name || '',
+ detail: codeReason.detail || ''
},
responseCookies: cookies
}, | Add appropriate usage of http-reasons. Pending addition of tests to check before-after of this commit's regression | postmanlabs_postman-runtime | train | js |
778b8af4f56ceb4a4dd96f33acba2fcdcba70b02 | diff --git a/spec/support/rake_tasks.rb b/spec/support/rake_tasks.rb
index <HASH>..<HASH> 100644
--- a/spec/support/rake_tasks.rb
+++ b/spec/support/rake_tasks.rb
@@ -14,26 +14,4 @@ namespace :test do
sleep 5
puts " ok, going ahead!"
end
-
- namespace :vcr do
- task :mock_authorization_bearer do
- cassettes_path = File.expand_path '../../fixtures/vcr_cassettes', __FILE__
- cassettes_path = File.join cassettes_path, "**/*.yml"
-
- Dir.glob(cassettes_path).each do |file|
- cassette = File.read file
- cassette = YAML.load cassette
- cassette["http_interactions"].each do |interaction|
- # We're not using Hash#dig to keep compatibility with old Rubies
- next unless interaction.has_key? "request"
- next unless interaction["request"].has_key? "headers"
- next unless interaction["request"]["headers"].has_key? "Authorization"
-
- interaction["request"]["headers"]["Authorization"] = ["Bearer MOCK_AUTHORIZATION_BEARER"]
- end
- cassette = YAML.dump cassette
- cassette = File.write file, cassette
- end
- end
- end
end | Removes rake task to filter out OAuth bearer
This isn't needed since we scrub it using a VCR feature, we can
thank @Aupajo for his patch 1d<I>e. | Jesus_dropbox_api | train | rb |
3fcf53114a2dffb7d8c496599c42ad461f95d95c | diff --git a/pyxmpp/streamtls.py b/pyxmpp/streamtls.py
index <HASH>..<HASH> 100644
--- a/pyxmpp/streamtls.py
+++ b/pyxmpp/streamtls.py
@@ -149,19 +149,20 @@ class StreamTLSMixIn:
"""Read data pending on the stream socket and pass it to the parser."""
if self.eof:
return
- try:
+ while True:
try:
- r=self.socket.read()
- except TypeError:
- # workarund for M2Crypto 0.13.1 'feature'
- r=self.socket.read(self.socket)
- if r is None:
+ try:
+ r=self.socket.read()
+ except TypeError:
+ # workarund for M2Crypto 0.13.1 'feature'
+ r=self.socket.read(self.socket)
+ if r is None:
+ return
+ except socket.error,e:
+ if e.args[0]!=errno.EINTR:
+ raise
return
- except socket.error,e:
- if e.args[0]!=errno.EINTR:
- raise
- return
- self._feed_reader(r)
+ self._feed_reader(r)
def _read(self):
"""Read data pending on the stream socket and pass it to the parser.""" | - fixed delay on encrypted stream input: now all data is processed when received | Jajcus_pyxmpp2 | train | py |
cc00919eb9a7b59181c8bf90f842a776e57e9ffb | diff --git a/lib/hive/diagnostic.rb b/lib/hive/diagnostic.rb
index <HASH>..<HASH> 100644
--- a/lib/hive/diagnostic.rb
+++ b/lib/hive/diagnostic.rb
@@ -1,6 +1,7 @@
require 'hive'
require 'device_api/android'
-
+require 'hive/results'
+
module Hive
class Diagnostic
attr_accessor :config, :last_run, :message, :device
@@ -8,7 +9,6 @@ module Hive
def initialize(config, serial)
@config = config
@serial = serial
- @device = self.device
end
def should_run?
@@ -27,13 +27,11 @@ module Hive
def pass(message= {}, data = {})
Hive.logger.info(message)
- require 'hive/results'
Hive::Results.new("pass", message, data )
end
def fail(message ={}, data = {})
Hive.logger.info(message)
- require 'hive/results'
Hive::Results.new("fail", message, data)
end
end | Moved device_api access to subclasses | bbc_hive-runner | train | rb |
95d407452b619b785efa7a58cc6cd5d6f14c8e72 | diff --git a/test/empower_test.js b/test/empower_test.js
index <HASH>..<HASH> 100644
--- a/test/empower_test.js
+++ b/test/empower_test.js
@@ -386,4 +386,42 @@ test('the case when assertion function call is not listed in patterns (even if m
});
+suite('on rethrowing Error', function () {
+ test('rethrow behavior - name replacement', function () {
+ try {
+ try {
+ throw new baseAssert.AssertionError({
+ actual: 'hoge',
+ expected: 'fuga',
+ operator: '==',
+ message: 'HOOOOOOOO'
+ });
+ } catch (e) {
+ e.foo = 'bar';
+ e.message = 'BARRRRRRRR';
+ throw e;
+ }
+ } catch (e) {
+ baseAssert.equal(e.message, 'BARRRRRRRR');
+ }
+ });
+ test('rethrow behavior - new props', function () {
+ try {
+ try {
+ throw new baseAssert.AssertionError({
+ actual: 'hoge',
+ expected: 'fuga',
+ operator: '==',
+ message: 'HOOOOOOOO'
+ });
+ } catch (e) {
+ e.foo = 'bar';
+ throw e;
+ }
+ } catch (e) {
+ baseAssert.equal(e.foo, 'bar');
+ }
+ });
+});
+
})); | test(empower-core): add learning test on rethrowing Error | twada_empower-core | train | js |
8327055239503fa422a8f5c6613298babfcc1935 | diff --git a/moto/sns/responses.py b/moto/sns/responses.py
index <HASH>..<HASH> 100644
--- a/moto/sns/responses.py
+++ b/moto/sns/responses.py
@@ -250,7 +250,8 @@ class SNSResponse(BaseResponse):
"PlatformApplications": [{
"PlatformApplicationArn": application.arn,
"attributes": application.attributes,
- } for application in applications]
+ } for application in applications],
+ "NextToken": None
},
"ResponseMetadata": {
"RequestId": "384ac68d-3775-11df-8963-01868b7c937c", | Update responses.py
Add a dummy NextToken to sns.list_platform_applications. Ideally the library would actually paginate, but this should be an alright change in the mean time. | spulec_moto | train | py |
b24cd2ce6af94f6c9c7306e882b6b3f907262c10 | diff --git a/hack/e2e.go b/hack/e2e.go
index <HASH>..<HASH> 100644
--- a/hack/e2e.go
+++ b/hack/e2e.go
@@ -207,7 +207,9 @@ export KUBECFG="` + *root + `/cluster/kubecfg.sh -expect_version_match"
source "` + *root + `/cluster/kube-env.sh"
source "` + *root + `/cluster/${KUBERNETES_PROVIDER}/util.sh"
-detect-project
+if [[ ${KUBERNETES_PROVIDER} == "gce" ]]; then
+ detect-project
+fi
` | Allow e2e tests to run with vagrant | kubernetes_test-infra | train | go |
f322bb0a1ea360a8470c0413415e86c239a344b6 | diff --git a/dynamic_dynamodb/__init__.py b/dynamic_dynamodb/__init__.py
index <HASH>..<HASH> 100644
--- a/dynamic_dynamodb/__init__.py
+++ b/dynamic_dynamodb/__init__.py
@@ -27,7 +27,7 @@ import core
from daemon import Daemon
from config_handler import CONFIGURATION as configuration
-VERSION = '1.2.0'
+VERSION = '1.3.0-SNAPSHOT'
class DynamicDynamoDBDaemon(Daemon):
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ from setuptools import setup
setup(name='dynamic-dynamodb',
- version='1.2.0',
+ version='1.3.0-SNAPSHOT',
license='Apache License, Version 2.0',
description='Automatic provisioning for AWS DynamoDB tables',
author='Sebastian Dahlgren', | Bumped version to <I>-SNAPSHOT | sebdah_dynamic-dynamodb | train | py,py |
0124a1ef3abe758de9a86b91fa5fba82d09d542c | diff --git a/salt/states/file.py b/salt/states/file.py
index <HASH>..<HASH> 100644
--- a/salt/states/file.py
+++ b/salt/states/file.py
@@ -1280,6 +1280,8 @@ def comment(name, regex, char='#', backup='.bak'):
this pattern will be wrapped in parenthesis and will move any
preceding/trailing ``^`` or ``$`` characters outside the parenthesis
(e.g., the pattern ``^foo$`` will be rewritten as ``^(foo)$``)
+ Note that you _need_ the leading ^, otherwise each time you run highstate,
+ another comment char will be inserted.
char : ``#``
The character to be inserted at the beginning of a line in order to
comment it out | Docs: file.comment actually needs the leading dash ^ | saltstack_salt | train | py |
c41427d9b2d2ab8194f873f76fd4dedc5d0fb308 | diff --git a/gorm/app/gorm.go b/gorm/app/gorm.go
index <HASH>..<HASH> 100644
--- a/gorm/app/gorm.go
+++ b/gorm/app/gorm.go
@@ -63,7 +63,7 @@ func InitDB() {
params := DbInfo{}
params.DbDriver = revel.Config.StringDefault("db.driver", "sqlite3")
params.DbHost = revel.Config.StringDefault("db.host", "localhost")
- if params.DbDriver == "sqlite" && params.DbHost == "localhost" {
+ if params.DbDriver == "sqlite3" && params.DbHost == "localhost" {
params.DbHost = "/tmp/app.db"
}
params.DbUser = revel.Config.StringDefault("db.user", "default")
@@ -75,7 +75,7 @@ func InitDB() {
// GormController controllers begin, commit and rollback transactions
type GormController struct {
- revel.Controller
+ *revel.Controller
Txn *gorm.DB
} | Update gorm.go
pointer to revel controller
fix for sqlite3 driver default options | revel_modules | train | go |
720ec7b49911ac012d47ac590659d40753f74251 | diff --git a/test/analyzerTests.js b/test/analyzerTests.js
index <HASH>..<HASH> 100644
--- a/test/analyzerTests.js
+++ b/test/analyzerTests.js
@@ -39,9 +39,20 @@ describe('wiktionary parser', function() {
expect(w.meanings.length).to.be.equal(2);
});
describe('meaning 1', function() {
- it('should have etymology');
- it('should have noun role');
- it('should have verb role');
+ var m = null;
+ before(function() {
+ m = r["en"].meanings[0];
+ });
+ it('should have etymology', function() {
+ expect(m).to.have.property("etymology");
+ });
+ it('should have 2 roles', function() {
+ expect(m).to.have.property("roles");
+ expect(m.roles).to.be.ok;
+ expect(m.roles.length).to.be.equal(2);
+ }););
+ it('should have noun role');
+ it('should have verb role');
});
describe('meaning 2', function() {
it('should have etymology'); | parses amount of etymology | darvin_enwiktionary-analyzer | train | js |
cf226524b27039b89893db80ea8e0f978dd85b29 | diff --git a/src/calendar-heatmap.component.js b/src/calendar-heatmap.component.js
index <HASH>..<HASH> 100644
--- a/src/calendar-heatmap.component.js
+++ b/src/calendar-heatmap.component.js
@@ -154,15 +154,15 @@ class CalendarHeatmap extends React.Component {
let getSummary = () => {
var summary = this.props.data.reduce((summary, d) => {
if (moment(d.date).year() === date.year()) {
- for (var i = 0; i < d.summary.length; i++) {
- if (!summary[d.summary[i].name]) {
- summary[d.summary[i].name] = {
- 'value': d.summary[i].value,
+ d.summary.map(item => {
+ if (!summary[item.name]) {
+ summary[item.name] = {
+ 'value': item.value,
}
} else {
- summary[d.summary[i].name].value += d.summary[i].value
+ summary[item.name].value += item.value
}
- }
+ })
}
return summary
}, {}) | Refactor draw global overview to map over the summary instead of using a traditional for loop | g1eb_reactjs-calendar-heatmap | train | js |
ae7677705b94029911b5eb3d79e469cf8f7a6945 | diff --git a/inc/cache-cleanup.php b/inc/cache-cleanup.php
index <HASH>..<HASH> 100644
--- a/inc/cache-cleanup.php
+++ b/inc/cache-cleanup.php
@@ -60,11 +60,11 @@ class CareLib_Cache_Cleanup {
*
* @since 0.2.0
* @access protected
- * @param int $id The ID of the post to delete the cache for.
+ * @param int $post_id The ID of the post to delete the cache for.
* @return bool true when cache is deleted, false otherwise
*/
- protected function delete_image_cache( $id ) {
- return wp_cache_delete( $id, "{$this->prefix}_image_grabber" );
+ protected function delete_image_cache( $post_id ) {
+ return wp_cache_delete( $post_id, "{$this->prefix}_image_grabber" );
}
/** | This should probably be a little clearer | cipherdevgroup_carelib | train | php |
f3b189182e6fa7b8b001f8d8defea5049e2709d4 | diff --git a/bika/lims/content/laboratory.py b/bika/lims/content/laboratory.py
index <HASH>..<HASH> 100644
--- a/bika/lims/content/laboratory.py
+++ b/bika/lims/content/laboratory.py
@@ -48,7 +48,7 @@ DEFAULT_ACCREDITATION_PAGE_HEADER = """${lab_name} has been accredited as
${accreditation_standard} conformant by ${accreditation_body_abbr},
${accreditation_body_name}<br/><br/> ${accreditation_body_abbr} is the single
national accreditation body assessing testing and calibration laboratories for
-compliance to the ISO/IEC 17025 standard.<br/></br/>\n The following analysis
+compliance to the ISO/IEC 17025 standard.<br/><br/>\n The following analysis
services have been included in the ${accreditation_body_abbr} schedule of
Accreditation for this Laboratory:
""" | Fix bad formed html (#<I>) | senaite_senaite.core | train | py |
6e114358b0e2bc58a45fc1b1850de46940025621 | diff --git a/php/src/DisposableEmailChecker.php b/php/src/DisposableEmailChecker.php
index <HASH>..<HASH> 100644
--- a/php/src/DisposableEmailChecker.php
+++ b/php/src/DisposableEmailChecker.php
@@ -14,6 +14,9 @@ namespace VBoctor\Email;
*/
class DisposableEmailChecker
{
+ /**
+ * An associative array with domains as the keys.
+ */
private static $domains_array = null;
/**
@@ -29,7 +32,7 @@ class DisposableEmailChecker
DisposableEmailChecker::$domains_array = DisposableEmailChecker::_load_file( 'domains' );
}
- return in_array( $t_domain, DisposableEmailChecker::$domains_array );
+ return isset( DisposableEmailChecker::$domains_array[$t_domain] );
}
/**
@@ -74,7 +77,8 @@ class DisposableEmailChecker
continue;
}
- $t_result_array[] = strtolower( $t_entry );
+ $t_domain = strtolower( $t_entry );
+ $t_result_array[$t_domain] = true;
}
return $t_result_array; | Speed up domain checks by using assoc array | vboctor_disposable_email_checker | train | php |
a13f8d92fde7e377e05c19a1b7cd4b66f0e0c28a | diff --git a/dev_menu.py b/dev_menu.py
index <HASH>..<HASH> 100755
--- a/dev_menu.py
+++ b/dev_menu.py
@@ -118,10 +118,13 @@ COMMANDS = OrderedDict([
('[Local] Python Unit tests',
"./py3_venv/bin/nosetests -v tests/python/unittest/"
),
- ('[Website and docs build] Will build to docs/_build/html/',
- "ci/docker/runtime_functions.sh deploy_docs"),
- ('[Docker] sanity_check. Check for linting and code formatting.',
- "ci/build.py --platform ubuntu_cpu /work/runtime_functions.sh sanity_check"),
+ ('[Docker] Website and docs build outputs to "docs/_build/html/"',
+ "ci/build.py --platform ubuntu_cpu /work/runtime_functions.sh deploy_docs"),
+ ('[Docker] sanity_check. Check for linting and code formatting and licenses.',
+ [
+ "ci/build.py --platform ubuntu_cpu /work/runtime_functions.sh sanity_check",
+ "ci/build.py --platform ubuntu_cpu /work/runtime_functions.sh nightly_test_rat_check",
+ ]),
('[Docker] Python3 CPU unittests',
[
"ci/build.py --platform ubuntu_cpu /work/runtime_functions.sh build_ubuntu_cpu_openblas", | Add license check to dev_menu, docs build with docker (#<I>) | apache_incubator-mxnet | train | py |
90af24cc55003dc924857e43d18966a7a71cc9a9 | diff --git a/test/integration/read.js b/test/integration/read.js
index <HASH>..<HASH> 100644
--- a/test/integration/read.js
+++ b/test/integration/read.js
@@ -327,6 +327,8 @@ module.exports = function (createFn, setup, dismantle) {
}, (err, res, body) => {
assert.ok(!err)
assert.equal(res.statusCode, 400)
+ assert.equal(body.description, 'invalid_json')
+ assert.equal(body.statusCode, 400)
done()
})
}) | chore(test): confirm invalid json doesn't throw
Closes #<I> | florianholzapfel_express-restify-mongoose | train | js |
1907cbd6537401bf04b7181491df60821a9d1e66 | diff --git a/kerncraft/kerncraft.py b/kerncraft/kerncraft.py
index <HASH>..<HASH> 100755
--- a/kerncraft/kerncraft.py
+++ b/kerncraft/kerncraft.py
@@ -299,13 +299,14 @@ def run(parser, args, output_file=sys.stdout):
# define constants
required_consts = [v[1] for v in kernel.variables.values() if v[1] is not None]
required_consts += [[l['start'], l['stop']] for l in kernel.get_loop_stack()]
- required_consts += [i for a in kernel.sources.values() for i in a]
- required_consts += [i for a in kernel.destinations.values() for i in a]
+ required_consts += [i for a in kernel.sources.values() for i in a if i is not None]
+ required_consts += [i for a in kernel.destinations.values() for i in a if i is not None]
# split into individual consts
required_consts = [i for l in required_consts for i in l]
required_consts = set([i for l in required_consts for i in l.free_symbols])
# remove loop indices
required_consts -= loop_indices
+
if len(required_consts) > 0:
# build defines permutations
define_dict = {} | filtering Nones from indices | RRZE-HPC_kerncraft | train | py |
b42802224e12398a5733c414a93174f7ddc2011d | diff --git a/lib/acmesmith/challenge_responders/route53.rb b/lib/acmesmith/challenge_responders/route53.rb
index <HASH>..<HASH> 100644
--- a/lib/acmesmith/challenge_responders/route53.rb
+++ b/lib/acmesmith/challenge_responders/route53.rb
@@ -164,7 +164,9 @@ module Acmesmith
def hosted_zone_list
@hosted_zone_list ||= begin
@route53.list_hosted_zones.each.flat_map do |page|
- page.hosted_zones.map { |zone| [zone.name, zone.id] }
+ page.hosted_zones
+ .reject { |zone| zone.config.private_zone }
+ .map { |zone| [zone.name, zone.id] }
end.group_by(&:first).map { |domain, kvs| [domain, kvs.map(&:last)] }.to_h.merge(hosted_zone_map)
end
end | route<I>: Ignore private hosted zone
Using a private hosted zone is useless on dns-<I> validation. Ignore it
by default (manual specification of such hosted zones using hosted_zone_maps
is still allowed) | sorah_acmesmith | train | rb |
71a2b628fd338c00e60da6dc6c426ba4953964a5 | diff --git a/packages/swagger2openapi/index.js b/packages/swagger2openapi/index.js
index <HASH>..<HASH> 100644
--- a/packages/swagger2openapi/index.js
+++ b/packages/swagger2openapi/index.js
@@ -177,7 +177,7 @@ function processParameter(param,op,path,index,openapi) {
for (var mimetype of consumes) {
result.content[mimetype] = {};
if (param.description) result.content[mimetype].description = param.description;
- result.content[mimetype].schema = param.schema||{};
+ result.content[mimetype].schema = common.clone(param.schema)||{};
}
}
@@ -269,7 +269,7 @@ function processPaths(container,containerName,options,requestBodyCache,openapi)
response.content = {};
for (var mimetype of produces) {
response.content[mimetype] = {};
- response.content[mimetype].schema = response.schema;
+ response.content[mimetype].schema = common.clone(response.schema);
}
delete response.schema;
} | Clone schemas to prevent internal refs in yaml | Mermade_oas-kit | train | js |
18005b19b09ec746c682739ad0a834f1294b19f6 | diff --git a/manifest.php b/manifest.php
index <HASH>..<HASH> 100755
--- a/manifest.php
+++ b/manifest.php
@@ -29,7 +29,7 @@ return array(
'label' => 'QTI test model',
'description' => 'TAO QTI test implementation',
'license' => 'GPL-2.0',
- 'version' => '11.5.1',
+ 'version' => '11.6.0',
'author' => 'Open Assessment Technologies',
'requires' => array(
'taoTests' => '>=6.4.0',
diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php
index <HASH>..<HASH> 100644
--- a/scripts/update/Updater.php
+++ b/scripts/update/Updater.php
@@ -1471,5 +1471,14 @@ class Updater extends \common_ext_ExtensionUpdater {
}
$this->skip('11.1.0', '11.5.1');
+
+ if ($this->isVersion('11.5.1')) {
+ $extension = \common_ext_ExtensionsManager::singleton()->getExtensionById('taoQtiTest');
+ $config = $extension->getConfig('testRunner');
+ $config['enable-validate-responses'] = false;
+ $extension->setConfig('testRunner', $config);
+
+ $this->setVersion('11.6.0');
+ }
}
} | Bump minor version (again)
tao-<I> | oat-sa_extension-tao-testqti | train | php,php |
9f4a9d0f6b0f525a1b8408d822d2b5b75f45b737 | diff --git a/lib/status.js b/lib/status.js
index <HASH>..<HASH> 100644
--- a/lib/status.js
+++ b/lib/status.js
@@ -223,6 +223,7 @@ Status.prototype.getConsulHealthcheck = function(options) {
consulParams.interval = options && options.interval || '10s';
consulParams.notes = options && options.notes || this.config.name + ' Kardia health check';
consulParams.http = 'http://'+host+':'+this.config.port+'/health';
+ consulParams.service_id = options && options.service_id || this.config.name;
return consulParams;
}; | Bind Consul health check only against the particular service | pipedrive_kardia | train | js |
b734988f22f08e71df93b89d7df7b7ee9f625fb0 | diff --git a/src/API/Eth.php b/src/API/Eth.php
index <HASH>..<HASH> 100644
--- a/src/API/Eth.php
+++ b/src/API/Eth.php
@@ -89,11 +89,15 @@ class Eth
* @throws \EthereumRPC\Exception\ResponseObjectException
* @throws \HttpClient\Exception\HttpClientException
*/
- public function getBlock(int $number): Block
+ public function getBlock(?int $number = null): ?Block
{
- $blockHex = '0x' . dechex($number);
+ $blockHex = $number ? '0x' . dechex($number) : "latest";
$request = $this->client->jsonRPC("eth_getBlockByNumber", null, [$blockHex, false]);
$block = $request->get("result");
+ if (is_null($block)) {
+ return null; // Block not found
+ }
+
if (!is_array($block)) {
throw GethException::unexpectedResultType("eth_getBlockByNumber", "object", gettype($block));
} | getBlock "latest" as default, and null return type | furqansiddiqui_ethereum-rpc | train | php |
69f2624c7caa9c4380a455cb094a1a8602f91415 | diff --git a/lib/features/move/MoveEvents.js b/lib/features/move/MoveEvents.js
index <HASH>..<HASH> 100644
--- a/lib/features/move/MoveEvents.js
+++ b/lib/features/move/MoveEvents.js
@@ -67,7 +67,7 @@ function MoveEvents(eventBus, dragSupport, modeling, selection, rules) {
// add drag target to selection if not done already
if (dragShapes.indexOf(dragContext.element) === -1) {
- dragShapes.push(dragContext.element);
+ dragShapes = [ dragContext.element ];
}
// ensure we remove nested elements in the collection | fix(move): move current element only if not selected | bpmn-io_diagram-js | train | js |
69090ad7c7d46a28f001191c6f73c553220b1cc4 | diff --git a/src/CFPropertyList/CFDate.php b/src/CFPropertyList/CFDate.php
index <HASH>..<HASH> 100644
--- a/src/CFPropertyList/CFDate.php
+++ b/src/CFPropertyList/CFDate.php
@@ -142,13 +142,4 @@ class CFDate extends CFType
}
return gmmktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
}
-
- public function toArray()
- {
- if (class_exists('DateTime')) {
- return new DateTime('@'.intval($this->getValue()), new DateTimeZone('UTC'));
- }
-
- return parent::getValue();
- }
}
diff --git a/src/CFPropertyList/CFTypeDetector.php b/src/CFPropertyList/CFTypeDetector.php
index <HASH>..<HASH> 100644
--- a/src/CFPropertyList/CFTypeDetector.php
+++ b/src/CFPropertyList/CFTypeDetector.php
@@ -155,7 +155,7 @@ class CFTypeDetector
case is_object($value):
// DateTime should be CFDate
- if (class_exists(DateTime::class) && $value instanceof DateTime) {
+ if ($value instanceof DateTime) {
return new CFDate($value->getTimestamp());
} | fix(CFDate): reverse the symmetry issue
DateTime class always exists for php <I> or later, then no need to test its availability
see #<I> | TECLIB_CFPropertyList | train | php,php |
7da6ca999e8c3b89e233895c7105455c5d307743 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -14,13 +14,13 @@ setup(
download_url='https://github.com/lmas/opensimplex/releases',
author='A. Svensson',
author_email='[email protected]',
- license='Public Domain',
+ license='MIT',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
classifiers=[ # See: http://pypi.python.org/pypi?%3Aaction=list_classifiers
'Development Status :: 4 - Beta',
- 'License :: Public Domain',
+ 'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Topic :: Scientific/Engineering :: Mathematics', | Whops, missed changing license in setup too. | lmas_opensimplex | train | py |
2e4f1b7cfb47e75a6bc3544a596c336ca0d621c9 | diff --git a/lib/nano.js b/lib/nano.js
index <HASH>..<HASH> 100644
--- a/lib/nano.js
+++ b/lib/nano.js
@@ -18,7 +18,7 @@ var querystring = require('querystring');
var request = require('request');
var errs = require('errs');
var _ = require('underscore');
-var follow = require('follow');
+var follow = require('cloudant-follow');
var logger = require('./logger');
var nano; | Use cloudant-follow (#<I>) | apache_couchdb-nano | train | js |
009737189e8cc7ed927caff21a4df021ed4b052c | diff --git a/test/index.js b/test/index.js
index <HASH>..<HASH> 100644
--- a/test/index.js
+++ b/test/index.js
@@ -37,6 +37,7 @@ describe('sass-jspm-importer', function() {
beforeEach(function() {
// cannot just mock fs since it uses libsass..
fs.writeFileSync('test/fakefile.scss', '#id{display:block}');
+ fs.writeFileSync('test/_fakepartial.scss', '#id{display:inline}');
});
afterEach(function() {
fs.unlinkSync('test/fakefile.scss');
@@ -53,6 +54,18 @@ describe('sass-jspm-importer', function() {
done();
});
});
+ it('should import partials', function(done) {
+ sass.render({
+ data: '@import "jspm:fakepartial";',
+ outputStyle: 'compressed',
+ importer: sassJspm.importer
+ }, function(err, result) {
+ if(err) throw err;
+
+ expect(result.css.toString()).to.equal('#id{display:inline}\n');
+ done();
+ });
+ });
});
describe('resolve function', function() {
it('should resolve the jspm path', function(done) { | Add a test-case for sass partials importing | idcware_node-sass-jspm-importer | train | js |
a544f265ab073414fec3da8cc5d9fe4f42bd0fc1 | diff --git a/src/watch.js b/src/watch.js
index <HASH>..<HASH> 100644
--- a/src/watch.js
+++ b/src/watch.js
@@ -30,7 +30,7 @@ function watch(bitbundler, options) {
const watcher = chokidar.watch(filesToWatch, settings);
const watching = utils.arrayToObject(filesToWatch);
- let nextPaths = {}, inProgress;
+ let nextPaths = {}, inProgress = false;
logger.log("started");
@@ -44,9 +44,14 @@ function watch(bitbundler, options) {
}
function onChange(filepath) {
- const absolutePath = makeAbsolutePath(filepath);
+ // NOTE: chokidar will only trigger change events for one file at a time.
+ // However, when bundling is in progress we queue up all files that change
+ // so that when bundling finishes, we can kick off another build with all
+ // the files that have changed. To consolidate the behavior for those two
+ // different use cases, we normalize all file changes to be an array.
const filepaths = utils
- .toArray(absolutePath)
+ .toArray(filepath)
+ .map(makeAbsolutePath)
.filter(fp => bitbundler.loader.hasModule(fp));
if (inProgress) { | Fixing support for file watcher to update multiple files at once
In a previous change I broke the correct processing of multiple file changes that occur when bundling is in progress and more files change are detected. In that case we queue all those file changes and process them all at once bundling finishes. | MiguelCastillo_bit-bundler | train | js |
316d28b461945f102f2b5757fc674ebdbf5ac9ca | diff --git a/src/rez/build_process.py b/src/rez/build_process.py
index <HASH>..<HASH> 100644
--- a/src/rez/build_process.py
+++ b/src/rez/build_process.py
@@ -307,10 +307,9 @@ class LocalSequentialBuildProcess(StandardBuildProcess):
"""
def _use_existing_context_file(self, rxt_file):
- if os.path.exists(rxt_file):
- if os.path.getmtime(self.package.metafile) < os.path.getmtime(rxt_file):
- return True
- return False
+ return os.path.exists(rxt_file) \
+ and (os.path.getmtime(self.package.path)
+ < os.path.getmtime(rxt_file))
def _build(self, install_path, build_path, clean=False, install=False):
base_install_path = self._get_base_install_path(install_path)
@@ -335,7 +334,6 @@ class LocalSequentialBuildProcess(StandardBuildProcess):
# resolve build environment and save to file
rxt_path = os.path.join(build_subdir, "build.rxt")
-
if self._use_existing_context_file(rxt_path):
self._pr("Loading existing environment context...")
r = ResolvedContext.load(rxt_path) | merged PR: Build Time Dirty Context #<I> | nerdvegas_rez | train | py |
74d4220f556eb46af4f9efa0f13c8fd55e6ccd46 | diff --git a/lib/te3270.rb b/lib/te3270.rb
index <HASH>..<HASH> 100644
--- a/lib/te3270.rb
+++ b/lib/te3270.rb
@@ -58,8 +58,8 @@ module TE3270
platform.screenshot(filename)
end
- def wait_for_string(str)
- platform.wait_for_string(str)
+ def wait_for_string(str, row, column)
+ platform.wait_for_string(str, row, column)
end
def wait_for_host(seconds=5)
diff --git a/spec/lib/te3270_spec.rb b/spec/lib/te3270_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/te3270_spec.rb
+++ b/spec/lib/te3270_spec.rb
@@ -29,8 +29,8 @@ describe TE3270 do
end
it 'should use the platform to wait for a string to appear on the screen' do
- platform.should_receive(:wait_for_string).with('The String')
- screen_object.wait_for_string('The String')
+ platform.should_receive(:wait_for_string).with('The String', 2, 4)
+ screen_object.wait_for_string('The String', 2, 4)
end
it 'should use the platform to wait for the host to be quiet' do | added row and column to wait_for_string | cheezy_te3270 | train | rb,rb |
7895ee8a5096bac3ff58ee64c084d4091de47f9e | diff --git a/packages/NodeTypeResolver/src/PerNodeTypeResolver/MethodCallTypeResolver.php b/packages/NodeTypeResolver/src/PerNodeTypeResolver/MethodCallTypeResolver.php
index <HASH>..<HASH> 100644
--- a/packages/NodeTypeResolver/src/PerNodeTypeResolver/MethodCallTypeResolver.php
+++ b/packages/NodeTypeResolver/src/PerNodeTypeResolver/MethodCallTypeResolver.php
@@ -12,6 +12,10 @@ use Rector\Node\Attribute;
use Rector\NodeTypeResolver\Contract\PerNodeTypeResolver\PerNodeTypeResolverInterface;
use Rector\NodeTypeResolver\TypeContext;
+/**
+ * This resolves return type of method call,
+ * not types of its elements.
+ */
final class MethodCallTypeResolver implements PerNodeTypeResolverInterface
{
/** | add note to MethodCallTypeResolver | rectorphp_rector | train | php |
19e12e4bd813a90c723f8dd9702cb0c6fea4ba2b | diff --git a/lib/weblib.php b/lib/weblib.php
index <HASH>..<HASH> 100644
--- a/lib/weblib.php
+++ b/lib/weblib.php
@@ -3629,9 +3629,9 @@ function print_navigation ($navigation, $separator=0, $return=false) {
$url = $navitem['url'];
if (empty($url)) {
- $output .= '<li class="first">'."$separator $title</li>\n";
+ $output .= '<li>'."$separator $title</li>\n";
} else {
- $output .= '<li class="first">'."$separator\n<a ".$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'
+ $output .= '<li>'."$separator\n<a ".$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'
.$url.'">'."$title</a>\n</li>\n";
}
} | theme / navbar: MDL-<I> every link in the nav bar was getting class="first"! | moodle_moodle | train | php |
071d73a74d3c24a72cc12b6896d251727d60294e | diff --git a/environs/manual/winrmprovisioner/winrmprovisioner.go b/environs/manual/winrmprovisioner/winrmprovisioner.go
index <HASH>..<HASH> 100644
--- a/environs/manual/winrmprovisioner/winrmprovisioner.go
+++ b/environs/manual/winrmprovisioner/winrmprovisioner.go
@@ -124,7 +124,7 @@ func InitAdministratorUser(args *manual.ProvisionMachineArgs) error {
logger.Infof("Trying https client as user %s on %s", args.Host, args.User)
err := args.WinRM.Client.Ping()
if err == nil {
- logger.Infof("Https connection is enabled on the host %s with user", args.Host, args.User)
+ logger.Infof("Https connection is enabled on the host %s with user %s", args.Host, args.User)
return nil
} | Correct a call to Infof which fails to build | juju_juju | train | go |
58e00f45cb59cedb546f9d8b117234611cd3e2a3 | diff --git a/tools/interop_matrix/client_matrix.py b/tools/interop_matrix/client_matrix.py
index <HASH>..<HASH> 100644
--- a/tools/interop_matrix/client_matrix.py
+++ b/tools/interop_matrix/client_matrix.py
@@ -284,6 +284,7 @@ LANG_RELEASE_MATRIX = {
('v1.45.1', ReleaseInfo()),
('v1.46.0', ReleaseInfo()),
('v1.47.0', ReleaseInfo()),
+ ('v1.48.0', ReleaseInfo()),
]),
'python':
OrderedDict( | client image for java release <I> (#<I>) | grpc_grpc | train | py |
df2ae41b59e42507d06e8888c53f9558a890c9d6 | diff --git a/Select2Widget.php b/Select2Widget.php
index <HASH>..<HASH> 100644
--- a/Select2Widget.php
+++ b/Select2Widget.php
@@ -115,9 +115,17 @@ class Select2Widget extends \yii\widgets\InputWidget
public function run()
{
if ($this->hasModel()) {
- echo Html::activeDropDownList($this->model, $this->attribute, $this->items, $this->options);
+ if (isset($this->items)) {
+ echo Html::activeDropDownList($this->model, $this->attribute, $this->items, $this->options);
+ } else {
+ echo Html::activeTextInput($this->model, $this->attribute, $this->options);
+ }
} else {
- echo Html::dropDownList($this->name, $this->value, $this->items, $this->options);
+ if (isset($this->items)) {
+ echo Html::dropDownList($this->name, $this->value, $this->items, $this->options);
+ } else {
+ echo Html::textInput($this->name, $this->value, $this->options);
+ }
}
$this->registerAssets();
} | render textInput instead of dropdownlist when items is not set | borodulin_yii2-select2 | train | php |
fb50362c11631c52e8cb92a7728542bc4b327a60 | diff --git a/etk/core.py b/etk/core.py
index <HASH>..<HASH> 100644
--- a/etk/core.py
+++ b/etk/core.py
@@ -3,6 +3,7 @@ from spacy_extractors import age_extractor as spacy_age_extractor
from spacy_extractors import social_media_extractor as spacy_social_media_extractor
from spacy_extractors import date_extractor as spacy_date_extractor
from spacy_extractors import address_extractor as spacy_address_extractor
+from spacy_extractors import customized_extractor as custom_spacy_extractor
from data_extractors import landmark_extraction
from data_extractors import dictionary_extractor
from data_extractors import regex_extractor
@@ -948,14 +949,13 @@ class Core(object):
def extract_using_custom_spacy(self, d, config):
field_name = config[_FIELD_NAME]
field_rules = self.load_json_file(self.get_spacy_field_rules_from_config(field_name))
- results = None
if not self.nlp:
self.prep_spacy()
- nlp_doc = self.nlp(d[_TOKENS])
+ nlp_doc = self.nlp(d[_TEXT])
# call the custom spacy extractor
- # results = custom_spacy_extractor.extract(field_rules, nlp_doc, self.nlp)
+ results = custom_spacy_extractor.extract(field_rules, nlp_doc, self.nlp)
return results
def extract_using_spacy(self, d, config): | call the custom spacy extractor | usc-isi-i2_etk | train | py |
2abf2478efd6b468a2284fbcc9b29886060a48e7 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -1,7 +1,7 @@
/**
* Pon task to bundle browser script
* @module pon-task-browser
- * @version 7.2.3
+ * @version 7.2.4
*/
'use strict' | [ci skip] Travis CI committed after build | realglobe-Inc_pon-task-browser | train | js |
21e15219be8e04b3fe25d05a65abfaef96830b9f | diff --git a/src/attributes.js b/src/attributes.js
index <HASH>..<HASH> 100644
--- a/src/attributes.js
+++ b/src/attributes.js
@@ -12,14 +12,7 @@ jQuery.fn.extend({
return access( this, name, value, true, jQuery.attr );
},
- removeAttr: function( name ) {
- if ( jQuery.isFunction( name ) ) {
- return this.each(function(i) {
- var self = jQuery(this);
- self.removeAttr( name.call(this, i, self.attr(name)) );
- });
- }
-
+ removeAttr: function( name, fn ) {
return this.each(function(){
jQuery.attr( this, name, "" );
if ( this.nodeType === 1 ) { | Removed .removeAttr(Function), it didn't really make sense. | jquery_jquery | train | js |
0e2b5a6c5c384f604fd265b7b370ebaf3343b0f2 | diff --git a/lib/aruba/api/core.rb b/lib/aruba/api/core.rb
index <HASH>..<HASH> 100644
--- a/lib/aruba/api/core.rb
+++ b/lib/aruba/api/core.rb
@@ -177,7 +177,7 @@ module Aruba
caller_location = caller_locations(1, 1).first
caller_file_line = "#{caller_location.path}:#{caller_location.lineno}"
aruba.logger.warn "Aruba's `expand_path` method was called with an absolute path at #{caller_file_line}"\
- '- which is not recommended. Change the call to pass a relative path or set '\
+ ', which is not recommended. Change the call to pass a relative path or set '\
'`config.allow_absolute_paths = true` to silence this warning'
end
file_name | Fix up punctuation issue in spec | cucumber_aruba | train | rb |
7980e9fa394f0814d95983990c945a93772b02b2 | diff --git a/config/software/chefdk.rb b/config/software/chefdk.rb
index <HASH>..<HASH> 100644
--- a/config/software/chefdk.rb
+++ b/config/software/chefdk.rb
@@ -62,7 +62,7 @@ build do
'fauxhai' => '2.2.0',
'rubocop' => '0.31.0',
'knife-spork' => '1.5.0',
- 'winrm-transport' => '1.0.1',
+ 'winrm-transport' => '1.0.2',
'knife-windows' => '0.8.5',
# Strainer build is hosed on windows
# 'strainer' => '0.15.0', | [chefdk] Bump winrm-transport version to <I>.
This patch release includes file copying fixes used by Test Kitchen when
targeting Windows instances. | chef_chef | train | rb |
f34cb78fabf82ce6d032f34c04e7fd1ccda67d77 | diff --git a/state/presence/presence.go b/state/presence/presence.go
index <HASH>..<HASH> 100644
--- a/state/presence/presence.go
+++ b/state/presence/presence.go
@@ -696,6 +696,13 @@ func (p *Pinger) prepare() error {
// sequence in use by the pinger.
func (p *Pinger) ping() (err error) {
logger.Tracef("pinging %q with seq=%d", p.beingKey, p.beingSeq)
+ defer func() {
+ // If the session is killed from underneath us, it panics when we
+ // try to copy it, so deal with that here.
+ if v := recover(); v != nil {
+ err = fmt.Errorf("%v", v)
+ }
+ }()
session := p.pings.Database.Session.Copy()
defer session.Close()
if p.delta == 0 { | Put the recover back in ping so we can land this thing | juju_juju | train | go |
28c296680949403c9d8a4a6d9d7b6b25def64680 | diff --git a/yotta/lib/pack.py b/yotta/lib/pack.py
index <HASH>..<HASH> 100644
--- a/yotta/lib/pack.py
+++ b/yotta/lib/pack.py
@@ -246,7 +246,7 @@ class Pack(object):
'''
upload_archive = os.path.join(self.path, 'upload.tar.gz')
fsutils.rmF(upload_archive)
- fd = os.open(upload_archive, os.O_CREAT | os.O_EXCL | os.O_RDWR)
+ fd = os.open(upload_archive, os.O_CREAT | os.O_EXCL | os.O_RDWR | getattr(os, "O_BINARY", 0))
with os.fdopen(fd, 'rb+') as tar_file:
tar_file.truncate()
self.generateTarball(tar_file) | Fix opening files in binary mode on Windows, again
The .tar.gz file generated by 'yotta publish' was invalid because
it was opened as text in Windows. | ARMmbed_yotta | train | py |
3540db98a4b4a7e31365c4478495bc0a703961e9 | diff --git a/src/Nether/Avenue/Router.php b/src/Nether/Avenue/Router.php
index <HASH>..<HASH> 100644
--- a/src/Nether/Avenue/Router.php
+++ b/src/Nether/Avenue/Router.php
@@ -545,8 +545,15 @@ class Router {
// booleans, nulls, and everything else that evals to them in the
// event those cases were needed.
+ $Source = $this->Query;
+
foreach($Input as $Key => $Value)
- if($Value === '') unset($Input[$Key]);
+ if($Value === '') {
+ unset($Input[$Key]);
+
+ if(array_key_exists($Key,$Source))
+ unset($Source[$Key]);
+ }
// if we only want what we passed then return the cleaned input.
@@ -555,7 +562,7 @@ class Router {
// else merge it with the current request as overwrites.
- return array_merge($this->Query,$Input);
+ return array_merge($Source,$Input);
}
public function | fix for desired effect on querymerger on emptys trings | netherphp_avenue | train | php |
7223f0fd1694e794e4e3d0ad60cb004dc3b48315 | diff --git a/cmd/kubeadm/app/util/apiclient/idempotency_test.go b/cmd/kubeadm/app/util/apiclient/idempotency_test.go
index <HASH>..<HASH> 100644
--- a/cmd/kubeadm/app/util/apiclient/idempotency_test.go
+++ b/cmd/kubeadm/app/util/apiclient/idempotency_test.go
@@ -69,7 +69,9 @@ func TestPatchNodeNonErrorCases(t *testing.T) {
t.Fatalf("failed to create node to fake client: %v", err)
}
conditionFunction := apiclient.PatchNodeOnce(client, tc.lookupName, func(node *v1.Node) {
- node.Name = "testNewNode"
+ node.Annotations = map[string]string{
+ "updatedBy": "test",
+ }
})
success, err := conditionFunction()
if err != nil { | Fix the unit test patch to not modify the node name | kubernetes_kubernetes | train | go |
ab2f788e8ca29608b4c8f6bed79b411c9afd9f23 | diff --git a/src/Attachment/AttachmentData.php b/src/Attachment/AttachmentData.php
index <HASH>..<HASH> 100644
--- a/src/Attachment/AttachmentData.php
+++ b/src/Attachment/AttachmentData.php
@@ -173,7 +173,7 @@ class AttachmentData implements AttachmentDataInterface
public function variantsAttribute()
{
if ( ! array_key_exists('variants', $this->attributes)) {
- return null;
+ return [];
}
return $this->attributes['variants']; | Fixed return value for empty variants attribute in attachment data | czim_laravel-paperclip | train | php |
e6aefec95cdfc9dc8302de065b0a4f19fd7e645b | diff --git a/test/mongohq/databases/databases-test.js b/test/mongohq/databases/databases-test.js
index <HASH>..<HASH> 100644
--- a/test/mongohq/databases/databases-test.js
+++ b/test/mongohq/databases/databases-test.js
@@ -15,7 +15,7 @@ var client = helpers.createClient('mongohq', 'database'),
testContext = {};
if (process.env.NOCK) {
- nock('https://www.mongohq.com')
+ nock('https://providers.mongohq.com')
.post('/provider/resources', "app_id=testDatabase&plan=free")
.reply(200, helpers.loadFixture('mongohq/database.json')) | [mongohq][tests] fix the tests with the new endpoint | pkgcloud_pkgcloud | train | js |
d222f8df1033f6373fa9b4c60735a96f4ba75567 | diff --git a/packages/wxa-cli/src/schedule.js b/packages/wxa-cli/src/schedule.js
index <HASH>..<HASH> 100644
--- a/packages/wxa-cli/src/schedule.js
+++ b/packages/wxa-cli/src/schedule.js
@@ -169,6 +169,9 @@ class Schedule {
compiler.destroy();
+ // empty loader handle this module.
+ if (dep.code == null && !dep.isFile) dep.code = dep.content;
+
debug('childNodes', childNodes.map((node)=>simplify(node)));
let children = childNodes.reduce((children, node)=>{
let child = this.findOrAddDependency(node, dep);
@@ -380,7 +383,7 @@ class Schedule {
},
wrap(mdl) {
mdl.code = `
- require('wxa://core-js/es.promise.finally.js');
+ require('wxa://es/promise.finally.js');
${mdl.code}
`; | fix(cli): wxa file should try to assign code after loader compile | wxajs_wxa | train | js |
19cfc8d9a859d7064d01532753cb3e3d840403fa | diff --git a/src/main/java/org/xerial/snappy/Snappy.java b/src/main/java/org/xerial/snappy/Snappy.java
index <HASH>..<HASH> 100755
--- a/src/main/java/org/xerial/snappy/Snappy.java
+++ b/src/main/java/org/xerial/snappy/Snappy.java
@@ -148,12 +148,13 @@ public class Snappy
// output: compressed
int uPos = uncompressed.position();
int uLen = uncompressed.remaining();
+ int cPos = compressed.position();
int compressedSize = impl.rawCompress(uncompressed, uPos, uLen, compressed,
- compressed.position());
+ cPos);
// pos limit
// [ ......BBBBBBB.........]
- compressed.limit(compressed.position() + compressedSize);
+ compressed.limit(cPos + compressedSize);
return compressedSize;
}
@@ -545,12 +546,13 @@ public class Snappy
int cPos = compressed.position();
int cLen = compressed.remaining();
+ int uPos = uncompressed.position();
// pos limit
// [ ......UUUUUU.........]
int decompressedSize = impl.rawUncompress(compressed, cPos, cLen, uncompressed,
- uncompressed.position());
- uncompressed.limit(uncompressed.position() + decompressedSize);
+ uPos);
+ uncompressed.limit(uPos + decompressedSize);
return decompressedSize;
} | Use original compressed/uncompressed buffer's position. (#<I>) | xerial_snappy-java | train | java |
2271876c4cd2179450de48543a5af4b0a9879242 | diff --git a/modules/social_features/social_embed/src/Plugin/Filter/SocialEmbedUrlEmbedFilter.php b/modules/social_features/social_embed/src/Plugin/Filter/SocialEmbedUrlEmbedFilter.php
index <HASH>..<HASH> 100644
--- a/modules/social_features/social_embed/src/Plugin/Filter/SocialEmbedUrlEmbedFilter.php
+++ b/modules/social_features/social_embed/src/Plugin/Filter/SocialEmbedUrlEmbedFilter.php
@@ -122,8 +122,8 @@ class SocialEmbedUrlEmbedFilter extends UrlEmbedFilter {
/** @var \DOMElement $node */
$url = $node->getAttribute('data-embed-url');
$url_output = '';
- $info = $this->urlEmbed->getUrlInfo($url);
try {
+ $info = $this->urlEmbed->getUrlInfo($url);
/** @var \Drupal\user\Entity\User $user */
$user = $this->currentUser->isAnonymous() ? NULL : User::load($this->currentUser->id());
$embed_settings = $this->configFactory->get('social_embed.settings'); | Issue #<I> by navneet<I>: Status Code <I> on YouTube urls on a content page | goalgorilla_open_social | train | php |
29fc0ea3d764433d0b869c858863acff35335cbc | diff --git a/lib/simple_worker/service.rb b/lib/simple_worker/service.rb
index <HASH>..<HASH> 100644
--- a/lib/simple_worker/service.rb
+++ b/lib/simple_worker/service.rb
@@ -272,7 +272,7 @@ module SimpleWorker
def cancel_schedule(scheduled_task_id)
raise "Must include a schedule id." if scheduled_task_id.blank?
hash_to_send = {}
- hash_to_send["scheduled_task_id"] = scheduled_task_id
+ hash_to_send["schedule_id"] = scheduled_task_id
ret = post("scheduler/cancel", hash_to_send)
ret
end | Error when cancelling scheduled tasks | iron-io_iron_worker_ruby | train | rb |
720f27663eb84efa5338c56b81d828309d3decdf | diff --git a/test/integration/sendgrid.test.js b/test/integration/sendgrid.test.js
index <HASH>..<HASH> 100644
--- a/test/integration/sendgrid.test.js
+++ b/test/integration/sendgrid.test.js
@@ -28,6 +28,16 @@ describe('SendGrid #skip', function () {
payload.subject += "rest ";
});
+ it('has a blank send payload', function(done) {
+ sendgrid.send({}, function(success, message) {
+ expect(success).to.be.false;
+
+ done();
+ });
+
+ done();
+ });
+
it('has an optional callback', function(done) {
payload.subject += "has an optional callback"; | Add additional integration spec for empty payload | sendgrid_sendgrid-nodejs | train | js |
aa1dce22a2dd0f5c4d5eb0fe3ceeb00c5b44cf52 | diff --git a/spec/bblib_spec.rb b/spec/bblib_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/bblib_spec.rb
+++ b/spec/bblib_spec.rb
@@ -195,7 +195,7 @@ describe BBLib do
it 'evals a hash' do
expect({ a: { b: 2 } }.hash_path_proc(:eval, 'a.b', '$ * 10')).to eq(a: { b: 20 })
- expect({ a: { 'test' => 'TEST' } }.hash_path_proc(:eval, 'a.test', '"$".downcase + " passed"')).to eq(a: { 'test' => 'test passed' })
+ expect({ a: { 'test' => 'TEST' } }.hash_path_proc(:eval, 'a.test', '$.downcase + " passed"')).to eq(a: { 'test' => 'test passed' })
end
it 'splits a hash value' do | Fixed test for new version of hash path. | bblack16_bblib-ruby | train | rb |
f4f76dba37ac3eeacecaaeaf9818f75eb515face | diff --git a/example/src/main/java/org/syphr/mythtv/example/PlayerPanel.java b/example/src/main/java/org/syphr/mythtv/example/PlayerPanel.java
index <HASH>..<HASH> 100644
--- a/example/src/main/java/org/syphr/mythtv/example/PlayerPanel.java
+++ b/example/src/main/java/org/syphr/mythtv/example/PlayerPanel.java
@@ -43,6 +43,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.syphr.mythtv.api.backend.RecordingByteChannel;
+import com.google.common.io.ByteStreams;
+
public class PlayerPanel extends JPanel
{
/**
@@ -187,13 +189,7 @@ public class PlayerPanel extends JPanel
{
try
{
- long read = 0;
- long size = channel.size();
-
- while (read < size)
- {
- read += out.transferFrom(channel, read, Math.min(BUFFER_SIZE, size - read));
- }
+ ByteStreams.copy(channel, out);
}
finally
{ | simplify (and correct) channel copy code; however, the guava method will likely need to be re-implemented with a larger buffer since <I> is unlikely to work well for copying hd video | syphr42_libmythtv-java | train | java |
5bb6fdec80df7547035736aadbe1461f3e5fc089 | diff --git a/cleverhans/loss.py b/cleverhans/loss.py
index <HASH>..<HASH> 100644
--- a/cleverhans/loss.py
+++ b/cleverhans/loss.py
@@ -342,7 +342,7 @@ class SNNLCrossEntropy(CrossEntropy):
def __init__(self,
model,
temperature=100.,
- layer_names=[],
+ layer_names=None,
factor=-10.,
optimize_temperature=True,
cos_distance=False):
@@ -352,7 +352,7 @@ class SNNLCrossEntropy(CrossEntropy):
self.optimize_temperature = optimize_temperature
self.cos_distance = cos_distance
self.layer_names = layer_names
- if self.layer_names == []:
+ if not layer_names:
# omit the final classification layer
self.layer_names = model.get_layer_names()[:-1]
@@ -397,7 +397,7 @@ class SNNLCrossEntropy(CrossEntropy):
@staticmethod
def masked_pick_probability(x, y, temp, cos_distance):
- return SNNLCrossEntropy.pick_probability(x, temp, cos_distance) * \
+ return SNNLCrossEntropy.pick_probability(x, temp, cos_distance) * \
SNNLCrossEntropy.same_label_mask(y, y)
@staticmethod | fixed builder issues: [] default value, and extra spaces | tensorflow_cleverhans | train | py |
87d3cc2997d753e3d39d100240d783c8d80ece59 | diff --git a/sources/scalac/CompilerCommand.java b/sources/scalac/CompilerCommand.java
index <HASH>..<HASH> 100644
--- a/sources/scalac/CompilerCommand.java
+++ b/sources/scalac/CompilerCommand.java
@@ -130,7 +130,7 @@ public class CompilerCommand extends CommandParser {
"directory", "."),
this.target = new ChoiceOptionParser(this,
- "target", "Specify which bakend to use",
+ "target", "Specify which bakend to use (jvm, jvm-bcel, msil)",
"target", Global.TARGETS, Global.TARGET_JVM),
this.noimports = new BooleanOptionParser(this, | - Added list of possible targets | scala_scala | train | java |
a0c49b0286ab5123ead6f02ff6733f126a658db2 | diff --git a/test/core/Tone.js b/test/core/Tone.js
index <HASH>..<HASH> 100644
--- a/test/core/Tone.js
+++ b/test/core/Tone.js
@@ -269,7 +269,7 @@ define(["Test", "Tone/core/Tone", "helper/PassAudio", "Tone/source/Oscillator",
});
offline.test(function(sample, time){
if (time > 0.5){
- expect(sample).to.closeTo(setValue, 0.01);
+ expect(sample).to.closeTo(setValue, setValue * 0.1);
}
});
offline.after(function(){
@@ -291,7 +291,7 @@ define(["Test", "Tone/core/Tone", "helper/PassAudio", "Tone/source/Oscillator",
});
offline.test(function(sample, time){
if (time > 0.5){
- expect(sample).to.closeTo(setValue, 0.01);
+ expect(sample).to.closeTo(setValue, setValue * 0.1);
}
});
offline.after(function(){ | adjusting ranges
so FF passes more consistently. | Tonejs_Tone.js | train | js |
8caab0f3d510736af0fb032ac89dd1d6ab171a2b | diff --git a/querydsl-sql/src/main/java/com/mysema/query/sql/dml/SQLMergeClause.java b/querydsl-sql/src/main/java/com/mysema/query/sql/dml/SQLMergeClause.java
index <HASH>..<HASH> 100644
--- a/querydsl-sql/src/main/java/com/mysema/query/sql/dml/SQLMergeClause.java
+++ b/querydsl-sql/src/main/java/com/mysema/query/sql/dml/SQLMergeClause.java
@@ -35,6 +35,7 @@ import com.mysema.util.JDBCUtil;
* @author tiwe
*
*/
[email protected]("SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING")
public class SQLMergeClause {
private static final Logger logger = LoggerFactory.getLogger(SQLMergeClause.class);
@@ -101,7 +102,7 @@ public class SQLMergeClause {
return this;
}
- public <T> SQLMergeClause set(Path<T> path, T value) {
+ public <T> SQLMergeClause set(Path<T> path, @Nullable T value) {
columns.add(path);
if (value != null){
values.add(ExprConst.create(value)); | fixed A prepared statement is generated from a nonconstant String
fixed Redundant nullcheck of value known to be non-null | querydsl_querydsl | train | java |
874e849ff64941e071db47db2abfb52ba85349e3 | diff --git a/lib/ronin/credential.rb b/lib/ronin/credential.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/credential.rb
+++ b/lib/ronin/credential.rb
@@ -52,6 +52,21 @@ module Ronin
end
#
+ # Searches for all credentials with a common password.
+ #
+ # @param [String] password
+ # The password to search for.
+ #
+ # @return [Array<Credential>]
+ # The credentials with the common password.
+ #
+ # @since 1.0.0
+ #
+ def self.with_password(password)
+ all('password.clear_text' => password)
+ end
+
+ #
# The user the credential belongs to.
#
# @return [String] | Added Credential.with_password. | ronin-ruby_ronin | train | rb |
65d13af80f6dbd8d1a2693fbbb577ab60678f588 | diff --git a/lib/plangrade/oauth2_client.rb b/lib/plangrade/oauth2_client.rb
index <HASH>..<HASH> 100644
--- a/lib/plangrade/oauth2_client.rb
+++ b/lib/plangrade/oauth2_client.rb
@@ -81,9 +81,13 @@ module Plangrade
# client_id={client_id}&refresh_token=G3Y6jU3a&grant_type=refresh_token&
# client_secret={client_secret}
- def refresh!(ref_token, opts={})
+ def refresh_access_token(opts={})
+ unless (opts[:params] && opts[:params][:refresh_token])
+ raise ArgumentError.new("You must include a refresh token as a parameter")
+ end
opts[:authenticate] ||= :body
- refresh_token.get_token(ref_token, opts)
+ token = opts[:params].delete(:refresh_token)
+ refresh_token.get_token(token, opts)
end
end
end
\ No newline at end of file | trying out some different ways of approaching refresh tokens | plangrade_plangrade-ruby | train | rb |
4618de7c4074375e56ea91b0f5b5b75f13e9c814 | diff --git a/src/Cloudinary.php b/src/Cloudinary.php
index <HASH>..<HASH> 100644
--- a/src/Cloudinary.php
+++ b/src/Cloudinary.php
@@ -141,7 +141,8 @@ class Cloudinary {
$params[$param] = Cloudinary::option_consume($options, $option);
}
- $params = array_filter($params);
+ $param_filter = function($value) { return $value === 0 || $value === '0' || $value == true; };
+ $params = array_filter($params, $param_filter);
ksort($params);
$join_pair = function($key, $value) { return $key . "_" . $value; };
$transformation = implode(",", array_map($join_pair, array_keys($params), array_values($params))); | Added in order to avoid filtering away parameters with zero values. | cloudinary_cloudinary_php | train | php |
30a60bcf299bb71f8857fe5112b3330b0e6dfefb | diff --git a/bench.py b/bench.py
index <HASH>..<HASH> 100644
--- a/bench.py
+++ b/bench.py
@@ -61,7 +61,7 @@ def get_test_files():
# Skip files in tests directory
if not isdir(path):
continue
- # Remove language suffixes from encoding if pressent
+ # Remove language suffixes from encoding if present
encoding = encoding.lower()
for postfix in [
"-arabic",
diff --git a/test.py b/test.py
index <HASH>..<HASH> 100644
--- a/test.py
+++ b/test.py
@@ -51,7 +51,7 @@ def gen_test_params():
# Skip files in tests directory
if not isdir(path):
continue
- # Remove language suffixes from encoding if pressent
+ # Remove language suffixes from encoding if present
encoding = encoding.lower()
for language in sorted(LANGUAGES.keys()):
postfix = "-" + language.lower() | Fix typo `pressent` to `presentgst (#<I>)
` | chardet_chardet | train | py,py |
41891a588fe80572a1487a782e66b7549aac992e | diff --git a/js/types/candles.js b/js/types/candles.js
index <HASH>..<HASH> 100644
--- a/js/types/candles.js
+++ b/js/types/candles.js
@@ -64,14 +64,6 @@ Flotr.addType('candles', {
top2 = yScale(Math.max(open, close));
/*
- TODO old min / max
- bottom = Math.max(ya.min, low),
- top = Math.min(ya.max, high),
- bottom2 = Math.max(ya.min, Math.min(open, close)),
- top2 = Math.min(ya.max, Math.max(open, close));
- */
-
- /*
// TODO skipping
if(right < xa.min || left > xa.max || top < ya.min || bottom > ya.max)
continue; | This should now be handled fine by clipping. | HumbleSoftware_Flotr2 | train | js |
9d39fb36042b909fab44877bc499d3a85a7520cc | diff --git a/cmd/object-handlers.go b/cmd/object-handlers.go
index <HASH>..<HASH> 100644
--- a/cmd/object-handlers.go
+++ b/cmd/object-handlers.go
@@ -1076,6 +1076,9 @@ func (api objectAPIHandlers) CopyObjectHandler(w http.ResponseWriter, r *http.Re
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL, guessIsBrowserReq(r))
return
}
+ if globalIsGateway {
+ srcInfo.UserDefined[xhttp.AmzTagDirective] = replaceDirective
+ }
}
if objTags != "" { | add copyobject tagging replace directive for gateway (#<I>) | minio_minio | train | go |
809d9b8b51636b16bc32d02c48b5241fb4eaf4ed | diff --git a/topydo/commands/ListCommand.py b/topydo/commands/ListCommand.py
index <HASH>..<HASH> 100644
--- a/topydo/commands/ListCommand.py
+++ b/topydo/commands/ListCommand.py
@@ -38,16 +38,18 @@ class ListCommand(ExpressionCommand):
def _poke_icalendar(self):
"""
Attempts to import the icalendar package. Returns True if it
- succeeds, otherwise False
+ succeeds, otherwise False.
+
+ Raises a SyntaxError when icalendar couldn't be imported (most likely
+ under Python 3.2.
"""
try:
import icalendar as _
except ImportError:
self.error("icalendar package is not installed.")
return False
- except SyntaxError:
- self.error("icalendar is not supported in this Python version.")
- return False
+
+ # may also raise SyntaxError, but we'll deal with that in execute()
return True
@@ -103,9 +105,14 @@ class ListCommand(ExpressionCommand):
if not super(ListCommand, self).execute():
return False
- self._process_flags()
- self._print()
+ try:
+ self._process_flags()
+ except SyntaxError:
+ # importing icalendar failed, most likely due to Python 3.2
+ self.error("icalendar is not supported in this Python version.")
+ return False
+ self._print()
return True
def usage(self): | Print error message when trying to output to iCalendar in Python <I>. | bram85_topydo | train | py |
2272443317304ec8dafc6be3fd1d72c3c2789f2f | diff --git a/src/Parser/Xml/AbstractXmlParser.php b/src/Parser/Xml/AbstractXmlParser.php
index <HASH>..<HASH> 100644
--- a/src/Parser/Xml/AbstractXmlParser.php
+++ b/src/Parser/Xml/AbstractXmlParser.php
@@ -99,6 +99,7 @@ abstract class AbstractXmlParser implements ParserInterface
protected function tearDown()
{
unset($this->xpath);
+ unset($this->options_parser);
}
/** | added missing unset to AbtractParser.tearDown | shrink0r_workflux | train | php |
f4911ac6090ab4c3ea189ad0e5bcb245664a92d3 | diff --git a/pkg/fab/orderer/orderer.go b/pkg/fab/orderer/orderer.go
index <HASH>..<HASH> 100644
--- a/pkg/fab/orderer/orderer.go
+++ b/pkg/fab/orderer/orderer.go
@@ -198,13 +198,13 @@ func getFailFast(ordererCfg *fab.OrdererConfig) bool {
func getKeepAliveOptions(ordererCfg *fab.OrdererConfig) keepalive.ClientParameters {
var kap keepalive.ClientParameters
- if kaTime, ok := ordererCfg.GRPCOptions["keep-alive-time"].(time.Duration); ok {
+ if kaTime, ok := ordererCfg.GRPCOptions["keep-alive-time"]; ok {
kap.Time = cast.ToDuration(kaTime)
}
- if kaTimeout, ok := ordererCfg.GRPCOptions["keep-alive-timeout"].(time.Duration); ok {
+ if kaTimeout, ok := ordererCfg.GRPCOptions["keep-alive-timeout"]; ok {
kap.Timeout = cast.ToDuration(kaTimeout)
}
- if kaPermit, ok := ordererCfg.GRPCOptions["keep-alive-permit"].(time.Duration); ok {
+ if kaPermit, ok := ordererCfg.GRPCOptions["keep-alive-permit"]; ok {
kap.PermitWithoutStream = cast.ToBool(kaPermit)
}
return kap | fixed a bug with the processing of the keepalive orderer (#<I>) | hyperledger_fabric-sdk-go | train | go |
24e0df07df4603effac9b97b19280b2b69dbc0dd | diff --git a/config/heyMan.php b/config/heyMan.php
index <HASH>..<HASH> 100644
--- a/config/heyMan.php
+++ b/config/heyMan.php
@@ -1,5 +1,23 @@
<?php
return [
+
+ 'table_names' => [
+ /*
+ * When using the "HasRoles" trait from this package, we need to know which
+ * table should be used to retrieve your roles. We have chosen a basic
+ * default value but you may easily change it to any table you like.
+ */
+
+ 'roles' => 'roles',
+
+ /*
+ * When using the "HasRoles" trait from this package, we need to know which
+ * table should be used to retrieve your models roles. We have chosen a
+ * basic default value but you may easily change it to any table you like.
+ */
+
+ 'model_has_roles' => 'model_has_roles',
+ ],
];
\ No newline at end of file | Added config for table_names | imanghafoori1_laravel-heyman | train | php |
d40314d6cccb1fc79f32fd0199d4d68837704e5b | diff --git a/src/components/editor/MainEditor.js b/src/components/editor/MainEditor.js
index <HASH>..<HASH> 100644
--- a/src/components/editor/MainEditor.js
+++ b/src/components/editor/MainEditor.js
@@ -7,7 +7,7 @@ import * as selectors from '@/reducers/selectors';
import Editor from '@/components/editor/Editor';
const mapStateToProps = (state) => ({
- fields: selectors.getMetaFields(state),
+ fields: selectors.getIsInitialDataFetched(state) ? selectors.getMetaFields(state) : [],
initialValues: selectors.getMetaData(state),
});
diff --git a/src/reducers/login/index.js b/src/reducers/login/index.js
index <HASH>..<HASH> 100644
--- a/src/reducers/login/index.js
+++ b/src/reducers/login/index.js
@@ -8,7 +8,7 @@ const initialState = {
export default (state = initialState, action = {}) => {
const { type, payload } = action;
- if (type === t.FETCH_DATA_SUCCESS) {
+ if (type === t.FETCH_DATA_SUCCESS && payload.dataType === 'content') {
return Object.assign({}, state, { isInitialDataFetched: true });
} else if (type === t.LOGIN_SUCCESS) { | render main editor only after content is fetched | square-a_sissi-says | train | js,js |
94cc338b6183236ef970192faa8f9d260133be47 | diff --git a/src/main/java/org/gitlab4j/api/models/AccessLevel.java b/src/main/java/org/gitlab4j/api/models/AccessLevel.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/gitlab4j/api/models/AccessLevel.java
+++ b/src/main/java/org/gitlab4j/api/models/AccessLevel.java
@@ -10,7 +10,7 @@ import com.fasterxml.jackson.annotation.JsonValue;
public enum AccessLevel {
- INVALID(-1), NONE(0), GUEST(10), REPORTER(20), DEVELOPER(30), @Deprecated MASTER(40), MAINTAINER(40), OWNER(50), ADMIN(60);
+ INVALID(-1), NONE(0), MINIMAL_ACCESS(5), GUEST(10), REPORTER(20), DEVELOPER(30), @Deprecated MASTER(40), MAINTAINER(40), OWNER(50), ADMIN(60);
public final Integer value; | Update AccessLevel.java
On gitlab.com I got
```
org.gitlab4j.api.models.AccessLevel forValue
WARNING: [5] is not a valid GitLab access level.
```
so I've added that enum here | gmessner_gitlab4j-api | train | java |
4579198c05839bf42a7d2becd5f6dfb5bffd9c2b | diff --git a/lib/steam/community/tf2/TF2GoldenWrench.php b/lib/steam/community/tf2/TF2GoldenWrench.php
index <HASH>..<HASH> 100755
--- a/lib/steam/community/tf2/TF2GoldenWrench.php
+++ b/lib/steam/community/tf2/TF2GoldenWrench.php
@@ -62,8 +62,8 @@ class TF2GoldenWrench {
if(self::$goldenWrenches == null) {
self::$goldenWrenches = array();
- $data = json_decode(WebApi::getJSON('ITFItems_440', 'GetGoldenWrenches'));
- foreach($data->results->wrenches->wrench as $wrenchData) {
+ $data = json_decode(WebApi::getJSON('ITFItems_440', 'GetGoldenWrenches', 2));
+ foreach($data->results->wrenches as $wrenchData) {
self::$goldenWrenches[] = new TF2GoldenWrench($wrenchData);
}
} | TF2's Golden Wrenches are still avaiable via Web API | koraktor_steam-condenser-php | train | php |
7915ac567ab19700e44ad6b5d8ef0b85e48a9e75 | diff --git a/tasks/data-download.js b/tasks/data-download.js
index <HASH>..<HASH> 100644
--- a/tasks/data-download.js
+++ b/tasks/data-download.js
@@ -9,7 +9,7 @@ module.exports = function (grunt) {
var done = this.async(),
src = (version === 'latest' ?
- 'ftp://ftp.iana.org/tz/tzdata-latest.tar.gz' :
+ 'https://data.iana.org/time-zones/tzdata-latest.tar.gz' :
'https://data.iana.org/time-zones/releases/tzdata' + version + '.tar.gz'),
curl = path.resolve('temp/curl', version, 'data.tar.gz'),
dest = path.resolve('temp/download', version); | Bugfix: Prevent cleartext transmission of tz data during build
grunt build script downloaded tz data via unencrypted ftp, which could
enable an attacker to MITM and provide a bogus tz data, compromising the
build pipeline or the whole build moment.
Switch to using an https endpoing provided by IANA to avoid this.
Advisory: <URL> | moment_moment-timezone | train | js |
0c48406691ba164b7bcefbc0f4a16d508a5444ae | diff --git a/zuul-core/src/main/java/com/netflix/zuul/netty/filter/ZuulFilterChainHandler.java b/zuul-core/src/main/java/com/netflix/zuul/netty/filter/ZuulFilterChainHandler.java
index <HASH>..<HASH> 100644
--- a/zuul-core/src/main/java/com/netflix/zuul/netty/filter/ZuulFilterChainHandler.java
+++ b/zuul-core/src/main/java/com/netflix/zuul/netty/filter/ZuulFilterChainHandler.java
@@ -147,8 +147,8 @@ public class ZuulFilterChainHandler extends ChannelInboundHandlerAdapter {
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
- LOG.error("zuul filter chain handler caught exception. cause=" + String.valueOf(cause), cause);
if (zuulRequest != null && !isClientChannelClosed(cause)) {
+ LOG.error("zuul filter chain handler caught exception. cause=" + String.valueOf(cause), cause);
final SessionContext zuulCtx = zuulRequest.getContext();
zuulCtx.setError(cause);
zuulCtx.setShouldSendErrorResponse(true); | Print stack trace only when the exception is a non i/o exception | Netflix_zuul | train | java |
154654cfc74b5c9d0fce3eb6c796592e729d6f7b | diff --git a/lib/feed2email/feed.rb b/lib/feed2email/feed.rb
index <HASH>..<HASH> 100644
--- a/lib/feed2email/feed.rb
+++ b/lib/feed2email/feed.rb
@@ -2,7 +2,9 @@ require 'feedzirra'
require 'forwardable'
require 'net/http'
require 'open-uri'
+require 'stringio'
require 'uri'
+require 'zlib'
require 'feed2email/core_ext'
require 'feed2email/entry'
require 'feed2email/feed_history'
@@ -77,7 +79,7 @@ module Feed2Email
handle_redirection
end
- return f.read
+ return decode_content(f.read, f.meta['content-encoding'])
end
rescue OpenURI::HTTPError => e
if e.message == '304 Not Modified'
@@ -103,6 +105,21 @@ module Feed2Email
end
end
+ def decode_content(data, content_encoding)
+ case content_encoding
+ when 'gzip'
+ gz = Zlib::GzipReader.new(StringIO.new(data))
+ xml = gz.read
+ gz.close
+ when 'deflate'
+ xml = Zlib::Inflate.inflate(data)
+ else
+ xml = data
+ end
+
+ xml
+ end
+
def fetch_feed_options
options = {
'User-Agent' => "feed2email/#{VERSION}", | Handle gzip/deflate-encoded content
Thought OpenURI does this, but it does not. | agorf_feed2email | train | rb |
da84dbe359081db023b31d87b62bca8344789f84 | diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js
index <HASH>..<HASH> 100644
--- a/src/components/notification/notification.js
+++ b/src/components/notification/notification.js
@@ -18,8 +18,8 @@ import messages from './messages';
const NotificationIcon = props => {
if (props.type === 'error') return <ErrorIcon theme={props.theme} />;
- else if (props.type === 'info') return <InfoIcon theme={props.theme} />;
- else if (props.type === 'warning') return <WarningIcon theme={props.theme} />;
+ if (props.type === 'info') return <InfoIcon theme={props.theme} />;
+ if (props.type === 'warning') return <WarningIcon theme={props.theme} />;
return <SuccessIcon theme={props.theme} />;
}; | fix: disable eslint rule for class member spacing | commercetools_merchant-center-application-kit | train | js |
c294732deab76cc20fef4bd2fc130f0e632ac79b | diff --git a/runtimeconfig/google/cloud/runtimeconfig/config.py b/runtimeconfig/google/cloud/runtimeconfig/config.py
index <HASH>..<HASH> 100644
--- a/runtimeconfig/google/cloud/runtimeconfig/config.py
+++ b/runtimeconfig/google/cloud/runtimeconfig/config.py
@@ -186,8 +186,8 @@ class Config(object):
>>> from google.cloud import runtimeconfig
>>> client = runtimeconfig.Client()
- >>> config = client.get_config('my-config')
- >>> print(config.get_varialbe('variable-name'))
+ >>> config = client.config('my-config')
+ >>> print(config.get_variable('variable-name'))
<Variable: my-config, variable-name>
>>> print(config.get_variable('does-not-exist'))
None | Typo correction. (#<I>) | googleapis_google-cloud-python | train | py |
53baf28ff1fc45ba25b64f3fa197d1a02e51fa4c | diff --git a/tensorflow_probability/python/experimental/nn/affine_layers.py b/tensorflow_probability/python/experimental/nn/affine_layers.py
index <HASH>..<HASH> 100644
--- a/tensorflow_probability/python/experimental/nn/affine_layers.py
+++ b/tensorflow_probability/python/experimental/nn/affine_layers.py
@@ -79,7 +79,7 @@ class Affine(layers_lib.KernelBiasLayer):
Default value: `None` (i.e., `'Affine'`).
"""
batch_shape = tf.constant(
- [], dtype=tf.int32) if batch_shape is None else tf.cast(
+ [], dtype=tf.int32) if batch_shape is None else prefer_static.cast(
prefer_static.reshape(batch_shape, shape=[-1]), tf.int32)
batch_ndims = prefer_static.size(batch_shape)
kernel_shape = prefer_static.concat([ | changed `tf.cast` to `prefer_static.cast`
PiperOrigin-RevId: <I> | tensorflow_probability | train | py |
b183bddc254a845ae808bb24da1380d099aabcb7 | diff --git a/gui/test_riabmap.py b/gui/test_riabmap.py
index <HASH>..<HASH> 100644
--- a/gui/test_riabmap.py
+++ b/gui/test_riabmap.py
@@ -234,7 +234,7 @@ class RiabDockTest(unittest.TestCase):
myMap.setupPrinter(myPdfPath)
myPixmap = QtGui.QPixmap(10, 10)
- myPixmap.fill(QtGui.QColor(250, 25, 25))
+ myPixmap.fill(QtGui.QColor(250, 250, 250))
myFilename = os.path.join(getTempDir(), 'greyBox')
myPixmap.save(myFilename, 'PNG')
for i in range(10, 190, 10): | Render artifact squares in grey rather so you can see the lines | inasafe_inasafe | train | py |
bcaab03facaa1ca14fd44112c01e9d9fa6983ffe | diff --git a/scapy/contrib/mpls.py b/scapy/contrib/mpls.py
index <HASH>..<HASH> 100644
--- a/scapy/contrib/mpls.py
+++ b/scapy/contrib/mpls.py
@@ -66,5 +66,7 @@ bind_layers(Ether, MPLS, type=0x8847)
bind_layers(UDP, MPLS, dport=6635)
bind_layers(GRE, MPLS, proto=0x8847)
bind_layers(MPLS, MPLS, s=0)
+bind_layers(MPLS, IP, label=0) # IPv4 Explicit NULL
+bind_layers(MPLS, IPv6, label=2) # IPv6 Explicit NULL
bind_layers(MPLS, EoMCW)
bind_layers(EoMCW, Ether, zero=0, reserved=0) | RFC <I> says labels 0 and 2 are for IPv4 and IPv6 respectively
This specifies IPv4 and IPv6 inside an MPLS label using the Explicit
NULL labels, which at least makes building a working packet easier. | secdev_scapy | train | py |
c3af6fe93d6455b70b08bf890c1a4f29c3944e52 | diff --git a/DataFixtures/Required/Data/LoadPlatformRolesData.php b/DataFixtures/Required/Data/LoadPlatformRolesData.php
index <HASH>..<HASH> 100644
--- a/DataFixtures/Required/Data/LoadPlatformRolesData.php
+++ b/DataFixtures/Required/Data/LoadPlatformRolesData.php
@@ -37,6 +37,8 @@ class LoadPlatformRolesData implements RequiredFixture
$roleManager->createBaseRole(PlatformRoles::WS_CREATOR, 'ws_creator');
$roleManager->createBaseRole(PlatformRoles::ADMIN, 'admin');
$roleManager->createBaseRole(PlatformRoles::ANONYMOUS, 'anonymous');
+ $roleManager->createBaseRole('ROLE_HOME_MANAGER', 'home_manager');
+
$manager->endFlushSuite();
}
@@ -44,7 +46,7 @@ class LoadPlatformRolesData implements RequiredFixture
{
$this->container = $container;
}
-
+
public function getOrder()
{
return 1; | [CoreBundle] Adding role home manager at the installatino. | claroline_Distribution | train | php |
8917d79eee25f42844e82cb250b9c089a6e30f47 | diff --git a/lib/clearance/test/units/user_test.rb b/lib/clearance/test/units/user_test.rb
index <HASH>..<HASH> 100644
--- a/lib/clearance/test/units/user_test.rb
+++ b/lib/clearance/test/units/user_test.rb
@@ -35,10 +35,10 @@ module Clearance
context 'A user' do
setup do
- @password = 'sekrit'
+ @password = 'mysekrit'
@salt = 'salt'
User.any_instance.stubs(:initialize_salt)
- @user = Factory(:user, :password => @password, :salt => @salt)
+ @user = Factory(:user, :password => @password, :password_confirmation => @password, :salt => @salt)
end
should "require password validation on update" do
@@ -52,7 +52,7 @@ module Clearance
context 'authenticating a user' do
context 'with good credentials' do
setup do
- @result = User.authenticate @user.email, 'sekrit'
+ @result = User.authenticate @user.email, @password
end
should 'return true' do | UserTest was relying on @password matching what was in the factory. Was failing because password_confirmation in my app was not sekrit. | thoughtbot_clearance | train | rb |
214f87d8e84476e289d9316302c10eec74f6bef6 | diff --git a/tests/test_formatter_types.py b/tests/test_formatter_types.py
index <HASH>..<HASH> 100644
--- a/tests/test_formatter_types.py
+++ b/tests/test_formatter_types.py
@@ -18,6 +18,5 @@ class FormatterTypeTest(TestCase):
profile_dict={},
inherit_order=['horse'])
for formatter_name, formatter in FORMATTERS.items():
- with self.subTest(formatter=formatter_name):
- formatter_instance = formatter(summary, [], profile)
- self.assertIsInstance(formatter_instance.render(True, True, False), str)
+ formatter_instance = formatter(summary, [], profile)
+ self.assertIsInstance(formatter_instance.render(True, True, False), str) | Remove the use of UnitTest.subTest
This turns out to be specific to Python <I>. No functional change since
in practice this only affects reporting. | PyCQA_prospector | train | py |
65620c6426d284c6ca9edcc4d7a6c2f2bfd6313e | diff --git a/src/main/java/com/googlecode/fascinator/dao/impl/GenericDaoHibernateImpl.java b/src/main/java/com/googlecode/fascinator/dao/impl/GenericDaoHibernateImpl.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/googlecode/fascinator/dao/impl/GenericDaoHibernateImpl.java
+++ b/src/main/java/com/googlecode/fascinator/dao/impl/GenericDaoHibernateImpl.java
@@ -80,6 +80,7 @@ public class GenericDaoHibernateImpl<T, PK extends Serializable> implements
@SuppressWarnings("unchecked")
@Override
+ @Transactional
public List<T> query(String name, Map<String, Object> properties) {
return getSession().createQuery(queryMap.get(name)).setProperties(properties).list();
} | Annotated query with @Transactional | the-fascinator-contrib_fascinator-config-db | train | java |
b7c1ffd9fd12853fdbd7142ef070498bd97e3507 | diff --git a/lib/flor/unit/executor.rb b/lib/flor/unit/executor.rb
index <HASH>..<HASH> 100644
--- a/lib/flor/unit/executor.rb
+++ b/lib/flor/unit/executor.rb
@@ -136,6 +136,8 @@ module Flor
message,
"don't know how to apply #{message['tasker'].inspect}"
) if message['routed'] == false
+ #
+ # use an error message similar to what the core executor would emit
@unit.ganger.task(self, message)
end | Add comment about choice of task router err msg | floraison_flor | train | rb |
560727561492c21d79cb16f1f0d11fe707441dff | diff --git a/ease/tests/test_model_accuracy.py b/ease/tests/test_model_accuracy.py
index <HASH>..<HASH> 100644
--- a/ease/tests/test_model_accuracy.py
+++ b/ease/tests/test_model_accuracy.py
@@ -127,8 +127,8 @@ class PolarityTest(unittest.TestCase,GenericTest):
#These will increase if we allow more data in.
#I am setting the amount of data low to allow tests to finish quickly (40 training essays, 1000 character max for each)
- expected_kappa_min = .26
- expected_mae_max = .2
+ expected_kappa_min = -.2
+ expected_mae_max = 1
def setUp(self):
self.generic_setup() | Reset thresholds -- for some reason, jenkins versions of numpy/scipy causing issues with scikits.learn | edx_ease | train | py |
f063460882a334eb3b5b3e1d86361678fe280402 | diff --git a/py/h2o.py b/py/h2o.py
index <HASH>..<HASH> 100644
--- a/py/h2o.py
+++ b/py/h2o.py
@@ -1664,6 +1664,8 @@ class RemoteH2O(H2O):
else:
logPrefix = 'remote-h2o'
+ logPrefix += '-' + host.addr
+
outfd,outpath = tmp_file(logPrefix + '.stdout.', '.log')
errfd,errpath = tmp_file(logPrefix + '.stderr.', '.log') | added IP address into sandbox file name | h2oai_h2o-2 | train | py |
0cf9888d58f97ece67d6fb833323c381601666bd | diff --git a/lib/events.js b/lib/events.js
index <HASH>..<HASH> 100644
--- a/lib/events.js
+++ b/lib/events.js
@@ -24,8 +24,8 @@ module.exports = function(kbox, pantheon) {
var getPhpVersion = function(site) {
// If our site info has a php version
- if (site.php_version && site.php_version === '55') {
- return site.php_version === '55' ? '5.5.24' : '5.3.29';
+ if (site.php_version && site.php_version === 55) {
+ return site.php_version === 55 ? '5.5.24' : '5.3.29';
}
// If not we grab the default for hte framwork | #<I>: Fix typing fail when trying to autoset php version | kalabox_kalabox-app-pantheon | train | js |
795c9bb4c5fa3bc2206c248166e1d8084eda8b7e | diff --git a/rollyourown/seo/templatetags/seo.py b/rollyourown/seo/templatetags/seo.py
index <HASH>..<HASH> 100644
--- a/rollyourown/seo/templatetags/seo.py
+++ b/rollyourown/seo/templatetags/seo.py
@@ -23,9 +23,9 @@ class MetadataNode(template.Node):
if isinstance(target, basestring):
path = target
elif hasattr(target, 'get_absolute_url'):
- path = target.get_absolute_url
+ path = target.get_absolute_url()
elif hasattr(target, "__iter__") and 'get_absolute_url' in target:
- path = target['get_absolute_url']
+ path = target['get_absolute_url']()
else:
path = None
except VariableDoesNotExist: | Actually calling get_absolute_path() would help. | willhardy_django-seo | train | py |
b6a94477a3add48dcec8bd359d704eeb9660b1a7 | diff --git a/tacl/report.py b/tacl/report.py
index <HASH>..<HASH> 100644
--- a/tacl/report.py
+++ b/tacl/report.py
@@ -50,7 +50,7 @@ class Report:
"""
loader = PackageLoader(self._package_name, 'assets/templates')
- env = Environment(extensions=['jinja2.ext.with_'], loader=loader)
+ env = Environment(loader=loader)
return env.get_template('{}.html'.format(self._report_name))
def _write(self, context, report_dir, report_name, assets_dir=None, | Changed Jinja2 Environment initialisation to not include 'with' extension that is now part of core. | ajenhl_tacl | train | py |
65deb9ede011dbe4ad616ae846ae08f8f95cc41f | diff --git a/azurerm/internal/services/servicebus/servicebus_topic_authorization_rule_resource.go b/azurerm/internal/services/servicebus/servicebus_topic_authorization_rule_resource.go
index <HASH>..<HASH> 100644
--- a/azurerm/internal/services/servicebus/servicebus_topic_authorization_rule_resource.go
+++ b/azurerm/internal/services/servicebus/servicebus_topic_authorization_rule_resource.go
@@ -72,7 +72,7 @@ func resourceArmServiceBusTopicAuthorizationRuleCreateUpdate(d *schema.ResourceD
defer cancel()
log.Printf("[INFO] preparing arguments for AzureRM ServiceBus Topic Authorization Rule creation.")
- resourceId := parse.NewTopicAuthorizationRuleID(subscriptionId, d.Get("resource_group_name").(string), d.Get("topic_name").(string), d.Get("namespace_name").(string), d.Get("name").(string))
+ resourceId := parse.NewTopicAuthorizationRuleID(subscriptionId, d.Get("resource_group_name").(string), d.Get("namespace_name").(string), d.Get("topic_name").(string), d.Get("name").(string))
if d.IsNewResource() {
existing, err := client.GetAuthorizationRule(ctx, resourceId.ResourceGroup, resourceId.NamespaceName, resourceId.TopicName, resourceId.AuthorizationRuleName)
if err != nil { | r/servicebus_topic_authorization_rule: fixing the resource id | terraform-providers_terraform-provider-azurerm | train | go |
Subsets and Splits