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
949deb4cd4f16dee3d3956667b4c23d461a43ca3
diff --git a/lib/deterministic/option.rb b/lib/deterministic/option.rb index <HASH>..<HASH> 100644 --- a/lib/deterministic/option.rb +++ b/lib/deterministic/option.rb @@ -23,7 +23,7 @@ module Deterministic class << self protected :new - def nil?(expr) + def some?(expr) to_option(expr) { expr.nil? } end diff --git a/spec/lib/deterministic/option_spec.rb b/spec/lib/deterministic/option_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/deterministic/option_spec.rb +++ b/spec/lib/deterministic/option_spec.rb @@ -5,9 +5,9 @@ include Deterministic describe Deterministic::Option do # nil? - specify { expect(described_class.nil?(nil)).to eq None } - specify { expect(described_class.nil?(1)).to be_some } - specify { expect(described_class.nil?(1)).to eq Some(1) } + specify { expect(described_class.some?(nil)).to eq None } + specify { expect(described_class.some?(1)).to be_some } + specify { expect(described_class.some?(1)).to eq Some(1) } # any? specify { expect(described_class.any?(nil)).to be_none }
Rename Option.nil? to Option.some?
pzol_deterministic
train
rb,rb
5e20e7f097e871e40487d1f1f9bc8d98ee1996a6
diff --git a/src/Configurator/JavaScript.php b/src/Configurator/JavaScript.php index <HASH>..<HASH> 100644 --- a/src/Configurator/JavaScript.php +++ b/src/Configurator/JavaScript.php @@ -128,6 +128,9 @@ class JavaScript // Minify the source $src = $this->getMinifier()->get($src); + // Wrap the source in a function to protect the global scope + $src = '(function(){' . $src . '})()'; + return $src; } diff --git a/tests/Configurator/JavaScriptTest.php b/tests/Configurator/JavaScriptTest.php index <HASH>..<HASH> 100644 --- a/tests/Configurator/JavaScriptTest.php +++ b/tests/Configurator/JavaScriptTest.php @@ -108,7 +108,7 @@ class JavaScriptTest extends Test $this->configurator->enableJavaScript(); $this->configurator->javascript->setMinifier($mock); - $this->assertSame('/**/', $this->configurator->javascript->getParser()); + $this->assertContains('/**/', $this->configurator->javascript->getParser()); } /**
JavaScript: wrapped the source in a function to protect the global scope
s9e_TextFormatter
train
php,php
0502fa3c066faa266f19e7f0a33f180cd6be1c97
diff --git a/tests/ProxyManagerTest/Functional/LazyLoadingValueHolderFunctionalTest.php b/tests/ProxyManagerTest/Functional/LazyLoadingValueHolderFunctionalTest.php index <HASH>..<HASH> 100644 --- a/tests/ProxyManagerTest/Functional/LazyLoadingValueHolderFunctionalTest.php +++ b/tests/ProxyManagerTest/Functional/LazyLoadingValueHolderFunctionalTest.php @@ -309,7 +309,7 @@ class LazyLoadingValueHolderFunctionalTest extends PHPUnit_Framework_TestCase { $selfHintParam = new ClassWithSelfHint(); - return array( + $data = array( array( 'ProxyManagerTestAsset\\BaseClass', new BaseClass(), @@ -338,14 +338,20 @@ class LazyLoadingValueHolderFunctionalTest extends PHPUnit_Framework_TestCase array(), 'publicMethodDefault' ), - array( + ); + + if (PHP_VERSION_ID >= 50401) { + // PHP < 5.4.1 misbehaves, throwing strict standards, see https://bugs.php.net/bug.php?id=60573 + $data[] = array( 'ProxyManagerTestAsset\\ClassWithSelfHint', new ClassWithSelfHint(), 'selfHintMethod', array('parameter' => $selfHintParam), $selfHintParam - ), - ); + ); + } + + return $data; } /**
Skipping `self` hint tests for PHP < <I> as of <URL>
Ocramius_ProxyManager
train
php
c093505baade135e8374ad9203bc8253f3d7419e
diff --git a/Configuration/TCA/tx_styleguide_elements_rte.php b/Configuration/TCA/tx_styleguide_elements_rte.php index <HASH>..<HASH> 100644 --- a/Configuration/TCA/tx_styleguide_elements_rte.php +++ b/Configuration/TCA/tx_styleguide_elements_rte.php @@ -72,6 +72,11 @@ return [ 'config' => [ 'type' => 'text', 'enableRichtext' => true, + 'fieldControls' => [ + 'fullScreenRichtext' => [ + 'disabled' => false, + ], + ], ], ], 'rte_2' => [
[TASK] TCA: rtehtmlarea full screen wizard new style
TYPO3_styleguide
train
php
64f3b5dd371222298aef939a65fe9bb30b8ea7f5
diff --git a/lib/node_modules/@stdlib/random/streams/arcsine/lib/main.js b/lib/node_modules/@stdlib/random/streams/arcsine/lib/main.js index <HASH>..<HASH> 100644 --- a/lib/node_modules/@stdlib/random/streams/arcsine/lib/main.js +++ b/lib/node_modules/@stdlib/random/streams/arcsine/lib/main.js @@ -121,10 +121,11 @@ function read() { } this._iter += 1; - r = r.value.toString(); - debug( 'Generated a new pseudorandom number. Value: %s. Iter: %d.', r, this._iter ); + r = r.value; + debug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._iter ); if ( this._objectMode === false ) { + r = r.toString(); if ( this._iter === 1 ) { r = string2buffer( r ); } else {
Push a number when stream operates in object mode
stdlib-js_stdlib
train
js
eb750f581060c1117660ee6530102452b57fde0d
diff --git a/src/test/java/integration/SizzleSelectorsTest.java b/src/test/java/integration/SizzleSelectorsTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/integration/SizzleSelectorsTest.java +++ b/src/test/java/integration/SizzleSelectorsTest.java @@ -42,7 +42,7 @@ public class SizzleSelectorsTest extends IntegrationTest { $("input[name!='username'][name!='password']").shouldHave(attribute("name", "rememberMe")); $(":header").shouldHave(text("Page with JQuery")); $(":header", 1).shouldHave(text("Now typing")); - $(":contains('not hover')").shouldHave(text("It's not hover")); + $("div:contains('not hover')").shouldHave(text("It's not hover")); assertEquals("title", $(":parent:not('html'):not('head')").getTagName()); } }
fix test: body also contains "not hover"
selenide_selenide
train
java
2ea312427daa4e33d6f5295bc3d4b70618f7db75
diff --git a/azure/servicemanagement/servicemanagementservice.py b/azure/servicemanagement/servicemanagementservice.py index <HASH>..<HASH> 100644 --- a/azure/servicemanagement/servicemanagementservice.py +++ b/azure/servicemanagement/servicemanagementservice.py @@ -504,18 +504,21 @@ class ServiceManagementService(_ServiceManagementClient): extended_properties), async=True) - def delete_deployment(self, service_name, deployment_name): + def delete_deployment(self, service_name, deployment_name,delete_vhd=False): ''' Deletes the specified deployment. service_name: Name of the hosted service. deployment_name: The name of the deployment. + delete_vhd: If True, delete the vhd associated with this deployment (if any). Defaults to False. ''' _validate_not_none('service_name', service_name) _validate_not_none('deployment_name', deployment_name) + path= self._get_deployment_path_using_name(service_name, deployment_name) + if delete_vhd: + path += '?comp=media' return self._perform_delete( - self._get_deployment_path_using_name( - service_name, deployment_name), + path, async=True) def swap_deployment(self, service_name, production, source_deployment):
adding delete_vhd option to delete_deployment
Azure_azure-sdk-for-python
train
py
c27d86ea1429649cb98515efb97e23f95508e1e8
diff --git a/client/search.go b/client/search.go index <HASH>..<HASH> 100644 --- a/client/search.go +++ b/client/search.go @@ -30,7 +30,8 @@ type SearchRequest struct { QueryType, RestrictedIndicator, Payload, - HTTPMethod string + HTTPMethod, + DefaultEncoding string Count, // TODO NONE is a valid option, this needs to be modified @@ -88,5 +89,9 @@ func SearchStream(requester Requester, ctx context.Context, r SearchRequest) (io if err != nil { return nil, err } - return DefaultReEncodeReader(resp.Body, resp.Header.Get(ContentType)), nil + contentType := resp.Header.Get(ContentType) + if contentType == "" { + contentType = r.DefaultEncoding + } + return DefaultReEncodeReader(resp.Body, contentType), nil }
support for default encoding when an mls provides no information and utf-8 aint it
jpfielding_gorets
train
go
b1ced2af03c5a8009c314bde80b5f2516e0522fd
diff --git a/integration-cli/docker_cli_plugins_test.go b/integration-cli/docker_cli_plugins_test.go index <HASH>..<HASH> 100644 --- a/integration-cli/docker_cli_plugins_test.go +++ b/integration-cli/docker_cli_plugins_test.go @@ -462,7 +462,7 @@ enabled: false`, id, name) } func (s *DockerSuite) TestPluginUpgrade(c *check.C) { - testRequires(c, DaemonIsLinux, Network, SameHostDaemon, IsAmd64) + testRequires(c, DaemonIsLinux, Network, SameHostDaemon, IsAmd64, NotUserNamespace) plugin := "cpuguy83/docker-volume-driver-plugin-local:latest" pluginV2 := "cpuguy83/docker-volume-driver-plugin-local:v2"
Turn off plugin upgrade test when userns on Until volume plugins can be made aware of the remapped root, interactions with volumes created by plugin will not work as the file ownership denies permissions to the userns remapped range. Docker-DCO-<I>-
moby_moby
train
go
c5ea2f01e36329d413f3c1578891304a4074ef46
diff --git a/src/Traits/CustomPostTypeTrait.php b/src/Traits/CustomPostTypeTrait.php index <HASH>..<HASH> 100644 --- a/src/Traits/CustomPostTypeTrait.php +++ b/src/Traits/CustomPostTypeTrait.php @@ -31,14 +31,16 @@ trait CustomPostTypeTrait */ public function createPostType() { + $options = array_merge([ + 'supports' => $this->getSupports() + ], $this->getOptions()); + $post = new CPT([ 'post_type_name' => $this->getPostType(), 'singular' => $this->getSingular(), 'plural' => $this->getPlural(), 'slug' => $this->getSlug(), - ], [ - 'supports' => $this->getSupports() - ]); + ], $options); $post->menu_icon($this->getIcon()); $post->set_textdomain($this->getTextDomain()); @@ -101,6 +103,14 @@ trait CustomPostTypeTrait } /** + * @return string[] + */ + public function getOptions() + { + return []; + } + + /** * @return array|null */ public function getTaxonomySettings()
Added getOptions function to set all option to CPT
gwa_zero-library
train
php
a39e551d8d142b236f1e4c80a04a51762228e5ed
diff --git a/lib/checks/classNameIsNotDynamic.js b/lib/checks/classNameIsNotDynamic.js index <HASH>..<HASH> 100644 --- a/lib/checks/classNameIsNotDynamic.js +++ b/lib/checks/classNameIsNotDynamic.js @@ -26,7 +26,7 @@ module.exports = function (data) { result.errors.push( { line: lineNumber, - column: classAttributeMatch.index, + column: classAttributeMatch.index + 2, message: 'Class attribute "' + classAttribute + '" is dynamic which can confuse static analysis', tag: 'classNameIsNotDynamic' } diff --git a/tasks/htmlsniffer.js b/tasks/htmlsniffer.js index <HASH>..<HASH> 100644 --- a/tasks/htmlsniffer.js +++ b/tasks/htmlsniffer.js @@ -73,6 +73,14 @@ module.exports = function (grunt) { ) .then(flatten) .then(function (results) { + results.forEach(function (result) { + // correct line-number to be not zero based + result.errors.forEach(function (error) { error.line++; }); + }); + + return results; + }) + .then(function (results) { if (self.data.options.checkstyle) { grunt.file.write(self.data.options.checkstyle, reporters.checkstyle(results)); } else {
fix(line/column): Fix line and column number
researchgate_grunt-html-sniffer
train
js,js
0a9c6a43c770e97b6625fde9eda95fe7b5cd7ac9
diff --git a/impl/src/main/java/org/ehcache/internal/cachingtier/TieredCache.java b/impl/src/main/java/org/ehcache/internal/cachingtier/TieredCache.java index <HASH>..<HASH> 100644 --- a/impl/src/main/java/org/ehcache/internal/cachingtier/TieredCache.java +++ b/impl/src/main/java/org/ehcache/internal/cachingtier/TieredCache.java @@ -195,13 +195,13 @@ public class TieredCache<K, V> implements Cache<K, V> { Thread.currentThread().interrupt(); } } - } - if (throwable != null) { - throw new RuntimeException("Faulting from underlying cache failed on other thread", throwable); - } + if (throwable != null) { + throw new RuntimeException("Faulting from underlying cache failed on other thread", throwable); + } - return value; + return value; + } } void fail(final Throwable t) {
Issue #<I> Pleasing findbugs extending the scope of the synchronized block
ehcache_ehcache3
train
java
c0e0678805d5286c0ebd8ed2868128a7c8204848
diff --git a/src/Select.js b/src/Select.js index <HASH>..<HASH> 100644 --- a/src/Select.js +++ b/src/Select.js @@ -348,6 +348,8 @@ var Select = React.createClass({ loadAsyncOptions: function(input, state) { + var thisRequestId = this._currentRequestId = requestId++; + for (var i = 0; i <= input.length; i++) { var cacheKey = input.slice(0, i); if (this._optionsCache[cacheKey] && (input === cacheKey || this._optionsCache[cacheKey].complete)) { @@ -360,8 +362,6 @@ var Select = React.createClass({ } } - var thisRequestId = this._currentRequestId = requestId++; - this.props.asyncOptions(input, function(err, data) { this._optionsCache[input] = data;
Fix issue w/ remote callbacks overriding cached options
HubSpot_react-select-plus
train
js
5c8b3f3f4ca15d3ad2dcaa97001cd88b9364a89e
diff --git a/gns3server/compute/dynamips/nodes/router.py b/gns3server/compute/dynamips/nodes/router.py index <HASH>..<HASH> 100644 --- a/gns3server/compute/dynamips/nodes/router.py +++ b/gns3server/compute/dynamips/nodes/router.py @@ -1311,6 +1311,11 @@ class Router(BaseNode): """ try: + open(output_file, 'w+').close() + except OSError as e: + raise DynamipsError('Can not write capture to "{}": {}'.format(output_file, str(e))) + + try: adapter = self._slots[slot_number] except IndexError: raise DynamipsError('Slot {slot_number} does not exist on router "{name}"'.format(name=self._name,
Avoid crash at capture startup with dynamips
GNS3_gns3-server
train
py
155cb406cf3e38cfddf3eb5c3648125cec09f91f
diff --git a/html/pfappserver/root/static.alt/src/store/modules/config.js b/html/pfappserver/root/static.alt/src/store/modules/config.js index <HASH>..<HASH> 100644 --- a/html/pfappserver/root/static.alt/src/store/modules/config.js +++ b/html/pfappserver/root/static.alt/src/store/modules/config.js @@ -184,7 +184,7 @@ const api = { return apiCall({ url: 'config/switches', method: 'get', params: { limit: 1000 } }) }, getSwitchGroups () { - return apiCall({ url: 'config/switch_groups', method: 'get' }) + return apiCall({ url: 'config/switch_groups', method: 'get', params: { limit: 1000 } }) }, getSwitchGroupMembers (id) { return apiCall({ url: `config/switch_group/${id}/members`, method: 'get' })
(web admin) increase limit of switch groups in node sidebar, fixes #<I>
inverse-inc_packetfence
train
js
ae35532a1841a277cc1ae2a737f759a5b6f63ebb
diff --git a/packages/swagger2openapi/validate.js b/packages/swagger2openapi/validate.js index <HASH>..<HASH> 100644 --- a/packages/swagger2openapi/validate.js +++ b/packages/swagger2openapi/validate.js @@ -780,6 +780,9 @@ function checkPathItem(pathItem, path, openapi, options) { } if (options.lint) options.linter('operation',op,o,options); } + else if (!o.startsWith('x-')) { + should.fail(false,true,'PathItem should not have additional property '+o); + } options.context.pop(); } if (options.lint) options.linter('pathItem',pathItem,path,options);
validator; helpful message for pathitem additional property error
Mermade_oas-kit
train
js
4a6e0d69c4aab08aa702121303521618d7b1faea
diff --git a/lib/Thelia/Controller/BaseController.php b/lib/Thelia/Controller/BaseController.php index <HASH>..<HASH> 100644 --- a/lib/Thelia/Controller/BaseController.php +++ b/lib/Thelia/Controller/BaseController.php @@ -56,6 +56,8 @@ abstract class BaseController extends ContainerAware protected $currentRouter; + protected $translator; + /** * Return an empty response (after an ajax request, for example) * @param int $status @@ -118,14 +120,16 @@ abstract class BaseController extends ContainerAware } /** - * * return the Translator * * @return Translator */ public function getTranslator() { - return $this->container->get('thelia.translator'); + if (null === $this->translator){ + $this->translator = $this->container->get('thelia.translator'); + } + return $this->translator; } /**
Save translator rather than getting it from the container each time.
thelia_core
train
php
a6d30c1849eeb0432e15f99d878037098968f0cf
diff --git a/src/com/google/javascript/jscomp/WhitelistWarningsGuard.java b/src/com/google/javascript/jscomp/WhitelistWarningsGuard.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/WhitelistWarningsGuard.java +++ b/src/com/google/javascript/jscomp/WhitelistWarningsGuard.java @@ -97,16 +97,23 @@ public class WhitelistWarningsGuard extends WarningsGuard { @Override public CheckLevel level(JSError error) { + if (error.getDefaultLevel().equals(CheckLevel.ERROR) + && !DOWNGRADEABLE_ERRORS_LIST.contains(error.getType().key)) { + return null; + } if (containWarning(formatWarning(error))) { // If the message matches the guard we use WARNING, so that it // - Shows up on stderr, and // - Gets caught by the WhitelistBuilder downstream in the pipeline return CheckLevel.WARNING; } - return null; } + private static final ImmutableSet<String> DOWNGRADEABLE_ERRORS_LIST = + ImmutableSet.of( + ); + /** * Determines whether a given warning is included in the white-list. *
Errors can no longer be downgraded to Warnings by WhitelistWarningGuard. ------------- Created by MOE: <URL>
google_closure-compiler
train
java
6d7a2f8f085565f8d60c82ae4a428d0df9b07c9e
diff --git a/sprd/model/UserAddress.js b/sprd/model/UserAddress.js index <HASH>..<HASH> 100644 --- a/sprd/model/UserAddress.js +++ b/sprd/model/UserAddress.js @@ -18,16 +18,21 @@ define(['sprd/data/SprdModel', 'sprd/entity/Address', 'underscore'], function (S defaultShippingAddress: Boolean }, AddressEntity.prototype.schema); - return SprdModel.inherit('sprd.model.UserAddress', { + var UserAddress = SprdModel.inherit('sprd.model.UserAddress', { defaults: defaults, schema: schema, - validators: AddressEntity.validators, + validators: AddressEntity.prototype.validators, parse: AddressEntity.prototype.parse, compose: AddressEntity.prototype.compose, _commitChangedAttributes: AddressEntity.prototype._commitChangedAttributes, isPackStation: AddressEntity.prototype.isPackStation, supportsCounty: AddressEntity.prototype.supportsCounty, isStateRequired: AddressEntity.prototype.isStateRequired, - needsZipCode: AddressEntity.prototype.needsZipCode + needsZipCode: AddressEntity.prototype.needsZipCode, + }); + + UserAddress.ADDRESS_TYPES = AddressEntity.ADDRESS_TYPES; + + return UserAddress; }); \ No newline at end of file
fixed validators and added address types to user addres
spreadshirt_rAppid.js-sprd
train
js
6f74a0de798ceea54a9bfb6554df856e66535c70
diff --git a/spec/unit/dsl_spec.rb b/spec/unit/dsl_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/dsl_spec.rb +++ b/spec/unit/dsl_spec.rb @@ -10,7 +10,7 @@ RSpec.describe ActiveAdmin::DSL do let(:application) { ActiveAdmin::Application.new } let(:namespace) { ActiveAdmin::Namespace.new application, :admin } - let(:resource_config) { ActiveAdmin::Resource.new namespace, Post } + let(:resource_config) { namespace.register Post } let(:dsl){ ActiveAdmin::DSL.new(resource_config) } describe "#include" do
Ensure resource controller is defined Fixes ``` rspec \ ./spec/unit/auto_link_spec.rb[1:1:1] \ ./spec/unit/dsl_spec.rb[1:4:2] \ --seed <I> ```
activeadmin_activeadmin
train
rb
0e0a9944840d1e59322e2b373e458e17c5677b81
diff --git a/libraries/lithium/core/Libraries.php b/libraries/lithium/core/Libraries.php index <HASH>..<HASH> 100644 --- a/libraries/lithium/core/Libraries.php +++ b/libraries/lithium/core/Libraries.php @@ -171,7 +171,7 @@ class Libraries { if ($config['includePath']) { $path = ($config['includePath'] === true) ? $config['path'] : $config['includePath']; - set_include_path(get_include_path() . ':' . $path); + set_include_path(get_include_path() . PATH_SEPARATOR . $path); } if (!empty($config['bootstrap'])) {
Replacing hardcoded ':' path separator with PATH_SEPARATOR constant in Libraries::add() set_include_path().
UnionOfRAD_framework
train
php
a8de5ef3c12607502572bca5c983bcab1a2cb625
diff --git a/lib/nodes/hsla.js b/lib/nodes/hsla.js index <HASH>..<HASH> 100644 --- a/lib/nodes/hsla.js +++ b/lib/nodes/hsla.js @@ -46,8 +46,8 @@ HSLA.prototype.__proto__ = Node.prototype; HSLA.prototype.toString = function(){ return 'hsla(' + this.h + ',' - + this.l + ',' + this.s + ',' + + this.l + ',' + this.a + ')'; }; diff --git a/lib/nodes/string.js b/lib/nodes/string.js index <HASH>..<HASH> 100644 --- a/lib/nodes/string.js +++ b/lib/nodes/string.js @@ -71,11 +71,7 @@ String.prototype.toBoolean = function(){ */ String.prototype.coerce = function(other){ - if (other instanceof nodes.Unit) { - return new String(other.toString()); - } else { - Node.prototype.coerce.call(this, other); - } + return new String(other.toString()); }; /**
Fixed HSLA#toString()
stylus_stylus
train
js,js
86d781fa59f7a1f9a538ad404e24ee0a164bedf4
diff --git a/lib/rack/ssl-enforcer.rb b/lib/rack/ssl-enforcer.rb index <HASH>..<HASH> 100644 --- a/lib/rack/ssl-enforcer.rb +++ b/lib/rack/ssl-enforcer.rb @@ -170,7 +170,7 @@ module Rack end headers['Set-Cookie'] = cookies.map do |cookie| - cookie !~ / secure;/ ? "#{cookie}; secure" : cookie + cookie !~ /(;\s+)?secure($|;)/ ? "#{cookie}; secure" : cookie end.join("\n") end end
Optimize cookie regex, fix GH issue #<I>
tobmatth_rack-ssl-enforcer
train
rb
71828af55b9321f26cd2484369a7ad98c00a6bc3
diff --git a/docx2html/core.py b/docx2html/core.py index <HASH>..<HASH> 100644 --- a/docx2html/core.py +++ b/docx2html/core.py @@ -1269,7 +1269,6 @@ def get_text_run_content(el, meta_data, remove_bold, remove_italics): @ensure_tag(['p', 'ins', 'smartTag', 'hyperlink']) -# TODO Rename me to something that is not p tag specific def get_element_content( p, meta_data,
refs #<I>: removed a lying comment
PolicyStat_docx2html
train
py
5f4a1ee9a22fd1aaefce140857c6463e12e219de
diff --git a/test/integration/util.js b/test/integration/util.js index <HASH>..<HASH> 100644 --- a/test/integration/util.js +++ b/test/integration/util.js @@ -4,6 +4,19 @@ import { projectToWebMercator, WM_2R } from '../../src/utils/util'; const mapSize = 600; export function createMap (name, size) { + const div = createMapDivHolder(name, size); + + const map = new mapboxgl.Map({ + container: name, + style: { version: 8, sources: {}, layers: [] }, + center: [0, 0], + zoom: 0 + }); + + return { div, map }; +} + +export function createMapDivHolder (name, size) { size = size || mapSize; const div = document.createElement('div'); @@ -16,14 +29,7 @@ export function createMap (name, size) { document.body.style.padding = '0'; document.body.appendChild(div); - const map = new mapboxgl.Map({ - container: name, - style: { version: 8, sources: {}, layers: [] }, - center: [0, 0], - zoom: 0 - }); - - return { div, map }; + return div; } function _mouseParamsFromCoords (coordinates) {
Refactor util for easier reuse in integration tests
CartoDB_carto-vl
train
js
1bc982976be0748b9a3eecfac2a1945df87664ed
diff --git a/spec/rubocop/formatter/tap_formatter_spec.rb b/spec/rubocop/formatter/tap_formatter_spec.rb index <HASH>..<HASH> 100644 --- a/spec/rubocop/formatter/tap_formatter_spec.rb +++ b/spec/rubocop/formatter/tap_formatter_spec.rb @@ -27,7 +27,25 @@ RSpec.describe RuboCop::Formatter::TapFormatter do end context 'when any offenses are detected' do - let(:offenses) { [double('offense').as_null_object] } + let(:offenses) do + source_buffer = Parser::Source::Buffer.new('test', 1) + source = Array.new(9) do |index| + "This is line #{index + 1}." + end + source_buffer.source = source.join("\n") + line_length = source[0].length + 1 + + [ + RuboCop::Cop::Offense.new( + :convention, + Parser::Source::Range.new(source_buffer, + line_length + 2, + line_length + 3), + 'foo', + 'Cop' + ) + ] + end it 'prints "not ok"' do expect(output.string).to include('not ok 1')
Use fixtures in TapFormatter spec
rubocop-hq_rubocop
train
rb
9dab60da29ccf4d07c8042254ba61eeb0aef3cc9
diff --git a/core/modules/core/test/smoketest/FormattersSmokeTest.java b/core/modules/core/test/smoketest/FormattersSmokeTest.java index <HASH>..<HASH> 100644 --- a/core/modules/core/test/smoketest/FormattersSmokeTest.java +++ b/core/modules/core/test/smoketest/FormattersSmokeTest.java @@ -27,7 +27,7 @@ import java.util.*; */ public class FormattersSmokeTest { - public String openOfficePath = System.getProperty("YARG_OPEN_OFFICE_PATH"); + public String openOfficePath = System.getenv("YARG_OPEN_OFFICE_PATH"); public FormattersSmokeTest() { if (StringUtils.isBlank(openOfficePath)) {
PL-<I> Test yarg from gradle
cuba-platform_yarg
train
java
2a42d67bf40225556bc51b9f8956214a20de1bfc
diff --git a/examples/echo-bot/index.js b/examples/echo-bot/index.js index <HASH>..<HASH> 100644 --- a/examples/echo-bot/index.js +++ b/examples/echo-bot/index.js @@ -22,6 +22,10 @@ app.post('/callback', line.middleware(config), (req, res) => { Promise .all(req.body.events.map(handleEvent)) .then((result) => res.json(result)); + .catch((err) => { + console.error(err); + res.status(500).end(); + }); }); // event handler
add a catch to promise for echo-bot (#<I>)
line_line-bot-sdk-nodejs
train
js
ddd9dc453a6582291e4756cd70ff373edff68825
diff --git a/ampersand-view.js b/ampersand-view.js index <HASH>..<HASH> 100644 --- a/ampersand-view.js +++ b/ampersand-view.js @@ -343,15 +343,6 @@ assign(View.prototype, { return this; }, - // ## listenToAndRun - // Shortcut for registering a listener for a model - // and also triggering it right away. - listenToAndRun: function (object, events, handler) { - var bound = bind(handler, this); - this.listenTo(object, events, bound); - bound(); - }, - // ## animateRemove // Placeholder for if you want to do something special when they're removed. // For example fade it out, etc.
Remove listenToAndRun Since ampersand-view inherits from ampersand-state, which inherits from ampersand-events, which defines the listenToAndRun method, this definition in ampersand-view is no longer needed.
AmpersandJS_ampersand-view
train
js
bc87b815cc34d375e1a4b4c9b54c296691cee237
diff --git a/spacy/tests/conftest.py b/spacy/tests/conftest.py index <HASH>..<HASH> 100644 --- a/spacy/tests/conftest.py +++ b/spacy/tests/conftest.py @@ -27,7 +27,7 @@ from pathlib import Path import os import pytest - +# These languages get run through generic tokenizer tests LANGUAGES = [English, German, Spanish, Italian, French, Portuguese, Dutch, Swedish, Hungarian, Finnish, Bengali, Norwegian]
Add comment clarifying what LANGUAGES does
explosion_spaCy
train
py
e5254f2231856e63f549d96cbcd5ec33d9b407be
diff --git a/ml-agents/mlagents/trainers/trainer.py b/ml-agents/mlagents/trainers/trainer.py index <HASH>..<HASH> 100644 --- a/ml-agents/mlagents/trainers/trainer.py +++ b/ml-agents/mlagents/trainers/trainer.py @@ -139,12 +139,11 @@ class Trainer(object): """ raise UnityTrainerException("The update_model method was not implemented.") - def save_model(self, steps): + def save_model(self): """ Saves the model - :param steps: The number of steps of training """ - self.policy.save_model(steps) + self.policy.save_model(self.get_step) def export_model(self): """ diff --git a/ml-agents/mlagents/trainers/trainer_controller.py b/ml-agents/mlagents/trainers/trainer_controller.py index <HASH>..<HASH> 100644 --- a/ml-agents/mlagents/trainers/trainer_controller.py +++ b/ml-agents/mlagents/trainers/trainer_controller.py @@ -148,7 +148,7 @@ class TrainerController(object): :param saver: Tensorflow saver for session. """ for brain_name in self.trainers.keys(): - self.trainers[brain_name].save_model(steps) + self.trainers[brain_name].save_model() self.logger.info('Saved Model') def _export_graph(self):
vince's fix for model step (#<I>)
Unity-Technologies_ml-agents
train
py,py
b7b69de5633cfc43dde4cde15751ebfbac3b943a
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -26,10 +26,15 @@ module.exports = function (file, callback){ data.metadata = plist.readFileSync(path + 'Info.plist'); - async.parallel([ - async.apply(provisioning, path + 'embedded.mobileprovision'), - async.apply(entitlements, path) - ], function(error, results){ + var tasks = [ + async.apply(provisioning, path + 'embedded.mobileprovision') + ]; + + if(process.platform === 'darwin'){ + tasks.push(async.apply(entitlements, path)); + } + + async.parallel(tasks, function(error, results){ if(error){ return cleanUp(error); } @@ -39,6 +44,7 @@ module.exports = function (file, callback){ // Hard to serialize and it looks messy in output delete data.provisioning.DeveloperCertificates; + // Will be undefined on non-OSX platforms data.entitlements = results[1]; return cleanUp();
Only attempt to parse entitlements on OS X
matiassingers_ipa-metadata
train
js
3302251d27503c8792cd28205728288c460b56c2
diff --git a/install/lang/ja_utf8/installer.php b/install/lang/ja_utf8/installer.php index <HASH>..<HASH> 100644 --- a/install/lang/ja_utf8/installer.php +++ b/install/lang/ja_utf8/installer.php @@ -95,6 +95,7 @@ $string['databasesettingssub_postgres7'] = '<b>タイプ:</b> PostgreSQL<br /> <b>ユーザ名:</b> データベースのユーザ名<br /> <b>パスワード:</b> データベースのパスワード<br /> <b>テーブル接頭辞:</b> すべてのテーブル名に使用する接頭辞 (必須)'; +$string['databasesettingswillbecreated'] = '<b>メモ:</b> データベースが存在していない場合、インストーラーはデータベースの自動作成を試みます。'; $string['dataroot'] = 'データディレクトリ'; $string['datarooterror'] = 'あなたが指定した「データディレクトリ」が見つからないか、作成されませんでした。パスを訂正するか、ディレクトリを手動で作成してください。'; $string['dbconnectionerror'] = 'あなたが指定したデータベースに接続できませんでした。データベース設定を確認してください。';
Automatic installer.php lang files by installer_builder (<I>)
moodle_moodle
train
php
6cfd07b2ef7ef6b726ccd9e1f9c138b1ae31e374
diff --git a/scripts/post_install.js b/scripts/post_install.js index <HASH>..<HASH> 100755 --- a/scripts/post_install.js +++ b/scripts/post_install.js @@ -8,7 +8,7 @@ var path = require('path'), line = '\n=====================================================\n', hooks = require('./' + os_name + '/hooks'); -var prey_bin = '/usr/local/bin/prey', +var prey_bin = '/usr/local/bin/prey'; var run = function(script_name, callback){
Typo in post_install.js.
prey_prey-node-client
train
js
d73f9c8365d0581c5628b0d1f70fc22f1de60fc7
diff --git a/ldap_sync/management/commands/syncldap.py b/ldap_sync/management/commands/syncldap.py index <HASH>..<HASH> 100644 --- a/ldap_sync/management/commands/syncldap.py +++ b/ldap_sync/management/commands/syncldap.py @@ -34,7 +34,7 @@ class Command(BaseCommand): """Retrieve user data from LDAP server.""" user_filter = getattr(settings, 'LDAP_SYNC_USER_FILTER', None) if not user_filter: - logger.info('LDAP_SYNC_USER_FILTER not configured, skipping user sync') + logger.debug('LDAP_SYNC_USER_FILTER not configured, skipping user sync') return None user_attributes = getattr(settings, 'LDAP_SYNC_USER_ATTRIBUTES', {}) @@ -131,7 +131,7 @@ class Command(BaseCommand): """Retrieve groups from LDAP server.""" group_filter = getattr(settings, 'LDAP_SYNC_GROUP_FILTER', None) if not group_filter: - logger.info('LDAP_SYNC_GROUP_FILTER not configured, skipping group sync') + logger.debug('LDAP_SYNC_GROUP_FILTER not configured, skipping group sync') return None group_attributes = getattr(settings, 'LDAP_SYNC_GROUP_ATTRIBUTES', {})
Change sync skipped messages to debug level
jbittel_django-ldap-sync
train
py
7e3d900b569adbc30557a991d2e5e0fb5da7a626
diff --git a/canmatrix/canmatrix.py b/canmatrix/canmatrix.py index <HASH>..<HASH> 100644 --- a/canmatrix/canmatrix.py +++ b/canmatrix/canmatrix.py @@ -188,6 +188,7 @@ class Signal(object): def __init__(self, name, **kwargs): self.mux_val = None + self.is_multiplexer = False def multiplex(value): if value is not None and value != 'Multiplexor': multiplex = int(value) @@ -211,7 +212,6 @@ class Signal(object): ('unit', 'unit', None, ""), ('receiver', 'receiver', None, []), ('comment', 'comment', None, None), - ('is_multiplexer', 'is_multiplexer', None, False), ('multiplex', 'multiplex', multiplex, None), ('mux_value', 'mux_value', None, None), ('is_float', 'is_float', bool, False),
`Signal.is_multiplexer` is a calculated value (#<I>) `Signal.is_multiplexer` is calculated from the `multiplex` parameter. So it shouldn't set from the parameters.
ebroecker_canmatrix
train
py
08819f14813afb68c403838ef09cf46fce789852
diff --git a/spec/whats/configuration_spec.rb b/spec/whats/configuration_spec.rb index <HASH>..<HASH> 100644 --- a/spec/whats/configuration_spec.rb +++ b/spec/whats/configuration_spec.rb @@ -5,7 +5,10 @@ require "spec_helper" RSpec.describe Whats, ".configuration" do subject(:configuration) { Whats.configuration } - context "when no configure is done" do + context "when no configuration is done" do + before "clean whats module" do + Whats.configuration = nil + end it { is_expected.to be_nil } end
Cleans configuration prior to testing As Whats is a module it's scope is global, so other specs can (and will) setup the configuration before the test, which checks when there's no configuration. Therefore we need a way to clean the configs
getninjas_whatsapp
train
rb
97a5136e8a4107a2bccef8da53e4f5aa903cc15c
diff --git a/backbone-nested.js b/backbone-nested.js index <HASH>..<HASH> 100644 --- a/backbone-nested.js +++ b/backbone-nested.js @@ -188,9 +188,12 @@ return this; }, - changedAttributes: function() { - var backboneChanged = Backbone.NestedModel.__super__.changedAttributes.call(this); - return _.extend({}, nestedChanges, backboneChanged); + changedAttributes: function(diff) { + var backboneChanged = Backbone.NestedModel.__super__.changedAttributes.call(this, diff); + if (_.isObject(backboneChanged)) { + return _.extend({}, nestedChanges, backboneChanged); + } + return false; }, toJSON: function(){
changedAttribute fixup. No support for nested set
afeld_backbone-nested
train
js
fd09f3bcdc4172c7bea814cc872f380f2bf84a38
diff --git a/Task/Collect/CodeAnalyser.php b/Task/Collect/CodeAnalyser.php index <HASH>..<HASH> 100644 --- a/Task/Collect/CodeAnalyser.php +++ b/Task/Collect/CodeAnalyser.php @@ -58,8 +58,14 @@ class CodeAnalyser { // Find the full class name for this from the import statements. $matches = []; + // TODO: handle aliased imports. preg_match("@use ([\\\\\\w]+\\\\{$parent_short_classname});@", $class_code, $matches); + if (empty($matches)) { + // TODO: use the namespace of the file! + return FALSE; + } + $parent_qualified_classname = $matches[1]; if (class_exists($parent_qualified_classname)) {
Fixed errors in classIsUsable() with workarounds.
drupal-code-builder_drupal-code-builder
train
php
ed4e6afadddc48038876756cebec2aec5be66300
diff --git a/lib/synaccess_connect/net_booter/http/http_connection.rb b/lib/synaccess_connect/net_booter/http/http_connection.rb index <HASH>..<HASH> 100644 --- a/lib/synaccess_connect/net_booter/http/http_connection.rb +++ b/lib/synaccess_connect/net_booter/http/http_connection.rb @@ -113,7 +113,7 @@ module NetBooter def do_http_request(path) resp = nil - Net::HTTP.start(@host) do |http| + Net::HTTP.start(@host, @options[:port]) do |http| req = Net::HTTP::Get.new(path) req.basic_auth @options[:username], @options[:password] if @options[:username] && @options[:password]
Support setting the port as part of the connection options
tablexi_synaccess
train
rb
c98a5783ee33fd1aa1620ebdf3a79cfe0fd51bbb
diff --git a/src/main/java/com/blackducksoftware/integration/hub/service/HubServicesFactory.java b/src/main/java/com/blackducksoftware/integration/hub/service/HubServicesFactory.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/blackducksoftware/integration/hub/service/HubServicesFactory.java +++ b/src/main/java/com/blackducksoftware/integration/hub/service/HubServicesFactory.java @@ -85,7 +85,7 @@ public class HubServicesFactory { } public SignatureScannerService createSignatureScannerService() { - return new SignatureScannerService(createHubService(), intEnvironmentVariables, createCliDownloadUtility(), createProjectService(), createCodeLocationService()); + return new SignatureScannerService(createHubService(), logger, intEnvironmentVariables, createCliDownloadUtility(), createProjectService(), createCodeLocationService()); } public PhoneHomeService createPhoneHomeService() {
Fixing HubServicesFactory
blackducksoftware_blackduck-common
train
java
62a8feb15b03bd448a15def3f7e9fa82f28fcbb4
diff --git a/h2o-core/src/main/java/water/fvec/Frame.java b/h2o-core/src/main/java/water/fvec/Frame.java index <HASH>..<HASH> 100644 --- a/h2o-core/src/main/java/water/fvec/Frame.java +++ b/h2o-core/src/main/java/water/fvec/Frame.java @@ -272,10 +272,15 @@ public class Frame extends Lockable<Frame> { /** Finds the column index with a matching name, or -1 if missing * @return the column index with a matching name, or -1 if missing */ public int find( String name ) { + if (name == null) + return -1; + if (_names!=null) for( int i=0; i<_names.length; i++ ) - if( name.equals(_names[i]) ) - return i; + if (_names[i] != null) + if( name.equals(_names[i]) ) + return i; + return -1; }
Add more null pointer checking.
h2oai_h2o-3
train
java
97c6c1b20195aeb3619125bf5037427cce965f3e
diff --git a/test/function/allows-unknown-binary-operators/_config.js b/test/function/allows-unknown-binary-operators/_config.js index <HASH>..<HASH> 100644 --- a/test/function/allows-unknown-binary-operators/_config.js +++ b/test/function/allows-unknown-binary-operators/_config.js @@ -1,3 +1,4 @@ module.exports = { - description: 'allows unknown binary operators' + description: 'allows unknown binary operators', + buble: true };
transpile exponentiation operator in old node
rollup_rollup
train
js
a5857d69d8eebc3d721bf58e5f93cda2b7d79f9e
diff --git a/src/tad/WPBrowser/env.php b/src/tad/WPBrowser/env.php index <HASH>..<HASH> 100644 --- a/src/tad/WPBrowser/env.php +++ b/src/tad/WPBrowser/env.php @@ -33,10 +33,12 @@ function envFile($file) throw new \InvalidArgumentException('Could not read ' . $file . ' contents.'); } + $envFileContents = str_replace( "\r\n", "\n", $envFileContents ); + $pattern = '/^(?<key>.*?)=("(?<q_value>.*)(?<!\\\\)"|(?<value>.*?))([\\s]*#.*)*$/ui'; $vars = array_reduce( - array_filter(explode(PHP_EOL, $envFileContents)), + array_filter(explode("\n", $envFileContents)), static function (array $lines, $line) use ($pattern) { if (strpos($line, '#') === 0) { return $lines;
Fix the case when `env` file can be with LF line separators on Windows.
lucatume_wp-browser
train
php
e19a35f1404546c5eb75c6561947769c1df906ac
diff --git a/blockstack_client/utils.py b/blockstack_client/utils.py index <HASH>..<HASH> 100644 --- a/blockstack_client/utils.py +++ b/blockstack_client/utils.py @@ -35,7 +35,7 @@ def exit_with_error(error_message, help_message=None): if help_message is not None: result['help'] = help_message - print_result(result) + print_result(result, file=sys.stderr) sys.exit(0) @@ -79,11 +79,11 @@ def pretty_print(data): print pretty_dump(data) -def print_result(json_str): +def print_result(json_str, file=sys.stdout): data = pretty_dump(json_str) if data != "{}": - print data + print >> file, data def satoshis_to_btc(satoshis):
print_result() to a specific file
blockstack_blockstack-core
train
py
35d9d59550c394ce2c74abc6d151abb5f678692b
diff --git a/lib/rspec-puppet/matchers/create_generic.rb b/lib/rspec-puppet/matchers/create_generic.rb index <HASH>..<HASH> 100644 --- a/lib/rspec-puppet/matchers/create_generic.rb +++ b/lib/rspec-puppet/matchers/create_generic.rb @@ -262,6 +262,14 @@ module RSpec::Puppet resource = canonicalize_resource(resource) results = [] return results unless resource + + if resource.builtin_type? + name_var = resource.key_attributes.first + if resource.title != resource[name_var] + results << "#{resource.type}[#{resource[name_var]}]" + end + end + Array[resource[type]].flatten.compact.each do |r| results << canonicalize_resource_ref(r) results << relationship_refs(r, type)
Handle resources with differing namevar and title when calculating relationships
rodjek_rspec-puppet
train
rb
8f82336aed62a18b2c6f824fcf0e6b1a1d00b8d3
diff --git a/tests/test_astroid.py b/tests/test_astroid.py index <HASH>..<HASH> 100644 --- a/tests/test_astroid.py +++ b/tests/test_astroid.py @@ -1,9 +1,8 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function -import re - import astroid +from astroid.node_classes import NodeNG from . import tools, test_mark_tokens @@ -13,7 +12,7 @@ class TestAstroid(test_mark_tokens.TestMarkTokens): is_astroid_test = True module = astroid - nodes_classes = astroid.ALL_NODE_CLASSES + nodes_classes = NodeNG context_classes = [ (astroid.Name, astroid.DelName, astroid.AssignName), (astroid.Attribute, astroid.DelAttr, astroid.AssignAttr),
Use NodeNG instead of astroid.ALL_NODE_CLASSES
gristlabs_asttokens
train
py
f6e2895853557510c9663d3989a4e0bf7cd3a40b
diff --git a/liquibase-core/src/main/java/liquibase/database/core/MSSQLDatabase.java b/liquibase-core/src/main/java/liquibase/database/core/MSSQLDatabase.java index <HASH>..<HASH> 100644 --- a/liquibase-core/src/main/java/liquibase/database/core/MSSQLDatabase.java +++ b/liquibase-core/src/main/java/liquibase/database/core/MSSQLDatabase.java @@ -4,6 +4,7 @@ import java.sql.ResultSet; import liquibase.database.AbstractDatabase; import liquibase.database.DatabaseConnection; import liquibase.database.structure.DatabaseObject; +import liquibase.database.structure.Index; import liquibase.database.structure.Schema; import liquibase.database.structure.View; import liquibase.exception.DatabaseException; @@ -162,7 +163,7 @@ public class MSSQLDatabase extends AbstractDatabase { @Override public String escapeIndexName(String catalogName, String schemaName, String indexName) { // MSSQL server does not support the schema name for the index - - return super.escapeIndexName(null, null, indexName); + return super.escapeDatabaseObject(indexName, Index.class); } // protected void dropForeignKeys(Connection conn) throws DatabaseException {
Don't include schema on indexes in mssql
liquibase_liquibase
train
java
387d6dfd47267092feba1ba8f9f5d9c70437ce71
diff --git a/presto-raptor/src/main/java/com/facebook/presto/raptor/storage/ShardCompactionManager.java b/presto-raptor/src/main/java/com/facebook/presto/raptor/storage/ShardCompactionManager.java index <HASH>..<HASH> 100644 --- a/presto-raptor/src/main/java/com/facebook/presto/raptor/storage/ShardCompactionManager.java +++ b/presto-raptor/src/main/java/com/facebook/presto/raptor/storage/ShardCompactionManager.java @@ -149,7 +149,8 @@ public class ShardCompactionManager compactionDiscoveryService.scheduleWithFixedDelay(() -> { try { // jitter to avoid overloading database - SECONDS.sleep(ThreadLocalRandom.current().nextInt(1, 30)); + long interval = (long) compactionDiscoveryInterval.convertTo(SECONDS).getValue(); + SECONDS.sleep(ThreadLocalRandom.current().nextLong(1, interval)); discoverShards(); } catch (InterruptedException e) {
Fix jitter for shard compaction discovery
prestodb_presto
train
java
d6c211f8d00bed3c474db9421eeffb91095b8105
diff --git a/lib/active_model/mass_assignment_security/sanitizer.rb b/lib/active_model/mass_assignment_security/sanitizer.rb index <HASH>..<HASH> 100644 --- a/lib/active_model/mass_assignment_security/sanitizer.rb +++ b/lib/active_model/mass_assignment_security/sanitizer.rb @@ -14,7 +14,7 @@ module ActiveModel protected def process_removed_attributes(klass, attrs) - raise NotImplementedError, "#process_removed_attributes(attrs) suppose to be overwritten" + raise NotImplementedError, "#process_removed_attributes(attrs) is intended to be overwritten by a subclass" end end
Clarify exception message on abstract call to Sanitizer#process_removed_attribute
rails_protected_attributes
train
rb
27e13d92748220f1d702c750460289e2e72776ac
diff --git a/lib/pdk/cli/bundle.rb b/lib/pdk/cli/bundle.rb index <HASH>..<HASH> 100644 --- a/lib/pdk/cli/bundle.rb +++ b/lib/pdk/cli/bundle.rb @@ -3,10 +3,12 @@ module PDK::CLI @bundle_cmd = @base_cmd.define_command do name 'bundle' usage _('bundle -- [bundler_options]') - summary _('escape hatch to bundler') + summary _('(Experimental) Command pass-through to bundler') description _('[experimental] For advanced users, pdk bundle runs arbitrary commands in the bundler environment that pdk manages.' \ 'Careless use of this command can lead to errors that pdk can\'t help recover from.') + be_hidden + run do |_opts, args, _cmd| PDK::CLI::Util.ensure_in_module!
(maint) Updates Summary text and hides bundle subcommand.
puppetlabs_pdk
train
rb
46536ab51703a7d50b2ae643467df4a7fb987283
diff --git a/core/src/main/java/tachyon/util/NetworkUtils.java b/core/src/main/java/tachyon/util/NetworkUtils.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/tachyon/util/NetworkUtils.java +++ b/core/src/main/java/tachyon/util/NetworkUtils.java @@ -45,8 +45,10 @@ public final class NetworkUtils { public static String getLocalIpAddress() { try { InetAddress address = InetAddress.getLocalHost(); - LOG.debug("address " + address.toString() + " " + address.isLoopbackAddress() + " " - + address.getHostAddress() + " " + address.getHostName()); + if (LOG.isDebugEnabled()) { + LOG.debug("address " + address.toString() + " " + address.isLoopbackAddress() + " " + + address.getHostAddress() + " " + address.getHostName()); + } if (address.isLoopbackAddress()) { Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces(); while (networkInterfaces.hasMoreElements()) {
avoid unnecessary toString and concatenation
Alluxio_alluxio
train
java
7030422b11638d6fd859f63d8820e56b58087a30
diff --git a/system/src/Grav/Common/Uri.php b/system/src/Grav/Common/Uri.php index <HASH>..<HASH> 100644 --- a/system/src/Grav/Common/Uri.php +++ b/system/src/Grav/Common/Uri.php @@ -11,6 +11,7 @@ class Uri { public $url; + protected $basename; protected $base; protected $root; protected $bits; @@ -64,6 +65,7 @@ class Uri $this->base = $base; $this->root = $base . $root_path; $this->url = $base . $uri; + } /** @@ -286,6 +288,17 @@ class Uri return $this->host(); } + + /** + * Return the basename of the URI + * + * @return String The basename of the URI + */ + public function basename() + { + return $this->basename; + } + /** * Return the base of the URI *
New baseman option in Uri class
getgrav_grav
train
php
394a96006c4f85e580a565e14311738b2e2e7366
diff --git a/src/Sylius/Bundle/SearchBundle/Finder/OrmFinder.php b/src/Sylius/Bundle/SearchBundle/Finder/OrmFinder.php index <HASH>..<HASH> 100644 --- a/src/Sylius/Bundle/SearchBundle/Finder/OrmFinder.php +++ b/src/Sylius/Bundle/SearchBundle/Finder/OrmFinder.php @@ -368,7 +368,7 @@ class OrmFinder extends AbstractFinder } // filtering on an array of values - if (is_array($tags[strtolower($key)]) && in_array(ucfirst($separateFilter[$key]), $tags[strtolower($key)])) { + if (is_array($tags[strtolower($key)]) && in_array($separateFilter[$key], $tags[strtolower($key)])) { $result[] = $facet['itemId']; // got the value, I don't want to move into more checks
Removed ucfirst from search criteria causing the impossibility to find attributes starting with lowercase letters
Sylius_Sylius
train
php
3583f02cfe8774ae705cc05b9a7b613ae69022dd
diff --git a/src/__init__.py b/src/__init__.py index <HASH>..<HASH> 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -1 +1 @@ -from connection import Connection +from amqp_connection.connection import Connection
Fix class packaging for Python3 into __init__.py
FTV-Subtil_py_amqp_connection
train
py
196ec5aaf284b8843edf3362ec53cf3bb98bb254
diff --git a/packages/ember-views/lib/views/view.js b/packages/ember-views/lib/views/view.js index <HASH>..<HASH> 100644 --- a/packages/ember-views/lib/views/view.js +++ b/packages/ember-views/lib/views/view.js @@ -1722,8 +1722,8 @@ Ember.View = Ember.CoreView.extend( If you write a `willDestroyElement()` handler, you can assume that your `didInsertElement()` handler was called earlier for the same element. - Normally you will not call or override this method yourself, but you may - want to implement the above callbacks when it is run. + You should not call or override this method yourself, but you may + want to implement the above callbacks. @method destroyElement @return {Ember.View} receiver
Clarify that you should not override Ember.View#destroyElement
emberjs_ember.js
train
js
3a303e08076aadc2875c7549d3fafda368d707ee
diff --git a/lib/proxy.js b/lib/proxy.js index <HASH>..<HASH> 100644 --- a/lib/proxy.js +++ b/lib/proxy.js @@ -142,7 +142,7 @@ var processArgs = args.phantom.concat(args.proxy); //spawn new process - var phantomjs = spawn('phantomjs', + var phantomjs = spawn(options.phantomjsPath, processArgs, { detatched:false, @@ -269,6 +269,7 @@ options.host = options.host || 'localhost'; options.hostAndPort = 'http://' + options.host + ':' + options.port; options.eventStreamPath = require('path').normalize(__dirname + '/../temp/events.txt'); + options.phantomjsPath = options.phantomjsPath || 'phantomjs'; options.debug && console.log('creating proxy to %s', options.hostAndPort);
Add phantomjsPath as option
sheebz_phantom-proxy
train
js
bc364e274fb823845f7192a5c58a7b9509a5a006
diff --git a/www/src/py2js.js b/www/src/py2js.js index <HASH>..<HASH> 100644 --- a/www/src/py2js.js +++ b/www/src/py2js.js @@ -5454,7 +5454,7 @@ function $transition(context,token){ context.has_dstar = true return new $DoubleStarArgCtx(context) } //switch(arguments[2]) - throw Error('SyntaxError') + $_SyntaxError(context, token) } //switch (token) return $transition(context.parent,token,arguments[2])
Fix bug in SyntaxError reporting
brython-dev_brython
train
js
96bb9901cd843bfaa4120f051ec4d27761e7e441
diff --git a/sos/plugins/openvswitch.py b/sos/plugins/openvswitch.py index <HASH>..<HASH> 100644 --- a/sos/plugins/openvswitch.py +++ b/sos/plugins/openvswitch.py @@ -45,7 +45,9 @@ class OpenVSwitch(Plugin): "ls -laZ /var/run/openvswitch", # Gather systemd services logs "journalctl -u openvswitch", - "journalctl -u openvswitch-nonetwork" + "journalctl -u openvswitch-nonetwork", + # List devices and their drivers + "dpdk_nic_bind --status" ]) # Gather additional output for each OVS bridge on the host.
[openvswitch] List devices and their drivers DPDK enabled Open vSwitch supports kernel devices and userspace devices (DPDK), so capture a list of all NICs and their drivers.
sosreport_sos
train
py
ee57547801b7e0a2d2667baf13d180c05d382c0d
diff --git a/packages/perspective-viewer/src/js/viewer/action_element.js b/packages/perspective-viewer/src/js/viewer/action_element.js index <HASH>..<HASH> 100644 --- a/packages/perspective-viewer/src/js/viewer/action_element.js +++ b/packages/perspective-viewer/src/js/viewer/action_element.js @@ -180,14 +180,7 @@ export class ActionElement extends DomElement { const new_sort_order = this._increment_sort(row.getAttribute("sort-order"), this._get_view_column_pivots().length > 0, abs_sorting); row.setAttribute("sort-order", new_sort_order); - let sort = JSON.parse(this.getAttribute("sort")); - let new_sort = this._get_view_sorts(); - for (let s of sort) { - let updated_sort = new_sort.find(x => x[0] === s[0]); - if (updated_sort) { - s[1] = updated_sort[1]; - } - } + const sort = this._get_view_sorts(); this.setAttribute("sort", JSON.stringify(sort)); }
Fixed multiple sorts on same column not triggering update
finos_perspective
train
js
85eee0d7ef8070c8c90b6be77d6a381317158b2b
diff --git a/gulp/tasks/typescript.js b/gulp/tasks/typescript.js index <HASH>..<HASH> 100644 --- a/gulp/tasks/typescript.js +++ b/gulp/tasks/typescript.js @@ -4,6 +4,7 @@ var browserSync = require('browser-sync'); var sourcemaps = require('gulp-sourcemaps'); var changed = require('gulp-changed'); var typescript = require('gulp-typescript'); +var util = require('gulp-util'); @@ -22,6 +23,10 @@ module.exports = function() { allowImportModule : true, out: 'main.js' })) + .on('error', function (err) { + util.log(err.message); + this.emit('end'); + }) .js.pipe(gulp.dest(env.folder.dev + '/scripts/')) .pipe(browserSync.reload({stream:true})); };
Added the same treatment of error handling to typescript files
Objectway_super-gigi
train
js
42cb968949a9a3db08f69f54fce516f6892ea730
diff --git a/core/src/test/java/com/orientechnologies/orient/core/storage/impl/local/paginated/wal/WALChangesTreeTest.java b/core/src/test/java/com/orientechnologies/orient/core/storage/impl/local/paginated/wal/WALChangesTreeTest.java index <HASH>..<HASH> 100755 --- a/core/src/test/java/com/orientechnologies/orient/core/storage/impl/local/paginated/wal/WALChangesTreeTest.java +++ b/core/src/test/java/com/orientechnologies/orient/core/storage/impl/local/paginated/wal/WALChangesTreeTest.java @@ -279,7 +279,7 @@ public class WALChangesTreeTest { tree.add(value, cstart); } - ODirectMemoryPointer pointer = ODirectMemoryPointerFactory.instance().createPointer(30); + ODirectMemoryPointer pointer = ODirectMemoryPointerFactory.instance().createPointer(new byte[30]); tree.applyChanges(pointer); Assert.assertEquals(pointer.get(0, 30), data); pointer.free();
Small issue on wal changes tree test was fixed.
orientechnologies_orientdb
train
java
ff086e1d01dbf57fb8a5bc975f9622864c4cb869
diff --git a/lib/middleman-php/middleware.rb b/lib/middleman-php/middleware.rb index <HASH>..<HASH> 100644 --- a/lib/middleman-php/middleware.rb +++ b/lib/middleman-php/middleware.rb @@ -18,7 +18,7 @@ module Middleman response.body.map! do |item| execute_php(item) end - headers['Content-Length'] = response.body.join.length.to_s + headers['Content-Length'] = ::Rack::Utils.bytesize(response.body.join).to_s headers['Content-Type'] = 'text/html' headers['Cache-Control'] = 'no-cache, no-store, must-revalidate' end
Fix content-length header for responses with multibyte characters. Rack::Utils.bytesize seems to be the right choice, as it is also used by Middleman itself: <URL>
lord_middleman-php
train
rb
06da8fc3af4f8c22a75dd5fd8e45b24573f2a9c6
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -31,6 +31,7 @@ setup(name='bugwarrior', "twiggy", "bitlyapi", "pygithub3", + "requests==0.13.1", # Temporary until pygithub3 can catch up. "offtrac", "python-bugzilla", "taskw >= 0.4.2",
Restrict which version of requests we install. Relates to #<I>.
ralphbean_bugwarrior
train
py
3a75425e0360d631f7b606ac9f0afc70074a0151
diff --git a/atx/ext/chromedriver.py b/atx/ext/chromedriver.py index <HASH>..<HASH> 100644 --- a/atx/ext/chromedriver.py +++ b/atx/ext/chromedriver.py @@ -27,19 +27,27 @@ class ChromeDriver(object): except subprocess.TimeoutExpired: return True - def driver(self): + def driver(self, attach=True, activity=None): """ - Returns selenium driver + Args: + - attach(bool): Attach to an already-running app instead of launching the app with a clear data directory + - activity(string): Name of the Activity hosting the WebView. + + Returns: + selenium driver """ app = self._d.current_app() - print app capabilities = { 'chromeOptions': { - 'androidPackage': app.package, - 'androidActivity': app.activity, 'androidDeviceSerial': self._d.serial, + 'androidPackage': app.package, } } + if attach: + capabilities['chromeOptions']['androidUseRunningApp'] = True + if activity: + capabilities['chromeOptions']['androidActivity'] = activity + try: return webdriver.Remote('http://localhost:%d' % self._port, capabilities) except URLError:
add attach and activity params to chromedriver
NetEaseGame_ATX
train
py
30a1489fba1ad336cfe9e882d157cb1194d0f312
diff --git a/core/IP.php b/core/IP.php index <HASH>..<HASH> 100644 --- a/core/IP.php +++ b/core/IP.php @@ -11,9 +11,6 @@ namespace Piwik; -use Piwik\Config; -use Piwik\Common; - /** * Handling IP addresses (both IPv4 and IPv6). *
refs #<I> Removing unused imports (using phpstorm Inspections>Fix feature)
matomo-org_component-network
train
php
570434c34d8957926e9ed054fc4a9c85071e9bf8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ install_requires = [ setup( name='arcgis-rest-query', - version='0.0.11', + version='0.1', description='A tool to download a layer from an ArcGIS web service as GeoJSON', author='Ken Schwencke', author_email='schwank@gmail.com',
Let's bump it up to <I>
Schwanksta_python-arcgis-rest-query
train
py
e0ecd5daae8653dbb334003c90f5755a4f2dc789
diff --git a/lib/lowdown/client.rb b/lib/lowdown/client.rb index <HASH>..<HASH> 100644 --- a/lib/lowdown/client.rb +++ b/lib/lowdown/client.rb @@ -181,9 +181,13 @@ module Lowdown # @return [void] # def disconnect - @connection.disconnect - rescue Celluloid::DeadActorError - # Rescue this exception instead of calling #alive? as that only works on an actor, not a pool. + if @connection.respond_to?(:actors) + @connection.actors.each do |connection| + connection.async.disconnect if connection.alive? + end + else + @connection.async.disconnect if @connection.alive? + end end # Use this to group a batch of requests and halt the caller thread until all of the requests in the group have been diff --git a/lib/lowdown/mock.rb b/lib/lowdown/mock.rb index <HASH>..<HASH> 100644 --- a/lib/lowdown/mock.rb +++ b/lib/lowdown/mock.rb @@ -144,6 +144,10 @@ module Lowdown self end + def alive? + true + end + # @!group Real API: Instance Method Summary # Yields stubbed {#responses} or if none are available defaults to success responses. It does this on a different
[Client] Send disconnect to all actors in a pool.
alloy_lowdown
train
rb,rb
11f30fc351286e6cfb1c43810217d12de5beb58d
diff --git a/aio/tools/transforms/authors-package/index.spec.js b/aio/tools/transforms/authors-package/index.spec.js index <HASH>..<HASH> 100644 --- a/aio/tools/transforms/authors-package/index.spec.js +++ b/aio/tools/transforms/authors-package/index.spec.js @@ -12,6 +12,7 @@ describe('authors-package (integration tests)', () => { originalJasmineTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL; jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; }); + afterAll(() => jasmine.DEFAULT_TIMEOUT_INTERVAL = originalJasmineTimeout); beforeEach(() => {
style(aio): add newline between test blocks (#<I>) PR Close #<I>
angular_angular
train
js
b7758d8dc64e93e70672c2b0a7d9d974d17b202e
diff --git a/lib/MiqVm/miq_azure_vm.rb b/lib/MiqVm/miq_azure_vm.rb index <HASH>..<HASH> 100644 --- a/lib/MiqVm/miq_azure_vm.rb +++ b/lib/MiqVm/miq_azure_vm.rb @@ -22,9 +22,16 @@ class MiqAzureVm < MiqVm os_disk = vm_obj.properties.storage_profile.os_disk if vm_obj.managed_disk? # - # Use the EVM SNAPSHOT Added by the Provider + # Use the Smartstate SNAPSHOT Added by the Provider + # If the provider didn't pass the name in then it is running older code that built + # the old name - use that instead # - @disk_name = os_disk.name + "__EVM__SSA__SNAPSHOT" + if args[:snapshot] + @disk_name = args[:snapshot] + else + @disk_name = os_disk.name + "__EVM__SSA__SNAPSHOT" + $log.warn("MiqAzureVm: missing required snapshot arg: using old name #{@disk_name}") + end else # # Non-Managed Disk Snapshot handling
Use the Smartstate Snapshot Name Built by the Provider Since there is an <I> character limit on the length of the snapshot name constructed for managed disks use the name set by the Azure provider. If there is no name passed in the provider is using the previous code that built the name known here and use that name instead.
ManageIQ_manageiq-smartstate
train
rb
95476e2abd1a16997be1274f52d61a84dfa56177
diff --git a/faker/providers/internet/en_GB/__init__.py b/faker/providers/internet/en_GB/__init__.py index <HASH>..<HASH> 100644 --- a/faker/providers/internet/en_GB/__init__.py +++ b/faker/providers/internet/en_GB/__init__.py @@ -9,9 +9,9 @@ class Provider(InternetProvider): 'gmail.com', 'yahoo.com', 'hotmail.com', - 'gmail.co.uk', 'yahoo.co.uk', 'hotmail.co.uk', + 'outlook.com', ) tlds = ('com', 'com', 'com', 'com', 'com', 'com', 'biz', 'info', 'net', 'org', 'co.uk')
Remove gmail.co.uk (Fix #<I>) (#<I>)
joke2k_faker
train
py
788179933548908f4bbb2ce676d3099bddce662c
diff --git a/src/Illuminate/Contracts/Validation/ValidatesWhenResolved.php b/src/Illuminate/Contracts/Validation/ValidatesWhenResolved.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Contracts/Validation/ValidatesWhenResolved.php +++ b/src/Illuminate/Contracts/Validation/ValidatesWhenResolved.php @@ -1,7 +1,5 @@ <?php namespace Illuminate\Contracts\Validation; -use Illuminate\Contracts\Container\Container; - interface ValidatesWhenResolved { /**
[<I>] Removed unused use statement.
laravel_framework
train
php
896f374e99fb02ffcdcaa8804e3ca57e5b57f49a
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -78,7 +78,7 @@ var scenarioImport = function(model, options, finish) { .forEach('models', function(next, model) { if (!settings.connection.base.models[model]) return next('Model "' + model + '" is present in the Scenario schema but no model can be found matching that name, did you forget to load it?'); - settings.connection.base.models[model].find({}).remove(function(err) { + settings.connection.base.models[model].remove({}, function(err) { if (err) next(err); settings.progress.nuked.push(model); next();
Rewrote model nuker to be every-so-slightly more efficient
hash-bang_Node-Mongoose-Scenario
train
js
23ebf6702a733b3467cc2a0917162497e9ed3c5d
diff --git a/lib/kjess/socket.rb b/lib/kjess/socket.rb index <HASH>..<HASH> 100644 --- a/lib/kjess/socket.rb +++ b/lib/kjess/socket.rb @@ -224,6 +224,7 @@ module KJess # Returning the socket if it is and raising an Error if it isn't. def connect_nonblock_finalize( sock, sockaddr ) sock.connect_nonblock( sockaddr ) + return sock rescue Errno::EISCONN return sock rescue => ex
explicilty return sock otherwise 0 is returned on success
copiousfreetime_kjess
train
rb
1d66542f8b15d8cc9ecb0eb5f1ca647e687afa7f
diff --git a/bin/run-tests.js b/bin/run-tests.js index <HASH>..<HASH> 100755 --- a/bin/run-tests.js +++ b/bin/run-tests.js @@ -4,6 +4,7 @@ const { resolve: pathResolve } = require("path"); const { readdirSync } = require("fs"); const { spawn } = require("tap"); +console.log(`tap --no-coverage --timeout=60 test/unit/*-test.js`); spawn("tap", ["--no-coverage", "--timeout=60", "test/unit/*-test.js"], { name: "unit tests", env: { PATH: process.env.PATH } @@ -13,6 +14,11 @@ spawn("tap", ["--no-coverage", "--timeout=60", "test/unit/*-test.js"], { const apis = readdirSync(pathResolve(__dirname, "..", "openapi")); for (const api of apis) { const GHE_VERSION = parseFloat(api.replace(/^ghe-(\d+\.\d+)$/, "$1")) || null; + console.log( + `${ + GHE_VERSION ? `GHE_VERSION=${GHE_VERSION} ` : "" + }tap --no-coverage --timeout=60 test/unit/*-test.js` + ); spawn( "tap", ["--no-coverage", "--timeout=60", "test/integration/*-test.js"],
test: add more logs to test:ci script
octokit_routes
train
js
903c9880242e8e13948a87512f1f24732328898d
diff --git a/modules/utils/DateTime.js b/modules/utils/DateTime.js index <HASH>..<HASH> 100644 --- a/modules/utils/DateTime.js +++ b/modules/utils/DateTime.js @@ -269,19 +269,18 @@ class DateTime { * @returns {DateTime} return the DateTime */ deltaMins(delta) { - let hDelta = Math.floor(Math.abs(delta)/60); - let mDelta = Math.floor(Math.abs(delta)%60); - if ( delta < 0 ) { - hDelta = hDelta * -1; - mDelta = mDelta * -1; - } - - let h = this._getHours() + hDelta; - let m = this._getMins() + mDelta; + // Create new JS Date with changed time + let date = this._getJSDate(); + let time = date.getTime() + (delta * 60000); + date.setTime(time); + let js = DateTime.createFromJSDate(date); - this.time = h*3600 + m*60 + this._getSecs(); + // Set time and date properties + this.time = js.time; + this.date = js.date; + // return a reference to this date return this; }
Bug: DateTime - deltaMins have deltaMins change the date, if required
right-track_right-track-core
train
js
aea0fc34374892771250647baf5fc9855ccb2eae
diff --git a/tests/python/unittest/test_io.py b/tests/python/unittest/test_io.py index <HASH>..<HASH> 100644 --- a/tests/python/unittest/test_io.py +++ b/tests/python/unittest/test_io.py @@ -292,7 +292,6 @@ def test_DataBatch(): ok_(re.match('DataBatch: data shapes: \[\(2L?, 3L?\), \(7L?, 8L?\)\] label shapes: \[\(4L?, 5L?\)\]', str(batch))) -@unittest.skip("test fails intermittently. temporarily disabled till it gets fixed. tracked at https://github.com/apache/incubator-mxnet/issues/7826") def test_CSVIter(): def check_CSVIter_synthetic(): cwd = os.getcwd()
[WIP] fix csv iter (#<I>) * trigger * remove skip * trigger * 4th trigger. * remove the loop of testing <I> times
apache_incubator-mxnet
train
py
5b1b7c9dc038399a5871c74b30f2c47e445a4344
diff --git a/rquery.js b/rquery.js index <HASH>..<HASH> 100644 --- a/rquery.js +++ b/rquery.js @@ -9,7 +9,7 @@ var SELECTORS = [ { - matcher: /([A-Z]\w*)/, + matcher: /^([A-Z]\w*)/, buildPredicate: function (match) { return function (component) { if (typeof component._currentElement.type !== 'string') { @@ -21,7 +21,7 @@ } }, { - matcher: /([a-z]\w*)/, + matcher: /^([a-z]\w*)/, buildPredicate: function (match) { return function (component) { if (typeof component._currentElement.type === 'string') {
Force matchers to match start of string
percyhanna_rquery
train
js
6b1d704e002be80488e6a1e0fc3fe71377c69600
diff --git a/modules/appnexusBidAdapter.js b/modules/appnexusBidAdapter.js index <HASH>..<HASH> 100644 --- a/modules/appnexusBidAdapter.js +++ b/modules/appnexusBidAdapter.js @@ -78,6 +78,7 @@ export const spec = { { code: 'districtm', gvlid: 144 }, { code: 'adasta' }, { code: 'beintoo', gvlid: 618 }, + { code: 'targetVideo' }, ], supportedMediaTypes: [BANNER, VIDEO, NATIVE],
TargetVideo Bid Adapter: add new adapter (#<I>) * TargetVideo bid adapter * TargetVideo bid adapter * TargetVideo bid adapter
prebid_Prebid.js
train
js
7d55dd7749e28c60344334434b0cfd8dfe892de4
diff --git a/pycbc/libutils.py b/pycbc/libutils.py index <HASH>..<HASH> 100644 --- a/pycbc/libutils.py +++ b/pycbc/libutils.py @@ -93,14 +93,17 @@ def pkg_config_libdirs(packages): return [] # if calling pkg-config failes, don't continue and don't try again. - try: - FNULL = open(os.devnull, 'w') - subprocess.check_call(["pkg-config", "--version"], stdout=FNULL, close_fds=True) - except: - print("PyCBC.libutils: pkg-config call failed, setting NO_PKGCONFIG=1", - file=sys.stderr) - os.environ['NO_PKGCONFIG'] = "1" - return [] + with open(os.devnull, "w") as FNULL: + try: + subprocess.check_call(["pkg-config", "--version"], stdout=FNULL) + except: + print( + "PyCBC.libutils: pkg-config call failed, " + "setting NO_PKGCONFIG=1", + file=sys.stderr, + ) + os.environ['NO_PKGCONFIG'] = "1" + return [] # First, check that we can call pkg-config on each package in the list for pkg in packages:
Make sure FNULL is closed properly in pycbc.libutils.pkg_config_libdirs (#<I>) * pycbc.libutils: make sure FNULL is closed properly close_fds doesn't propagate the closure back to the parent * pycbc.libutils: fix line lengths
gwastro_pycbc
train
py
363908b03e0c802797506484254490c979cee693
diff --git a/daemon/k8s_watcher.go b/daemon/k8s_watcher.go index <HASH>..<HASH> 100644 --- a/daemon/k8s_watcher.go +++ b/daemon/k8s_watcher.go @@ -1913,9 +1913,17 @@ func endpointUpdated(endpoint *types.CiliumEndpoint) { } if endpoint.Networking != nil { + if endpoint.Networking.NodeIP == "" { + // When upgrading from an older version, the nodeIP may + // not be available yet in the CiliumEndpoint and we + // have to wait for it to be propagated + return + } + nodeIP := net.ParseIP(endpoint.Networking.NodeIP) if nodeIP == nil { log.WithField("nodeIP", endpoint.Networking.NodeIP).Warning("Unable to parse node IP while processing CiliumEndpoint update") + return } for _, pair := range endpoint.Networking.Addressing {
k8s: Update ipcache based on CiliumEndpoint only if NodeIP is available During the upgrade test, existing CiliumEndpoint are present which do not contains a NodeIP yet. Skip updating the ipcache until the NodeIP is available. Related: #<I>
cilium_cilium
train
go
993f1c6f53ce7057209282af7d70425b2c16020f
diff --git a/lib/jsdom/level1/core.js b/lib/jsdom/level1/core.js index <HASH>..<HASH> 100644 --- a/lib/jsdom/level1/core.js +++ b/lib/jsdom/level1/core.js @@ -140,9 +140,6 @@ core.DOMException.prototype.__proto__ = Error.prototype; var NodeArray = function() {}; NodeArray.prototype = new Array(); -NodeArray.prototype.toArray = function() { - return this; -}; NodeArray.prototype.item = function(i) { return this[i]; };
toArray on NodeArray is unused.
jsdom_jsdom
train
js
5f388d08a121b783c2c8aad1b3d56697b1c3d1e7
diff --git a/src/AcMailer/Event/MailListener.php b/src/AcMailer/Event/MailListener.php index <HASH>..<HASH> 100644 --- a/src/AcMailer/Event/MailListener.php +++ b/src/AcMailer/Event/MailListener.php @@ -9,25 +9,25 @@ namespace AcMailer\Event; interface MailListener { - /** - * Called before sending the email - * @param MailEvent $e - * @return mixed - */ - public function onPreSend(MailEvent $e); + /** + * Called before sending the email + * @param MailEvent $e + * @return mixed + */ + public function onPreSend(MailEvent $e); - /** - * Called after sending the email - * @param MailEvent $e - * @return mixed - */ - public function onPostSend(MailEvent $e); + /** + * Called after sending the email + * @param MailEvent $e + * @return mixed + */ + public function onPostSend(MailEvent $e); - /** - * Called if an error occurs while sending the email - * @param MailEvent $e - * @return mixed - */ - public function onSendError(MailEvent $e); + /** + * Called if an error occurs while sending the email + * @param MailEvent $e + * @return mixed + */ + public function onSendError(MailEvent $e); -} \ No newline at end of file +}
Fixed codestyle issues in MailListener class
acelaya_ZF-AcMailer
train
php
ae6c4055b29e98dbaa40c891c3eb46e12d3999aa
diff --git a/src/term.js b/src/term.js index <HASH>..<HASH> 100644 --- a/src/term.js +++ b/src/term.js @@ -1116,8 +1116,6 @@ Terminal.prototype.bindMouse = function() { return cancel(ev); }); } - - return cancel(ev); }); //if (self.normalMouse) {
Don't call preventDefault() on mousedown Calling preventDefault() doesn't set the focus back to the terminal. (Mouse handling seems broken anyway right now.)
cockpit-project_term.js
train
js
f1d33aed961ff70683a900a31af2c840a07add79
diff --git a/zipline/pipeline/__init__.py b/zipline/pipeline/__init__.py index <HASH>..<HASH> 100644 --- a/zipline/pipeline/__init__.py +++ b/zipline/pipeline/__init__.py @@ -1,3 +1,4 @@ +from __future__ import print_function from zipline.assets import AssetFinder from .classifier import Classifier @@ -13,7 +14,8 @@ from .loaders import USEquityPricingLoader def engine_from_files(daily_bar_path, adjustments_path, asset_db_path, - calendar): + calendar, + warmup_assets=False): """ Construct a SimplePipelineEngine from local filesystem resources. @@ -27,12 +29,19 @@ def engine_from_files(daily_bar_path, Path to pass to `AssetFinder`. calendar : pd.DatetimeIndex Calendar to use for the loader. + warmup_assets : bool + Whether or not to populate AssetFinder caches. This can speed up + initial latency on subsequent pipeline runs, at the cost of extra + memory consumption. """ loader = USEquityPricingLoader.from_files(daily_bar_path, adjustments_path) if not asset_db_path.startswith("sqlite:"): asset_db_path = "sqlite:///" + asset_db_path asset_finder = AssetFinder(asset_db_path) + if warmup_assets: + results = asset_finder.retrieve_all(asset_finder.sids) + print("Warmed up %d assets." % len(results)) return SimplePipelineEngine( lambda _: loader,
ENH: Add warmup_assets to equity_pricing_loader.
quantopian_zipline
train
py
9676af1123b7c3ba81d45c5ef45f3ee14541e69b
diff --git a/charmhelpers/core/hookenv.py b/charmhelpers/core/hookenv.py index <HASH>..<HASH> 100644 --- a/charmhelpers/core/hookenv.py +++ b/charmhelpers/core/hookenv.py @@ -753,10 +753,10 @@ class Hooks(object): def charm_dir(): """Return the root directory of the current charm""" - d = os.environ.get('CHARM_DIR') + d = os.environ.get('JUJU_CHARM_DIR') if d is not None: return d - return os.environ.get('JUJU_CHARM_DIR') + return os.environ.get('CHARM_DIR') @cached
Look at JUJU_CHARM_DIR first.
juju_charm-helpers
train
py
fa35c90172bafaab3e9583ac4cdb8c0da942e80e
diff --git a/src/config/config.php b/src/config/config.php index <HASH>..<HASH> 100644 --- a/src/config/config.php +++ b/src/config/config.php @@ -1,5 +1,8 @@ <?php return array( + // Loaded config's path. + 'cpath' => __DIR__, + // Detailed explanations @ http://milesj.me/code/php/decoda 'profile' => array( 'default' => array(
Added cpath to main config file. with cpath can determine which config is loaded, the published or the package's default.
hisorange_bbcoder
train
php
bc18548c390adc21ab80b2128a7a4592141c128c
diff --git a/lib/adhearsion/initializer/punchblock.rb b/lib/adhearsion/initializer/punchblock.rb index <HASH>..<HASH> 100644 --- a/lib/adhearsion/initializer/punchblock.rb +++ b/lib/adhearsion/initializer/punchblock.rb @@ -63,7 +63,14 @@ module Adhearsion m.synchronize { blocker.broadcast } end Adhearsion::Process.important_threads << Thread.new do - catching_standard_errors { client.run } + catching_standard_errors do + begin + client.run + rescue ::Punchblock::ProtocolError => e + logger.fatal "The connection failed due to a protocol error: #{e.name}." + m.synchronize { blocker.broadcast } + end + end end # Wait for the connection to establish
[BUGFIX] Unblock initializer if Punchblock fails to connect and log the failure <URL>
adhearsion_adhearsion
train
rb
31c317f5f7815ffcf3751e735755ad15bffa20d2
diff --git a/public/app/plugins/datasource/graphite/func_editor.js b/public/app/plugins/datasource/graphite/func_editor.js index <HASH>..<HASH> 100644 --- a/public/app/plugins/datasource/graphite/func_editor.js +++ b/public/app/plugins/datasource/graphite/func_editor.js @@ -208,7 +208,7 @@ function (angular, _, $) { if ($target.hasClass('fa-arrow-left')) { $scope.$apply(function() { - _.move($scope.functions, $scope.$index, $scope.$index - 1); + _.move(ctrl.functions, $scope.$index, $scope.$index - 1); ctrl.targetChanged(); }); return; @@ -216,7 +216,7 @@ function (angular, _, $) { if ($target.hasClass('fa-arrow-right')) { $scope.$apply(function() { - _.move($scope.functions, $scope.$index, $scope.$index + 1); + _.move(ctrl.functions, $scope.$index, $scope.$index + 1); ctrl.targetChanged(); }); return;
fix(graphite editor): fixed moving functions right and left, broken recently, fixes #<I>
grafana_grafana
train
js
d9eff84e25947605312e8a4437aa75b9e07523a5
diff --git a/worker/deployer/unit_agent.go b/worker/deployer/unit_agent.go index <HASH>..<HASH> 100644 --- a/worker/deployer/unit_agent.go +++ b/worker/deployer/unit_agent.go @@ -221,6 +221,7 @@ func (a *UnitAgent) start() (worker.Worker, error) { _ = engine.Wait() a.mu.Lock() a.workerRunning = false + bufferedLogger.Close() a.mu.Unlock() }() if err := addons.StartIntrospection(addons.IntrospectionConfig{
Closes the buffered logger installed with converged unit agents created by the deployer worker. Calling Close() terminates the logger's loop. This prevents leakage of the Goroutines spawned to run the logger's loop method.
juju_juju
train
go
fdaaa8c8aeb492a7454b8b41b61e79e8fc82bd61
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -168,7 +168,7 @@ api.has = function has (obj, pointer) { * @returns {string} */ api.escape = function escape (str) { - return str.replace(/~/g, '~0').replace(/\//g, '~1'); + return str.toString().replace(/~/g, '~0').replace(/\//g, '~1'); }; /**
Fixes escape for non-strings
manuelstofer_json-pointer
train
js
eb9f54c8fe9efa878093fa24a32755ad7d6fd43d
diff --git a/backbone.js b/backbone.js index <HASH>..<HASH> 100644 --- a/backbone.js +++ b/backbone.js @@ -422,7 +422,7 @@ // hash indexes for `id` and `cid` lookups. _add : function(model, options) { options || (options = {}); - var already = this.get(model); + var already = this.getByCid(model); if (already) throw new Error(["Can't add the same model to a set twice", already.id]); this._byId[model.id] = model; this._byCid[model.cid] = model; @@ -439,7 +439,7 @@ // hash indexes for `id` and `cid` lookups. _remove : function(model, options) { options || (options = {}); - model = this.get(model); + model = this.getByCid(model); if (!model) return null; delete this._byId[model.id]; delete this._byCid[model.cid];
willbailey's patch to use getByCid for internal lookups ... much safer.
jashkenas_backbone
train
js
63fbfe98650458c9735f169bef9fd24cf60fb90d
diff --git a/src/main/java/com/dcsquare/hivemq/spi/message/CONNECT.java b/src/main/java/com/dcsquare/hivemq/spi/message/CONNECT.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/dcsquare/hivemq/spi/message/CONNECT.java +++ b/src/main/java/com/dcsquare/hivemq/spi/message/CONNECT.java @@ -48,6 +48,7 @@ public class CONNECT extends Message { private String password; + private boolean bridge; public boolean isCleanSession() { return cleanSession; @@ -152,4 +153,12 @@ public class CONNECT extends Message { public void setProtocolVersion(final byte protocolVersion) { this.protocolVersion = protocolVersion; } + + public boolean isBridge() { + return bridge; + } + + public void setBridge(boolean bridge) { + this.bridge = bridge; + } }
connect message is now aware if it's a bridge connection
hivemq_hivemq-spi
train
java
56e441411b76a75f38940959dddf8d875be9d673
diff --git a/tests/selenium/test_basics.py b/tests/selenium/test_basics.py index <HASH>..<HASH> 100644 --- a/tests/selenium/test_basics.py +++ b/tests/selenium/test_basics.py @@ -9,19 +9,6 @@ from treeherder.model.models import (Commit, Repository) -def test_treeherder_main(live_server, selenium): - ''' - Tests that the default treeherder page loads ok and we can - click the repository menu - ''' - selenium.get(live_server.url) - repo_button = WebDriverWait(selenium, 10).until( - EC.visibility_of_element_located((By.ID, 'repoLabel')) - ) - repo_button.click() - assert selenium.find_element_by_id('repo-dropdown').is_displayed() - - def test_treeherder_single_commit_titles(live_server, selenium): ''' This tests that page titles are correct
Remove test_treeherder_main as it's now covered by test_switch_repo
mozilla_treeherder
train
py
d663e7a8a32d6c24a0d378280404b0d29e1d5df7
diff --git a/examples/aws.go b/examples/aws.go index <HASH>..<HASH> 100644 --- a/examples/aws.go +++ b/examples/aws.go @@ -73,7 +73,7 @@ func getCluster(name string) *cluster.Cluster { MinCount: 1, Image: "ami-835b4efa", Size: "t2.medium", - BootstrapScript: "1.7.0_ubuntu_16.04_master.sh", + BootstrapScript: "amazon_k8s_ubuntu_16.04_master.sh", Subnets: []*cluster.Subnet{ { Name: fmt.Sprintf("%s.master", name), @@ -109,7 +109,7 @@ func getCluster(name string) *cluster.Cluster { MinCount: 1, Image: "ami-835b4efa", Size: "t2.medium", - BootstrapScript: "1.7.0_ubuntu_16.04_node.sh", + BootstrapScript: "amazon_k8s_ubuntu_16.04_node.sh", Subnets: []*cluster.Subnet{ { Name: fmt.Sprintf("%s.node", name),
Fix bootstrap script name to existing one
kubicorn_kubicorn
train
go
1518f61c937f8e9a0406658a8884eb065c179971
diff --git a/src/main/java/groovyx/net/http/HTTPBuilder.java b/src/main/java/groovyx/net/http/HTTPBuilder.java index <HASH>..<HASH> 100644 --- a/src/main/java/groovyx/net/http/HTTPBuilder.java +++ b/src/main/java/groovyx/net/http/HTTPBuilder.java @@ -456,12 +456,13 @@ public class HTTPBuilder { closureArgs = new Object[] { resp }; break; case 2 : // parse the response entity if the response handler expects it: + HttpEntity entity = resp.getEntity(); try { - closureArgs = new Object[] { resp, parseResponse( resp, contentType ) }; + if ( entity == null ) closureArgs = new Object[] { resp, null }; + else closureArgs = new Object[] { resp, parseResponse( resp, contentType ) }; } catch ( Exception ex ) { - HttpEntity e = resp.getEntity(); - Header h = e != null ? e.getContentType() : null; + Header h = entity.getContentType(); String respContentType = h != null ? h.getValue() : null; log.warn( "Error parsing '" + respContentType + "' response", ex ); throw new ResponseParseException( resp, ex );
GMOD-<I> fix for HTTPBuilder and RESTClient responses that have no response entity. Related to GMOD-<I>. git-svn-id: <URL>
http-builder-ng_http-builder-ng
train
java
d2cc6750acc9374daf43d694b29795d64c40a37f
diff --git a/stringutil_test.go b/stringutil_test.go index <HASH>..<HASH> 100644 --- a/stringutil_test.go +++ b/stringutil_test.go @@ -2,8 +2,8 @@ package stringutil import ( "fmt" - . "github.com/bborbe/assert" "testing" + . "github.com/bborbe/assert" ) type TestStringAfterData struct {
format imports with goimpots
bborbe_stringutil
train
go
6a9235c998dab2ec0ddc49898a59dd5089156cb0
diff --git a/notes/edit.php b/notes/edit.php index <HASH>..<HASH> 100644 --- a/notes/edit.php +++ b/notes/edit.php @@ -70,6 +70,12 @@ if ($noteform->is_cancelled()) { /// if data was submitted and validated, then save it to database if ($note = $noteform->get_data()){ + if ($noteid) { + // A noteid has been used, we don't allow editing of course or user so + // lets unset them to be sure we never change that by accident. + unset($note->courseid); + unset($note->userid); + } note_save($note); // redirect to notes list that contains this note redirect($CFG->wwwroot . '/notes/index.php?course=' . $note->courseid . '&amp;user=' . $note->userid);
MDL-<I> Notes: unset courseid and userid when updating the note to prevent accidental changes. Thank you Sam Hemelryk for suggesting an alternative solution.
moodle_moodle
train
php
a011a6d41e1d2c863988829bf481e6c3e565c4ad
diff --git a/pkg/registry/registrytest/etcd.go b/pkg/registry/registrytest/etcd.go index <HASH>..<HASH> 100644 --- a/pkg/registry/registrytest/etcd.go +++ b/pkg/registry/registrytest/etcd.go @@ -222,6 +222,9 @@ func (t *Tester) emitObject(obj runtime.Object, action string) error { return err } _, _, err = t.storage.Delete(ctx, accessor.GetName(), nil) + if err != nil { + return err + } default: err = fmt.Errorf("unexpected action: %v", action) }
Fix swallowed error in registrytest
kubernetes_kubernetes
train
go
4fc947a1710628a298340421e505db74abab6689
diff --git a/example/example_conftest.py b/example/example_conftest.py index <HASH>..<HASH> 100644 --- a/example/example_conftest.py +++ b/example/example_conftest.py @@ -2,17 +2,27 @@ # Thanks to Guilherme Salgado. import pytest -from pyannotate_runtime import collect_types -collect_types.init_types_collection() + +def pytest_collection_finish(session): + """Handle the pytest collection finish hook: configure pyannotate. + + Explicitly delay importing `collect_types` until all tests have + been collected. This gives gevent a chance to monkey patch the + world before importing pyannotate. + """ + from pyannotate_runtime import collect_types + collect_types.init_types_collection() @pytest.fixture(autouse=True) def collect_types_fixture(): + from pyannotate_runtime import collect_types collect_types.resume() yield collect_types.pause() def pytest_sessionfinish(session, exitstatus): + from pyannotate_runtime import collect_types collect_types.dump_stats("type_info.json")
Modify example conftest to support testing code that uses gevent. (#<I>) I realize gevent is a bit of a pain, but I just spent the better part of a day debugging this, so I figured I'd share the knowledge :D.
dropbox_pyannotate
train
py