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
c0c43ac5e383a001ab9ed7df521b9fcf29effe0e
diff --git a/tests/FluentDOMTest.php b/tests/FluentDOMTest.php index <HASH>..<HASH> 100644 --- a/tests/FluentDOMTest.php +++ b/tests/FluentDOMTest.php @@ -189,14 +189,11 @@ class FluentDOMTest extends FluentDomTestCase { */ function testMagicCallUnknown() { try { - FluentDOM(self::XML)->invalidDynamicMethodName(); + $fd = new FluentDOM(); + $fd->invalidDynamicMethodName(); + $this->fail('An expected exception has not been raised.'); } catch (BadMethodCallException $expected) { - return; - } catch (Exception $expected) { - $this->fail('An unexpected exception has been raised: '.$expected->getMessage()); } - $this->fail('An expected exception has not been raised.'); - } /*
FluentDOMTest: - changed: refactoring dynamic function call test (cleanup)
ThomasWeinert_FluentDOM
train
php
b6ce5f40753ac5c0e664259e539483be2a43b2a0
diff --git a/activiti-engine/src/main/java/org/activiti/impl/ProcessEngineImpl.java b/activiti-engine/src/main/java/org/activiti/impl/ProcessEngineImpl.java index <HASH>..<HASH> 100644 --- a/activiti-engine/src/main/java/org/activiti/impl/ProcessEngineImpl.java +++ b/activiti-engine/src/main/java/org/activiti/impl/ProcessEngineImpl.java @@ -54,13 +54,13 @@ public class ProcessEngineImpl implements ProcessEngine { if (DbSchemaStrategy.CREATE_DROP==dbSchemaStrategy || DbSchemaStrategy.CREATE==dbSchemaStrategy) { - if (DbSchemaStrategy.CREATE_DROP==dbSchemaStrategy) { - try { - persistenceSessionFactory.dbSchemaDrop(); - } catch (RuntimeException e) { - // ignore - } - } +// if (DbSchemaStrategy.CREATE_DROP==dbSchemaStrategy) { +// try { +// persistenceSessionFactory.dbSchemaDrop(); +// } catch (RuntimeException e) { +// // ignore +// } +// } persistenceSessionFactory.dbSchemaCreate(); } else if (DbSchemaStrategy.CHECK_VERSION==dbSchemaStrategy) { persistenceSessionFactory.dbSchemaCheckVersion();
Removed stacktraces from logging when creating database schema in tests
camunda_camunda-bpm-platform
train
java
9c9d4f5c3a540c6f4b1d0f7bdfc3caf34c65df64
diff --git a/elifetools/parseJATS.py b/elifetools/parseJATS.py index <HASH>..<HASH> 100644 --- a/elifetools/parseJATS.py +++ b/elifetools/parseJATS.py @@ -731,7 +731,10 @@ def refs(soup): ref_text = ' '.join(ref_text.split()) # Fix punctuation spaces and extra space ref['ref'] = strip_punctuation_space(strip_strings(ref_text)) - + + # ref_id + ref['id'] = tag['id'] + # article_title article_title = node_text(first(extract_nodes(tag, "article-title"))) if(article_title != None): @@ -758,7 +761,9 @@ def refs(soup): # authors person_group = extract_nodes(tag, "person-group") authors = [] + author_types = [] try: + author_type = first(person_group)["person-group-type"] name = extract_nodes(person_group[0], "name") for n in name: surname = node_text(first(extract_nodes(n, "surname"))) @@ -770,8 +775,10 @@ def refs(soup): given_names = "" full_name = strip_strings(surname + ' ' + given_names) authors.append(full_name) + author_types.append(author_type) if(len(authors) > 0): ref['authors'] = authors + ref['author_types'] = author_types except(KeyError, IndexError): pass
added reference id and group_type list to refs construction in parseJATS
elifesciences_elife-tools
train
py
7e182cde16ba583d84c1d07214634da7358ed3d9
diff --git a/lib/config/definitions.js b/lib/config/definitions.js index <HASH>..<HASH> 100644 --- a/lib/config/definitions.js +++ b/lib/config/definitions.js @@ -968,7 +968,7 @@ const options = [ stage: 'package', type: 'json', default: { - fileMatch: ['\\.buildkite/.+\\.yml$'], + fileMatch: ['buildkite\\.ya?ml', '\\.buildkite/.+\\.ya?ml$'], commitMessageTopic: 'buildkite plugin {{depName}}', commitMessageExtra: 'to {{#if isMajor}}v{{{newMajor}}}{{else}}{{{newValue}}}{{/if}}',
fix(buildkite): better fileMatch
renovatebot_renovate
train
js
c6adc0f28648ef20ddbb3aaaa33187a00014b206
diff --git a/src/plugins/Dashboard/index.js b/src/plugins/Dashboard/index.js index <HASH>..<HASH> 100644 --- a/src/plugins/Dashboard/index.js +++ b/src/plugins/Dashboard/index.js @@ -79,7 +79,7 @@ module.exports = class DashboardUI extends Plugin { } addTarget (plugin) { - const callerPluginId = plugin.constructor.name + const callerPluginId = plugin.id || plugin.constructor.name const callerPluginName = plugin.title || callerPluginId const callerPluginIcon = plugin.icon || this.opts.defaultTabIcon const callerPluginType = plugin.type
get plugin id from string, not constructor.name
transloadit_uppy
train
js
5b4236192191215c91c28207b014af89f87dfde5
diff --git a/src/generateIncludes.js b/src/generateIncludes.js index <HASH>..<HASH> 100644 --- a/src/generateIncludes.js +++ b/src/generateIncludes.js @@ -80,7 +80,8 @@ export default function generateIncludes(simpleAST, type, root, options) { } Sequelize = association.target.sequelize.constructor; - includeOptions.attributes = Object.keys(simpleAST.fields[key].fields) + includeOptions.attributes = (includeOptions.attributes || []) + .concat(Object.keys(simpleAST.fields[key].fields)) .filter(inList.bind(null, allowedAttributes)) .filter(notType.bind(null, Sequelize.VIRTUAL, association.target));
dont ignore attributes from .before() for includes
mickhansen_graphql-sequelize
train
js
c304fb7fae0011607588df8d0d8d7e192752e1a4
diff --git a/plugins/worker/server/__init__.py b/plugins/worker/server/__init__.py index <HASH>..<HASH> 100644 --- a/plugins/worker/server/__init__.py +++ b/plugins/worker/server/__init__.py @@ -131,15 +131,13 @@ def cancel(event): return if job['status'] not in [JobStatus.COMPLETE, JobStatus.ERROR]: + # Set the job status to canceling + ModelImporter.model('job', 'jobs').updateJob(job, status=CustomJobStatus.CANCELING) + # Send the revoke request. asyncResult = AsyncResult(celeryTaskId) asyncResult.revoke() - # Set the job status to canceling - ModelImporter.model('job', 'jobs').updateJob(job, status=CustomJobStatus.CANCELING) - - - @setting_utilities.validator({ PluginSettings.BROKER, PluginSettings.BACKEND
Move to canceling before calling revoke
girder_girder
train
py
d4b5649885c688e756f115dce66a7cdc955091c4
diff --git a/core/chaincode/platforms/golang/platform.go b/core/chaincode/platforms/golang/platform.go index <HASH>..<HASH> 100644 --- a/core/chaincode/platforms/golang/platform.go +++ b/core/chaincode/platforms/golang/platform.go @@ -98,6 +98,11 @@ func (goPlatform *Platform) ValidateSpec(spec *pb.ChaincodeSpec) error { func (goPlatform *Platform) ValidateDeploymentSpec(cds *pb.ChaincodeDeploymentSpec) error { + if cds.CodePackage == nil || len(cds.CodePackage) == 0 { + // Nothing to validate if no CodePackage was included + return nil + } + // FAB-2122: Scan the provided tarball to ensure it only contains source-code under // /src/$packagename. We do not want to allow something like ./pkg/shady.a to be installed under // $GOPATH within the container. Note, we do not look deeper than the path at this time
[FAB-<I>] Fix validation logic with empty CodePackage The recently added platform::ValidateDeploymentSpec did not account for the possibility that the CodePackage may be optional under certain scenarios. This patch fixes this by checking for this condition and handling gracefully. Fixes FAB-<I> Change-Id: I<I>dbf<I>c<I>e<I>b<I>de<I>f<I>b<I>a
hyperledger_fabric
train
go
bbe978638c4844ba4c84c2069d2a3a66993bd137
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -5,7 +5,7 @@ class ServerlessAWSPseudoParameters { this.serverless = serverless; this.options = options; this.hooks = { - 'before:aws:package:finalize:mergeCustomProviderResources': this.addParameters.bind(this), + 'after:aws:package:finalize:mergeCustomProviderResources': this.addParameters.bind(this), }; this.skipRegionReplace = get(serverless.service, 'custom.pseudoParameters.skipRegionReplace', false) }
Replaces pseudo parameters after custom resources are merged Fixes #<I>
svdgraaf_serverless-pseudo-parameters
train
js
83e4682e78980ca87b5ece1fb0f18c0e339933c1
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -13,7 +13,6 @@ class PyTest(TestCommand): TestCommand.finalize_options(self) self.test_args = [ '--cov', 'nameko', - '--junitxml=test-results.xml', join(setup_dir, 'test'), ] self.test_suite = True
removing test report xml for setup.py test
nameko_nameko
train
py
65db7e5967654be911b7f15028081ab8773f7136
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -130,7 +130,7 @@ html_theme_path = ['_themes'] # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = ['static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied
docs/conf.py edit
carpedm20_ndrive
train
py
d147dc1ca0aed27a7e48c788c7e71833b37866f1
diff --git a/test/browser-tests/plugins/adaptors/magic.js b/test/browser-tests/plugins/adaptors/magic.js index <HASH>..<HASH> 100644 --- a/test/browser-tests/plugins/adaptors/magic.js +++ b/test/browser-tests/plugins/adaptors/magic.js @@ -148,6 +148,36 @@ export default function() { t.htmlEqual( fixture.innerHTML, 'baz' ); }); + test( 'Magic mode preserves "this" for existing accessors', t => { + let data = {}; + var thisObservedInGetter = undefined; + var thisObservedInSetter = undefined; + + Object.defineProperty( data, 'propertyLoggingObservedThisOnCall', { + get () { + thisObservedInGetter = this; + return 'foo'; + }, + set ( value ) { + thisObservedInSetter = this; + }, + configurable: true, + enumerable: true + }); + + new MagicRactive({ + el: fixture, + template: '{{foo}}', + data + }); + + let foo = data.propertyLoggingObservedThisOnCall; + t.strictEqual( thisObservedInGetter, data ); + + data.propertyLoggingObservedThisOnCall = 'foo'; + t.strictEqual( thisObservedInSetter, data ); + }); + test( 'Setting properties in magic mode triggers change events', t => { t.expect( 1 );
A failing test for magic mode: 'Magic mode preserves "this" for existing accessors'
ractivejs_ractive
train
js
02b3da5085727c93ef72e3e91893abf994f21a7c
diff --git a/rtree/core.py b/rtree/core.py index <HASH>..<HASH> 100644 --- a/rtree/core.py +++ b/rtree/core.py @@ -102,9 +102,7 @@ if os.name == 'nt': elif os.name == 'posix': platform = os.uname()[0] - lib_name = 'libspatialindex_c.so' - if platform == 'Darwin': - lib_name = 'libspatialindex_c.dylib' + lib_name = find_library('spatialindex_c') rt = ctypes.CDLL(lib_name) else: raise RTreeError('Unsupported OS "%s"' % os.name)
offload library finding to ctypes.find_library #<I>
Toblerity_rtree
train
py
2ef80dc33e1adb221ddb9bc98c4b075101bd7ad1
diff --git a/amino/lenses/lens.py b/amino/lenses/lens.py index <HASH>..<HASH> 100644 --- a/amino/lenses/lens.py +++ b/amino/lenses/lens.py @@ -1,5 +1,10 @@ +from typing import Iterable, TypeVar + from lenses.ui import UnboundLens from lenses.optics import TrivialIso +from lenses.hooks.hook_funcs import from_iter + +from amino import List, Lists class UnboundLensA(UnboundLens): @@ -14,4 +19,12 @@ class UnboundLensA(UnboundLens): lens = UnboundLensA(TrivialIso()) +A = TypeVar('A') + + +@from_iter.register(List) +def list_from_iter(self, iterable: Iterable[A]) -> List[A]: + return Lists.wrap(iterable) + + __all__ = ('lens',)
add hook to support `List` in lenses
tek_amino
train
py
63e7bebef67471021b7ed9b40cfc4e4c3e801f3f
diff --git a/pyecoregen/cli.py b/pyecoregen/cli.py index <HASH>..<HASH> 100644 --- a/pyecoregen/cli.py +++ b/pyecoregen/cli.py @@ -57,9 +57,7 @@ def load_model(ecore_model_path): """Load a single Ecore model and return the root package.""" rset = pyecore.resources.ResourceSet() resource = rset.get_resource(pyecore.resources.URI(ecore_model_path)) - model = resource.contents[0] - rset.metamodel_registry[model.nsURI] = model - return model + return resource.contents[0] if __name__ == '__main__': # nocover diff --git a/tests/test_generated_library.py b/tests/test_generated_library.py index <HASH>..<HASH> 100644 --- a/tests/test_generated_library.py +++ b/tests/test_generated_library.py @@ -14,7 +14,6 @@ def generated_library(pygen_output_dir): rset = ResourceSet() resource = rset.get_resource(URI('input/library.ecore')) library_model = resource.contents[0] - rset.metamodel_registry[library_model.nsURI] = library_model generator = EcoreGenerator() generator.generate(library_model, pygen_output_dir) return importlib.import_module('library')
Remove loaded metamodel registering in the ResourceSet If a metamodel is loaded, its registration in the global_registry or the ResourceSet metamodel_registry is only required if an instance of this metamodel is going to be loaded. In the case of the Ecore2Python generation, the instance model is an Ecore instance metamodel. Thus, the loaded metamodel is seen as an Ecore instance and it is not required to register it in a metamodel_registry.
pyecore_pyecoregen
train
py,py
eed13d7aa24b85cb8777edb2fb527c38201e4898
diff --git a/spec/api_map/probe_spec.rb b/spec/api_map/probe_spec.rb index <HASH>..<HASH> 100644 --- a/spec/api_map/probe_spec.rb +++ b/spec/api_map/probe_spec.rb @@ -53,4 +53,26 @@ describe Solargraph::ApiMap::Probe do type = api_map.probe.infer_signature_type('Bar', mod, []) expect(type).to eq('Class<Foo::Bar>') end + + it "infers pins in correct scope for instance variables" do + api_map = Solargraph::ApiMap.new + # @foo is String in class scope and Array in instance scope + source = Solargraph::Source.load_string(%( + module MyModule + @foo = 'foo' + def foo + @foo = [] + end + end + )) + api_map.virtualize source + mod = source.pins.select{|pin| pin.path == 'MyModule'}.first + pins = api_map.probe.infer_signature_pins('@foo', mod, []) + expect(pins.length).to eq(1) + expect(pins.first.return_type).to eq('String') + meth = source.pins.select{|pin| pin.path == 'MyModule#foo'}.first + pins = api_map.probe.infer_signature_pins('@foo', meth, []) + expect(pins.length).to eq(1) + expect(pins.first.return_type).to eq('Array') + end end
Probe spec for instance variable scopes.
castwide_solargraph
train
rb
4a619ba0e503e3eb6ff0b44c12a3c23bc5cabcc9
diff --git a/python/mxnet/optimizer.py b/python/mxnet/optimizer.py index <HASH>..<HASH> 100644 --- a/python/mxnet/optimizer.py +++ b/python/mxnet/optimizer.py @@ -893,7 +893,6 @@ class DCASGD(Optimizer): weight[:] += mom @register -@register class NAG(Optimizer): """Nesterov accelerated SGD.
remove the extra @register (#<I>) Two "@register" lead to warning "UserWarning: WARNING: New optimizer mxnet.optimizer.NAG is overriding existing optimizer mxnet.optimizer.NAG Optimizer.opt_registry[name].name))" while importing mxnet.
apache_incubator-mxnet
train
py
e7dc3be7a8f660f669d31a22d1c35906309b044b
diff --git a/validation.go b/validation.go index <HASH>..<HASH> 100644 --- a/validation.go +++ b/validation.go @@ -164,10 +164,13 @@ func Not(checker Checker) Checker { // Equals performs a basic == on the given parameters and fails if // they are not equal. -func Equals(lhs, rhs interface{}, paramName string) Checker { +func Equals(param, value interface{}, paramName string) Checker { return func() (pass bool, errMsg string) { - return (lhs == rhs), fmt.Sprintf("Parameters were not equal: %v, %v", lhs, rhs) + return (param == value), fmt.Sprintf("Parameters were not equal: %s(%v) != %v", + paramName, + param, + value) } }
Add paramName to Equals checker. This is consistent with the other checkers. It was necessary to rename the function parameters for consistency with other checkers to ensure that people understand which value is associated with the parameter versus which value was expected.
kat-co_vala
train
go
4f00b62224a9e54063b29b9764991d9f02274c1f
diff --git a/src/SecurityContext.php b/src/SecurityContext.php index <HASH>..<HASH> 100644 --- a/src/SecurityContext.php +++ b/src/SecurityContext.php @@ -125,7 +125,8 @@ final class SecurityContext if (! $configuration->isPermissionsEnabled()) { - unset($mappings['permission']); + unset($mappings['userPermission']); + unset($mappings['rolePermission']); $this->validateAndCall($mappings['user'], 'disablePermissions');
Wrong mapping unset for permissions
digbang_security
train
php
3ad2bff3974a4f1746ce75b171cdd9e4d24d9935
diff --git a/tests/test_cache.py b/tests/test_cache.py index <HASH>..<HASH> 100644 --- a/tests/test_cache.py +++ b/tests/test_cache.py @@ -50,12 +50,12 @@ class TestCache(object): time.sleep(TIMEOUT) assert redis_cache.get(context, params) is None - def test_nondefault_timeout(self, redis_cache): + def test_nondefault_timeout_reset(self, redis_cache): + '''key resets timeout to default_timeout after first access.''' context = 'context' params = {'key': 'value'} item = {'a', 'b', 'c'} - redis_cache.put(context, params, item, timeout=TIMEOUT*2-1) - assert 'a' in redis_cache.get(context, params) + redis_cache.put(context, params, item, timeout=TIMEOUT*2) time.sleep(TIMEOUT) assert 'a' in redis_cache.get(context, params) time.sleep(TIMEOUT)
Fix test to reflect how cache timeout works RedisCache timeout for expiring keys can be set with a default_timeout during cache creation, or (for first access) with a timeout when putting the item. After first access the default_timeout is reset.
openspending_os-api-cache
train
py
18d24b237ba0bd475951af6789b92aea07ba22c6
diff --git a/py/semaphore/processing.py b/py/semaphore/processing.py index <HASH>..<HASH> 100644 --- a/py/semaphore/processing.py +++ b/py/semaphore/processing.py @@ -53,7 +53,7 @@ class GeoIpLookup(RustObject): return rv def __repr__(self): - return "<GeoIpLookup %r>" % (self.path,) + return "<GeoIpLookup %r>" % (self._path,) class StoreNormalizer(RustObject): diff --git a/py/semaphore/utils.py b/py/semaphore/utils.py index <HASH>..<HASH> 100644 --- a/py/semaphore/utils.py +++ b/py/semaphore/utils.py @@ -36,12 +36,12 @@ class RustObject(with_metaclass(_NoDict)): raise RuntimeError("Object is closed") return self._objptr - def __del__(self): + def __del__(self, _rustcall=rustcall): if self._objptr is None or self._shared: return f = self.__class__.__dealloc_func__ if f is not None: - rustcall(f, self._objptr) + _rustcall(f, self._objptr) self._objptr = None
fix: Fix broken repr and crash when shutting down python
getsentry_semaphore
train
py,py
e4c99061ac949138e6c3de68fb9eed151dbd769d
diff --git a/src/main/java/org/primefaces/util/HtmlSanitizer.java b/src/main/java/org/primefaces/util/HtmlSanitizer.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/primefaces/util/HtmlSanitizer.java +++ b/src/main/java/org/primefaces/util/HtmlSanitizer.java @@ -47,9 +47,9 @@ public class HtmlSanitizer { private static final PolicyFactory HTML_STYLES_SANITIZER = Sanitizers.STYLES .and(new HtmlPolicyBuilder() - .allowElements("span", "li") + .allowElements("span", "li", "p") .allowAttributes("class") - .onElements("span", "li") + .onElements("span", "li", "p") .toFactory()); private static final PolicyFactory HTML_DENY_ALL_SANITIZER = new HtmlPolicyBuilder().toFactory();
Fix #<I>: TextEditor sanitizer allow P tags to have styles (#<I>)
primefaces_primefaces
train
java
21b7dbfa8cac9722082970619de21349da6b8d63
diff --git a/src/UserConfig.js b/src/UserConfig.js index <HASH>..<HASH> 100644 --- a/src/UserConfig.js +++ b/src/UserConfig.js @@ -52,6 +52,7 @@ class UserConfig { this.dynamicPermalinks = true; this.useGitIgnore = true; this.dataDeepMerge = false; + this.extensionMap = new Set(); this.watchJavaScriptDependencies = true; this.additionalWatchTargets = []; this.browserSyncConfig = {}; @@ -606,6 +607,23 @@ class UserConfig { this.quietMode = !!quietMode; } + // addExtension(fileExtension, options = {}) { + // console.log( + // chalk.yellow( + // "Warning: Configuration API `addExtension` is an experimental Eleventy feature with an unstable API. Be careful!" + // ) + // ); + // this.extensionMap.add( + // Object.assign( + // { + // key: fileExtension, + // extension: fileExtension + // }, + // options + // ) + // ); + // } + addDataExtension(formatExtension, formatParser) { this.dataExtensions.set(formatExtension, formatParser); } @@ -648,6 +666,7 @@ class UserConfig { watchThrottleWaitTime: this.watchThrottleWaitTime, frontMatterParsingOptions: this.frontMatterParsingOptions, dataExtensions: this.dataExtensions, + extensionMap: this.extensionMap, quietMode: this.quietMode }; }
#<I> needs more testing before release
11ty_eleventy
train
js
e2025e928d54a22fdb8639c8f1f184d50ce76a72
diff --git a/lib/stack_master/template_compilers/sparkle_formation.rb b/lib/stack_master/template_compilers/sparkle_formation.rb index <HASH>..<HASH> 100644 --- a/lib/stack_master/template_compilers/sparkle_formation.rb +++ b/lib/stack_master/template_compilers/sparkle_formation.rb @@ -22,7 +22,7 @@ module StackMaster::TemplateCompilers sparkle_template.compile_state = create_state(definitions, compile_time_parameters) end - JSON.pretty_generate(sparkle_template) + JSON.pretty_generate(sparkle_template.dump) end private
Consistent pretty JSON format for sparkleformation pretty_generate wasn't creating formatted JSON during the test suite. Dumping the template to a hash before generating fixes this issue.
envato_stack_master
train
rb
1583680c00fe67f76cf9248864db1afa85bb9e7a
diff --git a/paystackapi/transaction.py b/paystackapi/transaction.py index <HASH>..<HASH> 100644 --- a/paystackapi/transaction.py +++ b/paystackapi/transaction.py @@ -21,7 +21,7 @@ class Transaction(PayStackBase): Json data from paystack API. """ - return cls().requests.get('transaction/initialize', data=kwargs) + return cls().requests.post('transaction/initialize', data=kwargs) @classmethod def charge(cls, **kwargs):
Changed HTTP method in 'Transaction.initialize' to POST.
andela-sjames_paystack-python
train
py
0af770cefee7a28cc84a46f12381d955ecc976fb
diff --git a/tests/integration_tests.py b/tests/integration_tests.py index <HASH>..<HASH> 100644 --- a/tests/integration_tests.py +++ b/tests/integration_tests.py @@ -73,7 +73,6 @@ class OldCocoTest(unittest.TestCase): if keep_lines: extraCommands += ["--keep-lines"] - self.compile_extras(extraCommands+agnosticCommands) self.compile_runner(extraCommands+agnosticCommands) self.compile_agnostic(extraCommands+agnosticCommands) @@ -128,6 +127,11 @@ class OldCocoTest(unittest.TestCase): self.run_source() self.clean() + def test_extra(self): + self.compile_extras() + subprocess.check_call(["python",os.path.join(self.bin,"extras.py")]) + self.clean() if __name__ == '__main__': unittest.main() +
Added test for extras.coco
evhub_coconut
train
py
dbaa2f2a68c725cb179fb01e2d22637b14496c9c
diff --git a/src/Yoti/Entity/MultiValue.php b/src/Yoti/Entity/MultiValue.php index <HASH>..<HASH> 100644 --- a/src/Yoti/Entity/MultiValue.php +++ b/src/Yoti/Entity/MultiValue.php @@ -93,7 +93,6 @@ class MultiValue extends \ArrayObject return $this->filter(function ($item) use ($type) { return $item instanceof $type; }); - return $this; } /** @@ -108,7 +107,6 @@ class MultiValue extends \ArrayObject return $this->filter(function ($item) use ($type) { return gettype($item) === $type; }); - return $this; } /** diff --git a/src/Yoti/Util/Profile/AttributeConverter.php b/src/Yoti/Util/Profile/AttributeConverter.php index <HASH>..<HASH> 100644 --- a/src/Yoti/Util/Profile/AttributeConverter.php +++ b/src/Yoti/Util/Profile/AttributeConverter.php @@ -91,7 +91,7 @@ class AttributeConverter * @param string $value * @return MultiValue */ - private function convertMultiValue($value) + private static function convertMultiValue($value) { $protoMultiValue = new \Attrpubapi\MultiValue(); $protoMultiValue->mergeFromString($value);
SDK-<I>: Declare convertMultiValue() as static and remove unneeded returns
getyoti_yoti-php-sdk
train
php,php
30250b0b88e930e638b97be429f629b9f9d414dc
diff --git a/pyphi/compute/concept.py b/pyphi/compute/concept.py index <HASH>..<HASH> 100644 --- a/pyphi/compute/concept.py +++ b/pyphi/compute/concept.py @@ -147,7 +147,7 @@ def constellation(subsystem, mechanisms=False, purviews=False, constellation = _sequential_constellation if mechanisms is False: - mechanisms = utils.powerset(subsystem.node_indices) + mechanisms = utils.powerset(subsystem.node_indices, nonempty=True) return constellation(subsystem, mechanisms, purviews, past_purviews, future_purviews)
Don't consider the empty mechanism in `concept`
wmayner_pyphi
train
py
c51dac0166a8f5eea1d0c62fbcb5454563484188
diff --git a/lib/Cpdf.php b/lib/Cpdf.php index <HASH>..<HASH> 100644 --- a/lib/Cpdf.php +++ b/lib/Cpdf.php @@ -1475,7 +1475,7 @@ EOT; case 'URI': $res .= "\n/S /URI\n/URI ("; if ($this->encrypted) { - $res .= $this->filterText($this->ARC4($o['info']), true, false); + $res .= $this->filterText($this->ARC4($o['info']), false, false); } else { $res .= $this->filterText($o['info'], false, false); }
Exclude BOM from URIs in protected PDFs Partially addresses #<I>
dompdf_dompdf
train
php
a31d58eff525a5b1b41a1afc00141ccb5d66ccb3
diff --git a/src/CkanApiClient.php b/src/CkanApiClient.php index <HASH>..<HASH> 100644 --- a/src/CkanApiClient.php +++ b/src/CkanApiClient.php @@ -44,7 +44,7 @@ class CkanApiClient */ public function __call($method, $arguments) { - $className = 'Germanazo\CkanApi\Repositories\\'.ucfirst($method).'Repository'; + $className = 'Germanazo\CkanApi\Repositories\\'.ucfirst(camel_case($method)).'Repository'; if (!class_exists($className)) { throw new MethodNotImplementedException("Repository $method is not implemented");
Added camel case conversion to call method on api client
Germanaz0_laravel-ckan-api
train
php
49f91a84008db7204939a17ce1c86c0f162644ef
diff --git a/thoth/solver/python/python.py b/thoth/solver/python/python.py index <HASH>..<HASH> 100644 --- a/thoth/solver/python/python.py +++ b/thoth/solver/python/python.py @@ -342,6 +342,14 @@ def _do_resolve_index( continue packages.append(extracted_metadata) + if package_version != extracted_metadata["package_version"]: + _LOGGER.warning( + "Requested to install package %r in version %r but installed version is %r", + package_name, + package_version, + extracted_metadata["package_version"] + ) + extracted_metadata["package_version_requested"] = package_version _fill_hashes(source, package_name, package_version, extracted_metadata)
Log warning if found version does not match the one requested
thoth-station_solver
train
py
0aa5595587f7f52aac4c4088f005d80d6e55d25f
diff --git a/gulp/tasks/browser-sync.js b/gulp/tasks/browser-sync.js index <HASH>..<HASH> 100644 --- a/gulp/tasks/browser-sync.js +++ b/gulp/tasks/browser-sync.js @@ -19,7 +19,7 @@ module.exports = function() { } }); - bs.watch(env.folder.dev + "/styles/main.css").on("change", bs.reload); - bs.watch(env.folder.dev + "/scripts/main.js").on('change', bs.reload); + bs.watch(env.folder.dev + "/styles/*.css").on("change", bs.reload); + bs.watch(env.folder.dev + "/scripts/*.js").on('change', bs.reload); bs.watch(env.folder.dev + "/**/*.html").on('change', bs.reload); };
Added all css to reload
Objectway_super-gigi
train
js
0decc74e821db22c08b9a484a7d49e5fc10ae6ce
diff --git a/js/jquery.fileupload.js b/js/jquery.fileupload.js index <HASH>..<HASH> 100644 --- a/js/jquery.fileupload.js +++ b/js/jquery.fileupload.js @@ -1,5 +1,5 @@ /* - * jQuery File Upload Plugin 5.36.0 + * jQuery File Upload Plugin 5.37.0 * https://github.com/blueimp/jQuery-File-Upload * * Copyright 2010, Sebastian Tschan @@ -463,7 +463,7 @@ formData.append( options.paramName[index] || paramName, file, - file.name + file.uploadName || file.name ); } });
Allow to provide an alternate Name for the file upload. Closes #<I> If the given File or Blob object has an uploadName property, it will be used as third parameter for FormData.append(). Please note that not all browsers support this third parameter. Unfortunately, the name property of File objects is read only.
blueimp_jQuery-File-Upload
train
js
463d223a49d3e2d0ead009171c75fc86f446294e
diff --git a/pymta/default_policy.py b/pymta/default_policy.py index <HASH>..<HASH> 100644 --- a/pymta/default_policy.py +++ b/pymta/default_policy.py @@ -28,7 +28,7 @@ __all__ = ['DefaultMTAPolicy'] class DefaultMTAPolicy(object): """This is the default policy which just accepts everything.""" - def accept_new_connection(self, remote_ip_string, remote_port): + def accept_new_connection(self, peer): return True diff --git a/pymta/session.py b/pymta/session.py index <HASH>..<HASH> 100644 --- a/pymta/session.py +++ b/pymta/session.py @@ -125,8 +125,9 @@ class SMTPSession(object): self._state = 'new' self._message = Message(Peer(remote_ip, remote_port)) - if False and (self._policy != None): # and \ -# (not self._policy.accept_new_connection(self.remote_ip_string, self.remote_port)): + print 'before policy', + if (self._policy != None) and \ + (not self._policy.accept_new_connection(self._message.peer)): self.reply(554, 'SMTP service not available') self.close_connection() else:
Re-added policy checks for connection accept
FelixSchwarz_pymta
train
py,py
53c82d90c5dba0b51e8dcc3dd02299688e76990e
diff --git a/lib/opal/sprockets/processor.rb b/lib/opal/sprockets/processor.rb index <HASH>..<HASH> 100644 --- a/lib/opal/sprockets/processor.rb +++ b/lib/opal/sprockets/processor.rb @@ -65,7 +65,7 @@ module Opal def process_requires(requires, context) requires.each do |required| - required = required.sub(sprockets_extnames_regexp, '') + required = required.to_s.sub(sprockets_extnames_regexp, '') context.require_asset required unless stubbed_files.include? required end end @@ -106,14 +106,11 @@ module Opal absolute_paths.each do |path| path = Pathname(path) - pathname = path.relative_path_from(dirname) - - if name.to_s == file - next - elsif path.directory? - context.depend_on(path.to_s) - else - context.require_asset(pathname) + pathname = path.relative_path_from(dirname).to_s + + if name.to_s == file then next + elsif path.directory? then context.depend_on(path.to_s) + else context.require_asset(pathname) end end end
Ensure require_asset receives a String In some cases a Pathname was passed, but that’s not ok for some versions of Sprockets.
opal_opal
train
rb
ee7500897764d6395f65901f9b5d0013eb7d96ed
diff --git a/lib/openid_connect/request_object.rb b/lib/openid_connect/request_object.rb index <HASH>..<HASH> 100644 --- a/lib/openid_connect/request_object.rb +++ b/lib/openid_connect/request_object.rb @@ -28,11 +28,11 @@ module OpenIDConnect include JWTnizable class << self - def decode(jwt_string, key) + def decode(jwt_string, key = nil) new JSON::JWT.decode(jwt_string, key) end - def fetch(request_uri, key) + def fetch(request_uri, key = nil) jwt_string = OpenIDConnect.http_client.get_content(request_uri) decode jwt_string, key end
allow non-signed non-encrypted request object decoding
nov_openid_connect
train
rb
a91c309a5c3d3e13a5f60fa7892f870b75e308bd
diff --git a/src/de/lmu/ifi/dbs/elki/datasource/bundle/MultipleObjectsBundle.java b/src/de/lmu/ifi/dbs/elki/datasource/bundle/MultipleObjectsBundle.java index <HASH>..<HASH> 100644 --- a/src/de/lmu/ifi/dbs/elki/datasource/bundle/MultipleObjectsBundle.java +++ b/src/de/lmu/ifi/dbs/elki/datasource/bundle/MultipleObjectsBundle.java @@ -159,4 +159,18 @@ public class MultipleObjectsBundle implements ObjectBundle { bundle.appendColumn(type2, data2); return bundle; } + + /** + * Get an object row. + * + * @param row Row number + * @return Array of values + */ + public Object[] getRow(int row) { + Object[] ret = new Object[columns.size()]; + for(int c = 0; c < columns.size(); c++) { + ret[c] = data(row, c); + } + return ret; + } } \ No newline at end of file
add a by-label filter for data import. some spelling corrections.
elki-project_elki
train
java
40337773f6c47e12929be6c53b4a8e5a193ae55f
diff --git a/src/bidi/chartypes.py b/src/bidi/chartypes.py index <HASH>..<HASH> 100644 --- a/src/bidi/chartypes.py +++ b/src/bidi/chartypes.py @@ -51,8 +51,9 @@ class ExChar(object): return None def __repr__(self): - return '<%s %s (bidi type:%s)>' % (self.__class__.__name__, - unicodedata.name(self.uni_char), self.bidi_type) + return '<%s %s (bidi type:%s, level:%s)>' % (self.__class__.__name__, + unicodedata.name(self.uni_char), self.bidi_type, + self.embed_level) class ExCharUpperRtl(ExChar): """An extended char which treats upper case chars as a strong 'R'
Added level to chartype's __repr__
MeirKriheli_python-bidi
train
py
35bb1115f2c741b9948a71afcc873ec16f9dcfe6
diff --git a/lib/model.js b/lib/model.js index <HASH>..<HASH> 100644 --- a/lib/model.js +++ b/lib/model.js @@ -10,14 +10,12 @@ const Socket = require('./socket.js'); const debug = require('debug')('think-sequelize'); const {extendClassMethods} = require('./util.js'); const MODELS = Symbol('think-sequelize-models'); -const models = {}; const conns = {}; class Model { constructor(modelName, config, name) { this.modelName = modelName; this.config = config; - if (models[name]) return models[name]; // connect const socket = Socket.getInstance(this.config); @@ -42,7 +40,6 @@ class Model { // const Class = class extends model {}; // make relation name wrong this.modelClass = class extends model {}; extendClassMethods(this.modelClass, this); - models[name] = this.modelClass; // add instace methods if (this.instanceMethods) {
add config to stop instance model (#2) * add config to stop instance model * remove models cache
thinkjs_think-sequelize
train
js
65324c72d2fb3a10cb25bbd65ce08a89fefc5896
diff --git a/src/PatternLab/PatternEngine/Twig/Loaders/PatternLoader.php b/src/PatternLab/PatternEngine/Twig/Loaders/PatternLoader.php index <HASH>..<HASH> 100644 --- a/src/PatternLab/PatternEngine/Twig/Loaders/PatternLoader.php +++ b/src/PatternLab/PatternEngine/Twig/Loaders/PatternLoader.php @@ -122,7 +122,8 @@ class PatternLoader extends Loader { // outputs the raw Twig file contents like `@atoms/buttons/button.twig`. // @todo Remove this once `Twig_Loader_String` is removed. if (strpos($result, "@") === 0) { - throw new \Twig_Error_Loader("Twig file not found: " . $result . "\n"); + echo "Twig file not found: " . $result . "\n"; + exit(1); } else { return $result; }
Improving signal to noise ratio on error
pattern-lab_patternengine-php-twig
train
php
ab05a3df98c200ca5c2941343a08a7c0b2aabeaf
diff --git a/packages/tc-icon/index.js b/packages/tc-icon/index.js index <HASH>..<HASH> 100644 --- a/packages/tc-icon/index.js +++ b/packages/tc-icon/index.js @@ -1,4 +1,4 @@ -export { default as default } from './src'; +export { default } from './src'; export { default as Add } from './Add.js' export { default as App } from './App.js' export { default as Bell } from './Bell.js'
style(icon): main entry file Remove extra us of default in main export.
trend-community_trend-components
train
js
15bc0e5bda0fa0bd9793fe208907533302b46fb3
diff --git a/src/webroot/cms/media-library/medialibrary/MedialibraryAction.php b/src/webroot/cms/media-library/medialibrary/MedialibraryAction.php index <HASH>..<HASH> 100644 --- a/src/webroot/cms/media-library/medialibrary/MedialibraryAction.php +++ b/src/webroot/cms/media-library/medialibrary/MedialibraryAction.php @@ -305,9 +305,9 @@ class MedialibraryAction extends MediaLibraryAbstractAction // when changing image private attribute, previews and thumbs will change their paths // so we will output new image info - if ($file instanceof Entity\Image) { + if ($file instanceof Entity\File) { $response = $this->imageAndFileOutput($file); - } + } $this->getResponse() ->setResponseData($response);
Task #<I>: Added file data output on MediaLibrary save action.
sitesupra_sitesupra
train
php
0939164cd0c2e2551f50050dd5a41ce2c5e03c65
diff --git a/app/controllers/api/products_controller.rb b/app/controllers/api/products_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/api/products_controller.rb +++ b/app/controllers/api/products_controller.rb @@ -22,7 +22,7 @@ class Api::ProductsController < Api::ApiController index_test = lambda { Product.any_readable?(@organization) } read_test = lambda { @product.readable? } edit_test = lambda { @product.editable? } - repo_test = lambda { @product.readable? } + repo_test = lambda { Product.any_readable?(@organization) } { :index => index_test, :show => read_test,
product api - fix for permission problem when listing repos Api was returning permission exception when all product repositories were disabled.
Katello_katello
train
rb
49bd80dad44afd5b976aef0c260f213886b089b7
diff --git a/github/configs.go b/github/configs.go index <HASH>..<HASH> 100644 --- a/github/configs.go +++ b/github/configs.go @@ -141,7 +141,9 @@ func CurrentConfigs() *Configs { configFile := configsFile() err := loadFrom(configFile, c) - utils.Check(err) + if err != nil { + // load from YAML + } return c }
Add stub block for loading from YAML
github_hub
train
go
4164240a3b1eb25b2c61619fcfec55b97a72ec3f
diff --git a/opensubmit/settings.py b/opensubmit/settings.py index <HASH>..<HASH> 100644 --- a/opensubmit/settings.py +++ b/opensubmit/settings.py @@ -66,9 +66,6 @@ DATABASES = { } } -if bool(config.get('general', 'DEBUG')) and is_production: - print("WARNING: DEBUG is enabled in configuration file, despite being in productive mode.", file=sys.stderr) - DEBUG = bool(config.get('general', 'DEBUG')) and not is_production TEMPLATE_DEBUG = DEBUG @@ -185,6 +182,11 @@ LOGGING = { 'level': 'DEBUG', 'propagate': True, }, + 'social': { + 'handlers': ['console', 'file'], + 'level': 'DEBUG', + 'propagate': True, + }, } }
Adding logging for social auth, removing log-filling gibberish
troeger_opensubmit
train
py
9d639ce17a030c2eeaa430ee26b27c416410a20a
diff --git a/h2o-core/src/main/java/water/api/CloudHandler.java b/h2o-core/src/main/java/water/api/CloudHandler.java index <HASH>..<HASH> 100644 --- a/h2o-core/src/main/java/water/api/CloudHandler.java +++ b/h2o-core/src/main/java/water/api/CloudHandler.java @@ -16,13 +16,6 @@ class CloudHandler extends Handler { cloud.version = H2O.ABV.projectVersion(); cloud.node_idx = H2O.SELF.index(); - if (cloud.node_idx < 0) { - // This is very special. This can happen in sparkling water (i.e. client mode). - // The client has a negative array index. In that case, force to 0. - // Real worker nodes have indexes 0 or greater. - cloud.node_idx = 0; - } - cloud.cloud_name = H2O.ARGS.name; cloud.is_client = H2O.ARGS.client; cloud.cloud_size = H2O.CLOUD.size();
Don't clamp node_idx at 0 anymore.
h2oai_h2o-3
train
java
077b7b59eb37ffafb50032e0c6c0b7eda89717eb
diff --git a/gen/generator.go b/gen/generator.go index <HASH>..<HASH> 100644 --- a/gen/generator.go +++ b/gen/generator.go @@ -215,6 +215,7 @@ func (g *generator) LookupConstantName(c *compile.Constant) (string, error) { // TextTemplate renders the given template with the given template context. func (g *generator) TextTemplate(s string, data interface{}, opts ...TemplateOption) (string, error) { templateFuncs := template.FuncMap{ + "lessthan": lessThanSymbol, "enumItemName": enumItemName, "formatDoc": formatDoc, "goCase": goCase, @@ -539,3 +540,7 @@ func formatDoc(s string) string { } return strings.Join(lines, "\n") + "\n" } + +func lessThanSymbol() string { + return "<" +}
Support "<" in the templating language (#<I>) The templating language used for code generation uses `<` and `>` as its delimiters. This results in syntax errors when trying to use the beginning delimiter as an actual character, not as invoking a template. Add an explicit command (`<lessthan>`) to inject `<` as needed.
thriftrw_thriftrw-go
train
go
aacdcb1570a0a3796fe68fb3339e34df112a67e0
diff --git a/src/Composer/Command/SelfUpdateCommand.php b/src/Composer/Command/SelfUpdateCommand.php index <HASH>..<HASH> 100644 --- a/src/Composer/Command/SelfUpdateCommand.php +++ b/src/Composer/Command/SelfUpdateCommand.php @@ -39,8 +39,6 @@ EOT protected function execute(InputInterface $input, OutputInterface $output) { - $composer = $this->getComposer(); - $latest = trim(file_get_contents('http://getcomposer.org/version')); if (Composer::VERSION !== $latest) {
Allow self-update to be called outside of a project context
mothership-ec_composer
train
php
6d5bfb686d2c962d77824e1104dee9defdbc7980
diff --git a/api/server.go b/api/server.go index <HASH>..<HASH> 100644 --- a/api/server.go +++ b/api/server.go @@ -32,7 +32,7 @@ import ( "gopkg.in/tylerb/graceful.v1" ) -const Version = "1.0.0" +const Version = "1.1.0-dev" func getProvisioner() (string, error) { provisioner, err := config.GetString("provisioner")
api: change version to <I>-dev
tsuru_tsuru
train
go
4873ef5f9e77803332afdb017cb750c3ed626e43
diff --git a/tests/BaseTest.php b/tests/BaseTest.php index <HASH>..<HASH> 100644 --- a/tests/BaseTest.php +++ b/tests/BaseTest.php @@ -149,10 +149,10 @@ abstract class BaseTest extends TestCase return $input; } - public function withPrefix(string $prefix): InputInterface + public function withPrefix(string $prefix, bool $add = true): InputInterface { throw new \RuntimeException('Not implemented'); } }; } -} \ No newline at end of file +}
Update test cases Caused by core changes
spiral-modules_listing
train
php
72b4495c3213da7970fabc5d51e4c38cde133491
diff --git a/test/integration/requests/request_test.rb b/test/integration/requests/request_test.rb index <HASH>..<HASH> 100644 --- a/test/integration/requests/request_test.rb +++ b/test/integration/requests/request_test.rb @@ -156,6 +156,30 @@ class RequestTest < ActionDispatch::IntegrationTest assert_equal 201, status end + def test_post_single_missing_data_contents + post '/posts', + { + 'data' => { + } + }.to_json, "CONTENT_TYPE" => JSONAPI::MEDIA_TYPE + + assert_equal 400, status + end + + def test_post_single_minimal_valid + post '/comments', + { + 'data' => { + 'type' => 'comments' + } + }.to_json, "CONTENT_TYPE" => JSONAPI::MEDIA_TYPE + + assert_equal 201, status + assert_nil json_response['data']['body'] + assert_nil json_response['data']['links']['post']['linkage'] + assert_nil json_response['data']['links']['author']['linkage'] + end + def test_post_single_minimal_invalid post '/posts', {
Adds tests posting empty data and posting data with only required type
cerebris_jsonapi-resources
train
rb
28b9b6bd8892a8afd165febfab488ff61d9e3128
diff --git a/examples/config_sample.php b/examples/config_sample.php index <HASH>..<HASH> 100644 --- a/examples/config_sample.php +++ b/examples/config_sample.php @@ -11,6 +11,7 @@ error_reporting( E_ALL ); ini_set( 'display_errors', 1 ); +require_once('/path/to/guzzlehttp'); require_once( dirname( __DIR__ ) . '/src/whatcounts_required.php' ); define( 'WC_REALM', '[YOUR_REALM]');
Updated config file to include Guzzle HTTP
ZayconFoods_whatcounts
train
php
7e7a4fef3cf1772714f9035ee39bdb1f0c72cd04
diff --git a/src/caniuse-parser.js b/src/caniuse-parser.js index <HASH>..<HASH> 100644 --- a/src/caniuse-parser.js +++ b/src/caniuse-parser.js @@ -216,11 +216,9 @@ function handleDataFeed(entries) { (os == "iOS" || os == "iPad" || os == "iPhone" || os == "iPod") ) { browser = "iOS Safari"; - } else if ( - browser == "Mozilla Compatible Agent" && - (os == "iPad" || os == "iPhone" || os == "iPod") - ) { - browser = "iOS Safari"; //browser = 'iOS app'; + } else if (os == "iPad" || os == "iPhone" || os == "iPod") { + // all apps on ios must use safari engine by apple rules + browser = "iOS Safari"; } else if (browser == "Opera" && (isMobile || os == "(not set)")) { browser = "Opera Mobile"; } else if (browser == "Safari (in-app)") {
All apps on iOS must use safari engine by apple rules
browserslist_browserslist-ga
train
js
9b4b41df2c61544e4a680d6eaff7a81eb515ca7d
diff --git a/js/bitfinex.js b/js/bitfinex.js index <HASH>..<HASH> 100644 --- a/js/bitfinex.js +++ b/js/bitfinex.js @@ -377,6 +377,8 @@ module.exports = class bitfinex extends Exchange { return 'eos'; } else if (currency == 'BCH') { return 'bcash'; + } else if (currency == 'USDT') { + return 'tetheruso'; } throw new NotSupported (this.id + ' ' + currency + ' not supported for withdrawal'); }
bitfinex USDT withdrawals #<I>
ccxt_ccxt
train
js
ba956847d78809b35535744134a26e9566078991
diff --git a/tests/input/logictree_test.py b/tests/input/logictree_test.py index <HASH>..<HASH> 100644 --- a/tests/input/logictree_test.py +++ b/tests/input/logictree_test.py @@ -999,7 +999,7 @@ class GMPELogicTreeBrokenInputTestCase(unittest.TestCase): branchSetID="bs1" applyToTectonicRegionType="Volcanic"> <logicTreeBranch branchID="b1"> - <uncertaintyModel>nhlib.gsim.GMPE</uncertaintyModel> + <uncertaintyModel>nhlib.gsim.FakeGMPE</uncertaintyModel> <uncertaintyWeight>1.0</uncertaintyWeight> </logicTreeBranch> </logicTreeBranchSet> @@ -2088,9 +2088,6 @@ class _BaseSourceModelLogicTreeBlackboxTestCase(unittest.TestCase): for source in a_nrml_sources] for i, source in enumerate(a_nhlib_sources): modify_source(source) - # these parameters are expected to be different - del source.mfd._original_parameters - del e_nhlib_sources[i].mfd._original_parameters self.assertEqual(len(e_nhlib_sources), len(a_nhlib_sources)) for i in xrange(len(e_nhlib_sources)):
input/logictree_test: Fixed a few minor test failures. Former-commit-id: <I>e9ee2b<I>d<I>eb6a<I>e<I>d<I>a<I>b0
gem_oq-engine
train
py
9efe5df745f25b573f71dcfa2007ad7fded8c997
diff --git a/src/sos/sos_task.py b/src/sos/sos_task.py index <HASH>..<HASH> 100644 --- a/src/sos/sos_task.py +++ b/src/sos/sos_task.py @@ -929,7 +929,7 @@ def purge_tasks(tasks, purge_all=False, workflows=None, age=None, status=None, v for task in all_tasks: removed = True for f in to_be_removed[task]: - if os.path.basename(f).split('.', 1)[0] not in removable_ids: + if workflows and os.path.basename(f).split('.', 1)[0] not in removable_ids: env.logger.debug('{} not removed because it is not generated by any workflow from the current project.'.format(f)) removed = False continue
Again try to fix sos purge
vatlab_SoS
train
py
90a4c56ac7d35aab3e3450a2502edb97fca7f96b
diff --git a/lib/dpl/version.rb b/lib/dpl/version.rb index <HASH>..<HASH> 100644 --- a/lib/dpl/version.rb +++ b/lib/dpl/version.rb @@ -1,3 +1,3 @@ module DPL - VERSION = '1.8.31' + VERSION = '1.8.32' end
Bump to version <I>
travis-ci_dpl
train
rb
3c5acd315dfbdb0c47362d1d25e49e4ce49cae9e
diff --git a/test/fakefs_test.rb b/test/fakefs_test.rb index <HASH>..<HASH> 100644 --- a/test/fakefs_test.rb +++ b/test/fakefs_test.rb @@ -2266,6 +2266,15 @@ class FakeFSTest < Minitest::Test assert File.file?('/bar') end + def test_rename_renames_a_symlink + FileUtils.touch('/file') + File.symlink('/file', '/symlink') + assert_equal File.readlink('/symlink'), '/file' + + File.rename('/symlink', '/symlink2') + assert_equal File.readlink('/symlink2'), '/file' + end + def test_rename_returns FileUtils.touch('/foo') assert_equal 0, File.rename('/foo', '/bar')
[test] add failing test for symlink renames
fakefs_fakefs
train
rb
952a6f3dd100e8044dcf03d9baac8c4bbdb9e7f5
diff --git a/mintapi/api.py b/mintapi/api.py index <HASH>..<HASH> 100644 --- a/mintapi/api.py +++ b/mintapi/api.py @@ -293,9 +293,27 @@ class Mint(requests.Session): # Fill in the return structure for direction in budgets.keys(): for budget in budgets[direction]: - budget['cat'] = categories[budget['cat']] + budget['cat'] = self.get_category_from_id(budget['cat']) return budgets + + def get_category_from_id(self, cid): + if cid == 0: + return 'Uncategorized' + + categories = self.get_categories() + + for i in categories: + if categories[i]['id'] == cid: + return categories[i]['name'] + + if 'children' in categories[i]: + for j in categories[i]['children']: + if categories[i][j]['id'] == cid: + return categories[i][j]['name'] + + return 'Unknown' + def initiate_account_refresh(self): # Submit refresh request.
Build budget categories by ID to handle top-level categories
mrooney_mintapi
train
py
c6dc7d3e22220ae96174e566a15b30e4b608bf22
diff --git a/cmd/kpod/images.go b/cmd/kpod/images.go index <HASH>..<HASH> 100644 --- a/cmd/kpod/images.go +++ b/cmd/kpod/images.go @@ -151,7 +151,7 @@ func outputImages(store storage.Store, images []storage.Image, format string, ha if quiet { fmt.Printf("%-64s\n", img.ID) // We only want to print each id once - break + continue } params := imageOutputParams{
Fix bug resulting in `kpod images --quiet` only printing one image
cri-o_cri-o
train
go
caf3e78b418e5617f18837fd4dad857320cd2d3d
diff --git a/delphin/__about__.py b/delphin/__about__.py index <HASH>..<HASH> 100644 --- a/delphin/__about__.py +++ b/delphin/__about__.py @@ -3,7 +3,7 @@ # the warehouse project: # https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py -__version__ = '0.9.2' +__version__ = '1.0.0-beta1' __version_info__ = __version__.replace('.', ' ').replace('-', ' ').split() __title__ = 'PyDelphin'
Add <I>-beta1 version (not a symbolic commit, just thought I should do this sooner than later)
delph-in_pydelphin
train
py
82cb42dc9ff5e48e1cec7a29e662d0b84f63af3f
diff --git a/tartiflette_aiohttp/_handler.py b/tartiflette_aiohttp/_handler.py index <HASH>..<HASH> 100644 --- a/tartiflette_aiohttp/_handler.py +++ b/tartiflette_aiohttp/_handler.py @@ -1,8 +1,10 @@ +import contextvars import json import logging from aiohttp import web +response_headers_var = contextvars.ContextVar('response_headers', default={}) logger = logging.getLogger(__name__) @@ -27,8 +29,7 @@ class BadRequestError(Exception): def prepare_response(data): - headers = {} - # TODO Do things with header here + headers = response_headers_var.get() return web.json_response(data, headers=headers, dumps=json.dumps)
handler: allow resolvers to set response headers Resolvers can set response headers through the `response_headers_var` ContextVar object that will be forwarded back to the client
dailymotion_tartiflette-aiohttp
train
py
9b8c5b052764fbca0ce418663b997a6d4023e5b8
diff --git a/command.go b/command.go index <HASH>..<HASH> 100644 --- a/command.go +++ b/command.go @@ -120,6 +120,13 @@ func (c *JoinCommand) CommandName() string { // Join a server to the cluster func (c *JoinCommand) Apply(raftServer *raft.Server) (interface{}, error) { + // check if the join command is from a previous machine, who lost all its previous log. + response, _ := etcdStore.RawGet(path.Join("_etcd/machines", c.Name)) + + if response != nil { + return []byte("join success"), nil + } + // check machine number in the cluster num := machineNum() if num == maxClusterSize {
allow pervious machine to rejoin to the cluster without pervious log
etcd-io_etcd
train
go
c583d92106c2f27739ba74c8259111a2d54f9331
diff --git a/aiosparql/syntax.py b/aiosparql/syntax.py index <HASH>..<HASH> 100644 --- a/aiosparql/syntax.py +++ b/aiosparql/syntax.py @@ -55,7 +55,7 @@ class Triples(list): """ A magical list of tuples (s, p, o) that be printed to a SPARQL query. """ - def __init__(self, value): + def __init__(self, value=[]): assert all(isinstance(x, (tuple, Node)) for x in value), \ "only tuples and Node are accepted, received: %r" % value assert all(len(x) == 3 for x in value if isinstance(x, tuple)), \
Added: Triples() can be initialized without argument
aio-libs_aiosparql
train
py
5087fbadd8e834d89466aad211074658e84076fa
diff --git a/salt/fileserver/svnfs.py b/salt/fileserver/svnfs.py index <HASH>..<HASH> 100644 --- a/salt/fileserver/svnfs.py +++ b/salt/fileserver/svnfs.py @@ -58,7 +58,7 @@ def __virtual__(): ''' Only load if subversion is available ''' - if not __virtualname__ in __opts__['fileserver_backend']: + if __virtualname__ not in __opts__['fileserver_backend']: return False if not HAS_SVN: log.error('Subversion fileserver backend is enabled in configuration '
Fix PEP8 E<I> - test for membership should be "not in"
saltstack_salt
train
py
ae5230344ca276bb467e041b7c03c71bb8e8e718
diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -284,15 +284,15 @@ class Request $dup->server = new ServerBag($server); $dup->headers = new HeaderBag($dup->server->getHeaders()); } - $this->languages = null; - $this->charsets = null; - $this->acceptableContentTypes = null; - $this->pathInfo = null; - $this->requestUri = null; - $this->baseUrl = null; - $this->basePath = null; - $this->method = null; - $this->format = null; + $dup->languages = null; + $dup->charsets = null; + $dup->acceptableContentTypes = null; + $dup->pathInfo = null; + $dup->requestUri = null; + $dup->baseUrl = null; + $dup->basePath = null; + $dup->method = null; + $dup->format = null; return $dup; }
[HttpFoundation] Fixed duplicate of request closes #<I>
symfony_symfony
train
php
24b4a60e168a078a0353c1242223dcc62b402e2e
diff --git a/src/ServiceProvider/ServiceProviderGenerator.php b/src/ServiceProvider/ServiceProviderGenerator.php index <HASH>..<HASH> 100644 --- a/src/ServiceProvider/ServiceProviderGenerator.php +++ b/src/ServiceProvider/ServiceProviderGenerator.php @@ -67,7 +67,7 @@ EOL; $arguments = $this->dumpArguments($dependency->getParameters()); $joinedStatements = <<<EOL - return \$c['$factoryKey']($arguments); + return \$c['$factoryKey']($arguments); EOL; return $factoryDefinition . "\n" . $this->dumpServiceDefinition($dependency, $joinedStatements);
ServiceProviderGenerator: Fix an indent in generated source
emonkak_php-di
train
php
54cf7008ed4bddd8825921784720fd03a2c124da
diff --git a/lib/bob.php b/lib/bob.php index <HASH>..<HASH> 100644 --- a/lib/bob.php +++ b/lib/bob.php @@ -83,7 +83,7 @@ function template($file, $vars = array()) // }); // // Returns the Output as String. -function process($cmd, $callback = null) +function proc($cmd, $callback = null) { if (is_array($cmd)) { $cmd = join(' ', $cmd);
Renamed process() to just proc()
CHH_bob
train
php
5107de17147458ba76784350732f2a67ec0e4383
diff --git a/src/sensors.js b/src/sensors.js index <HASH>..<HASH> 100644 --- a/src/sensors.js +++ b/src/sensors.js @@ -24,13 +24,6 @@ const nativeApis = new Map([ ["barometer", BarNative] ]); -const eventEmitters = new Map([ - ["accelerometer", new NativeEventEmitter(AccNative)], - ["gyroscope", new NativeEventEmitter(GyroNative)], - ["magnetometer", new NativeEventEmitter(MagnNative)], - ["barometer", new NativeEventEmitter(BarNative)] -]); - const eventEmitterSubsciption = new Map([ ["accelerometer", null], ["gyroscope", null], @@ -54,13 +47,13 @@ function createSensorObservable(sensorType) { () => { this.isSensorAvailable = true; + const emitter = new NativeEventEmitter(nativeApis.get(sensorType)); + eventEmitterSubsciption.set( sensorType, - eventEmitters - .get(sensorType) - .addListener(listenerKeys.get(sensorType), data => { - observer.next(data); - }) + emitter.addListener(listenerKeys.get(sensorType), data => { + observer.next(data); + }) ); // Start the sensor manager
fix: EventEmitter is not cached
react-native-sensors_react-native-sensors
train
js
1b50812a6df88a30b38d62bc6f7d6475c33b924d
diff --git a/lib/polyglot.rb b/lib/polyglot.rb index <HASH>..<HASH> 100644 --- a/lib/polyglot.rb +++ b/lib/polyglot.rb @@ -67,12 +67,28 @@ module Jekyll def build_language(lang) reset read + filter generate render cleanup puts "Building #{lang} Site" write end + + def filter + langs = {} + approved = {} + posts.each do |post| + language = post.data['lang'] || @default_lang + next if langs[post.url] == @active_lang + if langs[post.url] == @default_lang + next if language != @active_lang + end + approved[post.url] = post + langs[post.url] = language + end + @posts = approved.values + end end # Alteration to Jekyll Convertible module
changes to how polyglot handles posts
untra_polyglot
train
rb
94e6cdca4aab383447c462bff2b231e063375ada
diff --git a/src/Config.php b/src/Config.php index <HASH>..<HASH> 100644 --- a/src/Config.php +++ b/src/Config.php @@ -28,8 +28,12 @@ class Config private $file; public $path; - public function __construct($file){ + public function __construct($file, $path = ''){ $this->path = appDir.'../app/Config/'; // appDir zdefiniowany powinien byc w Config.php + + if(isset($path) AND !empty($path)) + $this->path = appDir.'../'.$path.'/'; + $this->file = $file; if (file_exists($this->path.$this->file.'.php') != true) @@ -40,8 +44,8 @@ class Config } - public static function load($file){ - return new Config($file); + public static function load($file, $path = null){ + return new Config($file, $path); }
add own path config good for Libs
dframe_dframe
train
php
00aa7c14b41ddecb47f0e5b43473c431419fc4d7
diff --git a/code/fields/HasOneCompositeField.php b/code/fields/HasOneCompositeField.php index <HASH>..<HASH> 100644 --- a/code/fields/HasOneCompositeField.php +++ b/code/fields/HasOneCompositeField.php @@ -198,6 +198,8 @@ class HasOneCompositeField extends CompositeField { $form->saveInto($record); unset($form); + $record->flushCache(false); + // Save extra data into field if(count($this->extraData)) $record->castedUpdate($this->extraData);
FIX: Flush record cache after save into form, for relationships on has one to work
milkyway-multimedia_ss-zen-forms
train
php
c54342705fb9e2628eacf778951f1d9abf5e34c6
diff --git a/src/Services/BaseFileService.php b/src/Services/BaseFileService.php index <HASH>..<HASH> 100644 --- a/src/Services/BaseFileService.php +++ b/src/Services/BaseFileService.php @@ -162,7 +162,7 @@ abstract class BaseFileService extends BaseRestService implements FileServiceInt protected function handleResource(array $resources) { // Fall through is to process just like a no-resource request - $resources = $this->getResources(true); + $resources = $this->getResourceHandlers(); if ((false !== $resources) && !empty($this->resource)) { if (in_array($this->resource, $resources)) { return $this->processRequest();
Separating resources from resource handlers.
dreamfactorysoftware_df-file
train
php
01cc92776e00a9303f576149625e66f00020e494
diff --git a/cf/commands/config_test.go b/cf/commands/config_test.go index <HASH>..<HASH> 100644 --- a/cf/commands/config_test.go +++ b/cf/commands/config_test.go @@ -41,8 +41,8 @@ var _ = Describe("config command", func() { Expect(configRepo.AsyncTimeout()).Should(Equal(uint(12))) }) - It("fails with usage when a invalid async timeout value is passed, e.g., a string", func() { - runCommand("--async-timeout", "lol") + It("fails with usage when a invalid async timeout value is passed", func() { + runCommand("--async-timeout", "-1") Expect(ui.FailedWithUsage).To(BeTrue()) })
Fix a test to no longer spit out annoying strconv errors
cloudfoundry_cli
train
go
b1f2a22d401290372440ca1df0acb30266060a32
diff --git a/lib/lotus/cli.rb b/lib/lotus/cli.rb index <HASH>..<HASH> 100644 --- a/lib/lotus/cli.rb +++ b/lib/lotus/cli.rb @@ -1,5 +1,6 @@ require 'thor' require 'lotus/environment' +require 'lotus/version' module Lotus class Cli < Thor
Require version file form CLI
hanami_hanami
train
rb
1188a7c9b29d2f5081d885f4edde125a8b83ffa5
diff --git a/patchboard/action.py b/patchboard/action.py index <HASH>..<HASH> 100644 --- a/patchboard/action.py +++ b/patchboard/action.py @@ -77,7 +77,7 @@ class Action(object): # context would ever aquire an 'authorizer' method in the ruby # code, and in any case we need to be certain of the pythonic # analog. - if self.auth_scheme and u'authorizer' in context: + if hasattr(self, u'auth_scheme') and u'authorizer' in context: credential = context[u'authorizer']( self.auth_scheme, resource, self.name)
Cleanup: check for attr before accessing
patchboard_patchboard-py
train
py
a9765a873903543ae53b973ea567d96f24cf0854
diff --git a/sllurp/llrp.py b/sllurp/llrp.py index <HASH>..<HASH> 100644 --- a/sllurp/llrp.py +++ b/sllurp/llrp.py @@ -10,7 +10,7 @@ from llrp_proto import LLRPROSpec, LLRPError, Message_struct, \ Message_Type2Name, llrp_data2xml, LLRPMessageDict import copy from util import * -from twisted.internet import reactor +from twisted.internet import reactor, task from twisted.internet.protocol import Protocol, ClientFactory from twisted.internet.error import ReactorAlreadyRunning @@ -345,6 +345,16 @@ class LLRPClient (Protocol): }})) self.state = LLRPClient.STATE_SENT_DELETE_ROSPEC + def pause (self, duration_seconds): + """Pause an inventory operation for a set amount of time.""" + if self.state != LLRPClient.STATE_INVENTORYING: + logger.debug('cannot pause() if not inventorying; ignoring') + return + logger.info('pausing for {} seconds'.format(duration_seconds)) + self.stopPolitely() + d = task.deferLater(reactor, duration_seconds, reactor.callFromThread, + self.startInventory) + def sendLLRPMessage (self, llrp_msg): reactor.callFromThread(self.sendMessage, llrp_msg.msgbytes)
implement pause(duration) to pause reader pausing periodically should allow tags that have stumbled into infinite loops to run out of energy, thereby resetting them to their initial state.
ransford_sllurp
train
py
53ea31c3d30032bd383b4f99d6f116da4202005f
diff --git a/pydle/client.py b/pydle/client.py index <HASH>..<HASH> 100644 --- a/pydle/client.py +++ b/pydle/client.py @@ -364,8 +364,12 @@ class BasicClient: @async.coroutine def handle_forever(self): """ Handle data forever. """ - while True: + while self.connected: data = yield from self.connection.recv() + if not data: + if self.connected: + self.disconnect(expected=False) + break yield from self.on_data(data)
Don't handle data when disconnected. Should fix at least part of #<I>.
Shizmob_pydle
train
py
9767c69472f323cb94a4e0b123c364a626d480ea
diff --git a/modules/activiti-engine/src/main/java/org/activiti/engine/impl/jobexecutor/ExecuteJobsRunnable.java b/modules/activiti-engine/src/main/java/org/activiti/engine/impl/jobexecutor/ExecuteJobsRunnable.java index <HASH>..<HASH> 100644 --- a/modules/activiti-engine/src/main/java/org/activiti/engine/impl/jobexecutor/ExecuteJobsRunnable.java +++ b/modules/activiti-engine/src/main/java/org/activiti/engine/impl/jobexecutor/ExecuteJobsRunnable.java @@ -27,7 +27,7 @@ import org.slf4j.LoggerFactory; */ public class ExecuteJobsRunnable implements Runnable { - private static Logger log = LoggerFactory.getLogger(AcquireJobsRunnable.class); + private static Logger log = LoggerFactory.getLogger(ExecuteJobsRunnable.class); private final List<String> jobIds; private final JobExecutor jobExecutor;
fixed silly copy paste error in logger factory method
Activiti_Activiti
train
java
0de066c307569ee037ec846ffd4c5e7792e04144
diff --git a/protocolcheck.js b/protocolcheck.js index <HASH>..<HASH> 100644 --- a/protocolcheck.js +++ b/protocolcheck.js @@ -90,7 +90,7 @@ } else { if (getInternetExplorerVersion() === 10) { openUriUsingIE10InWindows7(uri, failCb); - } else if (getInternetExplorerVersion() === 11) { + } else if (getInternetExplorerVersion() === 9 || getInternetExplorerVersion() === 11) { openUriWithHiddenFrame(uri, failCb); } else { openUriInNewWindowHack(uri, failCb);
Changed IE9 implementation to fit in with the latest IE9 behavior
ismailhabib_custom-protocol-detection
train
js
9370f390b6c264f5016754826a5d7315d77542de
diff --git a/configure.py b/configure.py index <HASH>..<HASH> 100755 --- a/configure.py +++ b/configure.py @@ -253,12 +253,13 @@ if options.with_gtest: path = options.with_gtest gtest_all_incs = '-I%s -I%s' % (path, os.path.join(path, 'include')) + gtest_cflags = '-fvisibility=hidden ' + gtest_all_incs objs += n.build(built('gtest-all.o'), 'cxx', os.path.join(path, 'src/gtest-all.cc'), - variables=[('cflags', gtest_all_incs)]) + variables=[('cflags', gtest_cflags)]) objs += n.build(built('gtest_main.o'), 'cxx', os.path.join(path, 'src/gtest_main.cc'), - variables=[('cflags', gtest_all_incs)]) + variables=[('cflags', gtest_cflags)]) test_cflags = cflags + ['-I%s' % os.path.join(path, 'include')] else:
build gtest with -fvisibility=hidden as well Fixes a warning on Mac.
ninja-build_ninja
train
py
fc127664569724051fecb35aa644337a21403f04
diff --git a/classes/bors.php b/classes/bors.php index <HASH>..<HASH> 100644 --- a/classes/bors.php +++ b/classes/bors.php @@ -65,6 +65,14 @@ class bors if(file_exists($f = COMPOSER_ROOT.'/bors/autoload.php')) require_once $f; + foreach(bors::$package_route_maps as $map_file) + { + $map = NULL; + require_once($map_file); + if($map) + bors_url_map($map); + } + foreach(bors::$composer_route_maps as $map_file) { $map = NULL; diff --git a/engines/bors/vhosts_loader.php b/engines/bors/vhosts_loader.php index <HASH>..<HASH> 100644 --- a/engines/bors/vhosts_loader.php +++ b/engines/bors/vhosts_loader.php @@ -34,6 +34,7 @@ function borsmaps_load() foreach(bors_dirs(true) as $dir) { +// echo "=$dir=<br/>"; $map = array(); if(file_exists($file = secure_path("{$dir}/url_map.php"))) require_once($file);
Load package route map first.
Balancer_bors-core
train
php,php
2344b0eac868c933d1200995047531534a91523d
diff --git a/core/Application/Environment.php b/core/Application/Environment.php index <HASH>..<HASH> 100644 --- a/core/Application/Environment.php +++ b/core/Application/Environment.php @@ -80,6 +80,11 @@ class Environment $this->definitions = $definitions; } + public function getEnvironmentName() + { + return $this->environment; + } + /** * Initializes the kernel globals and DI container. */ @@ -88,6 +93,7 @@ class Environment $this->invokeBeforeContainerCreatedHook(); $this->container = $this->createContainer(); + $this->container->set(self::class, $this); StaticContainer::push($this->container);
Couple tweaks to Environment class so current environment name can be easily queried. (#<I>)
matomo-org_matomo
train
php
4acb33f67b64af0e875598eca60133d6801c5ba9
diff --git a/lib/tablelib.php b/lib/tablelib.php index <HASH>..<HASH> 100644 --- a/lib/tablelib.php +++ b/lib/tablelib.php @@ -1545,7 +1545,7 @@ class table_sql extends flexible_table { * Of course you can use sub-queries, JOINS etc. by putting them in the * appropriate clause of the query. */ - function set_sql($fields, $from, $where, array $params = NULL) { + function set_sql($fields, $from, $where, array $params = array()) { $this->sql = new stdClass(); $this->sql->fields = $fields; $this->sql->from = $from;
MDL-<I> tablelib.php: changed default of $params in set_sql to array() Default of $params = null leads to a problem in query_db(). There this value is used in array_merge, which can not handle null values. If null is passed for one of the params the outcome will be null independent of the value of the second param!
moodle_moodle
train
php
2095c2b9f1691edc2ff1b3fcf783c0d0bb7e05b5
diff --git a/src/org/opencms/ade/configuration/CmsResourceTypeConfig.java b/src/org/opencms/ade/configuration/CmsResourceTypeConfig.java index <HASH>..<HASH> 100644 --- a/src/org/opencms/ade/configuration/CmsResourceTypeConfig.java +++ b/src/org/opencms/ade/configuration/CmsResourceTypeConfig.java @@ -420,11 +420,10 @@ public class CmsResourceTypeConfig implements I_CmsConfigurationObject<CmsResour return AddMenuVisibility.disabled; } - if (isCreateDisabled() && (menuType == AddMenuType.ade)) { - return AddMenuVisibility.createDisabled; - } - if (elementViewId.equals(getElementView())) { + if (isCreateDisabled() && (menuType == AddMenuType.ade)) { + return AddMenuVisibility.createDisabled; + } return AddMenuVisibility.visible; }
Fixing issue where types marked as 'create disable' where visible in all views.
alkacon_opencms-core
train
java
86dc04fcd902253771d813086d9e956ceb4ae92d
diff --git a/src/main/java/com/rometools/opml/io/impl/OPML10Generator.java b/src/main/java/com/rometools/opml/io/impl/OPML10Generator.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/rometools/opml/io/impl/OPML10Generator.java +++ b/src/main/java/com/rometools/opml/io/impl/OPML10Generator.java @@ -67,6 +67,7 @@ public class OPML10Generator extends BaseWireFeedGenerator implements WireFeedGe final Opml opml = (Opml) feed; final Document doc = new Document(); final Element root = new Element("opml"); + root.setAttribute("version", "1.0"); doc.addContent(root); final Element head = generateHead(opml);
set opml version for OPML <I> generator
rometools_rome
train
java
aa0fd163fd15baf8014b14390f3fafa98bfc8acf
diff --git a/tests/unit/plugins/database/AttachOneModelTest.php b/tests/unit/plugins/database/AttachOneModelTest.php index <HASH>..<HASH> 100644 --- a/tests/unit/plugins/database/AttachOneModelTest.php +++ b/tests/unit/plugins/database/AttachOneModelTest.php @@ -15,6 +15,19 @@ class AttachOneModelTest extends PluginTestCase $this->runPluginRefreshCommand('Database.Tester'); } + public function testSetRelationValue() + { + Model::unguard(); + $user = User::create(['name' => 'Stevie', 'email' => 'stevie@email.tld']); + Model::reguard(); + + // Set by string + $user->avatar = base_path().'/tests/fixtures/plugins/database/tester/assets/images/avatar.png'; + $user->save(); + $this->assertNotNull($user->avatar); + $this->assertEquals('avatar.png', $user->avatar->file_name); + } + public function testDeleteFlagDestroyRelationship() { Model::unguard();
File attachments should support creation by string Refs <URL>
octobercms_october
train
php
fb64a0f6edd7d6a0e8abea12ec8c31fe902143d9
diff --git a/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java b/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java index <HASH>..<HASH> 100644 --- a/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java +++ b/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java @@ -379,6 +379,9 @@ public class SSHLauncher extends ComputerLauncher { connection.exec("rm -rf "+javaDir,listener.getLogger()); sftp.mkdirs(javaDir, 0755); + if (jdk==null) + jdk = new DefaultJDKInstaller(); + URL bundle = jdk.locate(listener, p, cpu); listener.getLogger().println("Installing JDK6u16");
for data read from old configuration, this value can be null
jenkinsci_ssh-slaves-plugin
train
java
138ff7756d9326aa4a7e3ac456b9d5ecf0ce162f
diff --git a/imageresizer/elementactions/ImageResizer_CropImageElementAction.php b/imageresizer/elementactions/ImageResizer_CropImageElementAction.php index <HASH>..<HASH> 100644 --- a/imageresizer/elementactions/ImageResizer_CropImageElementAction.php +++ b/imageresizer/elementactions/ImageResizer_CropImageElementAction.php @@ -13,6 +13,8 @@ class ImageResizer_CropImageElementAction extends BaseElementAction craft()->templates->includeJsResource('lib/jcrop/jquery.Jcrop.min.js'); craft()->templates->includeCssResource('lib/jcrop/jquery.Jcrop.min.css'); + craft()->templates->includeJsResource('imageresizer/lib/imagesloaded.pkgd.min.js'); + $croppingRatios = craft()->imageResizer->getSettings()->croppingRatios; craft()->templates->includeCssResource('imageresizer/css/CropElementAction.css');
Use ImagesLoaded.js for better UI feedback when dealing with large or remote images
verbb_image-resizer
train
php
32446ca3ef1e7983b25a65206492d9461e2de700
diff --git a/pcapfile/protocols/transport/udp.py b/pcapfile/protocols/transport/udp.py index <HASH>..<HASH> 100644 --- a/pcapfile/protocols/transport/udp.py +++ b/pcapfile/protocols/transport/udp.py @@ -14,8 +14,7 @@ class UDP(ctypes.Structure): _fields_ = [('src_port', ctypes.c_ushort), # source port ('dst_port', ctypes.c_ushort), # destination port ('len', ctypes.c_ushort), # length of header and data - ('sum', ctypes.c_ushort), # checksum - ('payload', ctypes.c_char_p)] # packet payload + ('sum', ctypes.c_ushort)] # checksum udp_header_size = 8 @@ -26,7 +25,7 @@ class UDP(ctypes.Structure): self.dst_port = fields[1] self.len = fields[2] self.sum = fields[3] - self.payload = ctypes.c_char_p(packet[self.udp_header_size:]) + self.payload = packet[self.udp_header_size:] def __str__(self): packet = 'udp packet from port %d to port %d carrying %d bytes'
Removed ctypes field for UDP.payload
kisom_pypcapfile
train
py
42fec0c77095202987da11fa117ad211c93d67b5
diff --git a/mythril/laser/ethereum/transaction/symbolic.py b/mythril/laser/ethereum/transaction/symbolic.py index <HASH>..<HASH> 100644 --- a/mythril/laser/ethereum/transaction/symbolic.py +++ b/mythril/laser/ethereum/transaction/symbolic.py @@ -21,9 +21,10 @@ CREATOR_ADDRESS = 0xAFFEAFFEAFFEAFFEAFFEAFFEAFFEAFFEAFFEAFFE ATTACKER_ADDRESS = 0xDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF ACTOR_ADDRESSES = [ - symbol_factory.BitVecVal(0xAFFEAFFEAFFEAFFEAFFEAFFEAFFEAFFEAFFEAFFE, 256), - symbol_factory.BitVecVal(0xDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF, 256), - symbol_factory.BitVecVal(0xDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEE, 256), + symbol_factory.BitVecVal(0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, 256), + symbol_factory.BitVecVal(0xBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB, 256), + symbol_factory.BitVecVal(0xCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC, 256), + symbol_factory.BitVecVal(0xDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD, 256), ]
Change actor addresses in line with MythX test case conventions
ConsenSys_mythril-classic
train
py
4ea54d14e5b865c504e4b001a125726be09a4abb
diff --git a/pymatgen/analysis/interfaces/zsl.py b/pymatgen/analysis/interfaces/zsl.py index <HASH>..<HASH> 100644 --- a/pymatgen/analysis/interfaces/zsl.py +++ b/pymatgen/analysis/interfaces/zsl.py @@ -34,7 +34,7 @@ class ZSLMatch(MSONable): @property def match_area(self): """ The area of the match between the substrate and film super lattice vectors """ - return vec_area(self.film_sl_vectors) + return vec_area(*self.film_sl_vectors.tolist()) @property def match_transformation(self): diff --git a/pymatgen/analysis/substrate_analyzer.py b/pymatgen/analysis/substrate_analyzer.py index <HASH>..<HASH> 100644 --- a/pymatgen/analysis/substrate_analyzer.py +++ b/pymatgen/analysis/substrate_analyzer.py @@ -6,8 +6,9 @@ This module provides classes to identify optimal substrates for film growth """ -from pymatgen.analysis.interfaces import ZSLGenerator, SubstrateAnalyzer # noqa import warnings +from pymatgen.analysis.interfaces import ZSLGenerator, SubstrateAnalyzer # noqa + __author__ = "Shyam Dwaraknath" __copyright__ = "Copyright 2016, The Materials Project"
fix pylint issues
materialsproject_pymatgen
train
py,py
a2f91b0a7cd398db25d9d98959eede8fb958c4ca
diff --git a/test/support/TestApp.js b/test/support/TestApp.js index <HASH>..<HASH> 100644 --- a/test/support/TestApp.js +++ b/test/support/TestApp.js @@ -17,6 +17,7 @@ class TestApp extends Dispatcher { this.log.info = sinon.spy(); this.log.error = sinon.spy(); this.config = {}; + this.writeDefaultConfig = sinon.spy(); this.on = sinon.spy(this.on); this.once = sinon.spy(this.once);
Added writeDefaultConfig to test app
nxus_core
train
js
892fc2d6b391beecfe919c9c9a09f35dd218728a
diff --git a/closure/goog/net/xpc/iframerelaytransport.js b/closure/goog/net/xpc/iframerelaytransport.js index <HASH>..<HASH> 100644 --- a/closure/goog/net/xpc/iframerelaytransport.js +++ b/closure/goog/net/xpc/iframerelaytransport.js @@ -338,9 +338,13 @@ goog.net.xpc.IframeRelayTransport.prototype.send_ = // handler is not triggered if (goog.userAgent.IE) { var div = this.getWindow().document.createElement('div'); - goog.dom.safe.setInnerHtml(div, goog.html.SafeHtml.create('iframe', { - 'onload': goog.string.Const.from('this.xpcOnload()') - })); + // TODO(user): It might be possible to set the sandbox attribute + // to restrict the privileges of the created iframe. + goog.dom.safe.setInnerHtml(div, + goog.html.SafeHtml.createIframe(null, null, { + 'onload': goog.string.Const.from('this.xpcOnload()'), + 'sandbox': null + })); var ifr = div.childNodes[0]; div = null; ifr['xpcOnload'] = goog.net.xpc.IframeRelayTransport.iframeLoadHandler_;
Fix bug: use SafeHtml.createIframe() instead of passing 'iframe' to SafeHtml.create(), which is not supported. ------------- Created by MOE: <URL>
google_closure-library
train
js
650a1077d20d8f9a253027dfb16b956fe5d87022
diff --git a/includes/session_spider.php b/includes/session_spider.php index <HASH>..<HASH> 100644 --- a/includes/session_spider.php +++ b/includes/session_spider.php @@ -313,20 +313,6 @@ if(!$real) { Zend_Session::setId(gen_spider_session_name($spider_name, "")); } -// stop spiders from accessing certain parts of the site -$bots_not_allowed = array( -'/reports/', -'/includes/', -'config', -'clippings', -'gedrecord.php' -); -if ($SEARCH_SPIDER && in_array(WT_SCRIPT_NAME, $bots_not_allowed)) { - header("HTTP/1.0 403 Forbidden"); - print "Sorry, this page is not available for search engine bots."; - exit; -} - // Manual Search Engine IP Address tagging // Allow an admin to mark IP addresses as known search engines even if // they are not automatically detected above. Setting his own IP address
Remove search-spider check for unauthorised pages - this duplicates code in session.php, and can never be reached.
fisharebest_webtrees
train
php
dabf563b1b8f078652a9885607ac2aafb1d92484
diff --git a/src/apiClient.php b/src/apiClient.php index <HASH>..<HASH> 100644 --- a/src/apiClient.php +++ b/src/apiClient.php @@ -15,7 +15,7 @@ * limitations under the License. */ -// Check for the required json and curl extensions, the Google API PHP Client won't function without +// Check for the required json and curl extensions, the Google API PHP Client won't function without them. if (! function_exists('curl_init')) { throw new Exception('The Google PHP API Client requires the CURL PHP extension'); } @@ -24,6 +24,10 @@ if (! function_exists('json_decode')) { throw new Exception('The Google PHP API Client requires the JSON PHP extension'); } +if (function_exists('date_default_timezone_set')) { + date_default_timezone_set('UTC'); +} + // hack around with the include paths a bit so the library 'just works' $cwd = dirname(__FILE__); set_include_path("$cwd" . PATH_SEPARATOR . get_include_path());
[fix issue <I>] - Set the default timezone property as UTC, as it is required by time() and strtotime(). git-svn-id: <URL>
evert_google-api-php-client
train
php
fb1c394989e97adc7fc2297e19fb513679429495
diff --git a/tests/before_travis_test.js b/tests/before_travis_test.js index <HASH>..<HASH> 100644 --- a/tests/before_travis_test.js +++ b/tests/before_travis_test.js @@ -261,6 +261,7 @@ function seedDataForAuthModule() { proc.on('close', function (code) { console.log('step #7 process exited with code ' + code + '\n' ); + console.log( process.env.NODE_PATH ); console.dir( require( path.resolve( path.join( __dirname, '..', prName, 'config' ) ) ) ); console.dir( require( path.resolve( path.join( __dirname, '..', prName, 'package.json' ) ) ) ); resolve();
debug(travis): NODE_PATH
CleverStack_clever-auth
train
js
9581ada52039b3cb614813ec576d08a2cdfa621f
diff --git a/scripts/watch.js b/scripts/watch.js index <HASH>..<HASH> 100755 --- a/scripts/watch.js +++ b/scripts/watch.js @@ -3,7 +3,13 @@ const path = require('path') const shell = require('shelljs') -const packages = shell.ls(path.join(__dirname, '..', 'packages')) +const packages = shell.ls(path.join(__dirname, '..', 'packages')).filter( + /** + * ignore node_modules directory that is created by the link script to test the + * wdio test runner + */ + (pkg) => pkg !== 'node_modules' +) /** * set proper size of max listener
ignore node_modules directory in package folder to watch
webdriverio_webdriverio
train
js
5291245fa02118eaf48487288fbb2bea47a110de
diff --git a/Entity/Parameters/AbstractParameter.php b/Entity/Parameters/AbstractParameter.php index <HASH>..<HASH> 100644 --- a/Entity/Parameters/AbstractParameter.php +++ b/Entity/Parameters/AbstractParameter.php @@ -68,6 +68,24 @@ abstract class AbstractParameter /** * @return string */ + public function getIn() + { + return $this->in; + } + + /** + * @param string $in + * @return AbstractParameter + */ + public function setIn($in) + { + $this->in = $in; + return $this; + } + + /** + * @return string + */ public function getName() { return $this->name; diff --git a/Entity/Parameters/AbstractTypedParameter.php b/Entity/Parameters/AbstractTypedParameter.php index <HASH>..<HASH> 100644 --- a/Entity/Parameters/AbstractTypedParameter.php +++ b/Entity/Parameters/AbstractTypedParameter.php @@ -45,6 +45,24 @@ abstract class AbstractTypedParameter extends AbstractParameter /** * @return string */ + public function getType() + { + return $this->type; + } + + /** + * @param string $type + * @return AbstractTypedParameter + */ + public function setType($type) + { + $this->type = $type; + return $this; + } + + /** + * @return string + */ public function getFormat() { return $this->format;
Added getters and setters to abstract parameter entities
epfremmer_swagger-php
train
php,php
e6cb0502ce4ac754b227c427ade2f517cda580a4
diff --git a/modules/activiti-engine/src/main/java/org/activiti/engine/impl/test/PluggableActivitiTestCase.java b/modules/activiti-engine/src/main/java/org/activiti/engine/impl/test/PluggableActivitiTestCase.java index <HASH>..<HASH> 100644 --- a/modules/activiti-engine/src/main/java/org/activiti/engine/impl/test/PluggableActivitiTestCase.java +++ b/modules/activiti-engine/src/main/java/org/activiti/engine/impl/test/PluggableActivitiTestCase.java @@ -40,10 +40,10 @@ public class PluggableActivitiTestCase extends AbstractActivitiTestCase { protected void initializeProcessEngine() { if (cachedProcessEngine == null) { + pluggableActivitiTestCaseLogger.info("No cached process engine found for test. Retrieving the default engine."); -// cachedProcessEngine = ProcessEngineConfiguration -// .createProcessEngineConfigurationFromResource("activiti.cfg.xml") -// .buildProcessEngine(); + ProcessEngines.destroy(); // Just to be sure we're not getting any previously cached version + cachedProcessEngine = ProcessEngines.getDefaultProcessEngine(); if (cachedProcessEngine==null) { throw new ActivitiException("no default process engine available");
Adding extra destroy to PluggableActivitiTestCase, just to be sure
Activiti_Activiti
train
java