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
038ffa4224f62d9d20a94adc942cdeabfdebde76
diff --git a/lib/gcli/ui/arg_fetch.js b/lib/gcli/ui/arg_fetch.js index <HASH>..<HASH> 100644 --- a/lib/gcli/ui/arg_fetch.js +++ b/lib/gcli/ui/arg_fetch.js @@ -134,7 +134,7 @@ ArgFetcher.prototype.linkMessageElement = function(assignment, element) { // HACK: See #getInputFor() var field = assignment.field; if (field == null) { - console.error('Missing field for ' + JSON.stringify(assignment)); + console.error('Missing field for ' + assignment.param.name); return 'Missing field'; } field.setMessageElement(element);
Assignments are recursive, dont call JSON.stringify on them
joewalker_gcli
train
js
29f8fe78de0621e3f5b1f2bcd3ee65e7bf7b13b0
diff --git a/lib/brightbox-cli/config.rb b/lib/brightbox-cli/config.rb index <HASH>..<HASH> 100644 --- a/lib/brightbox-cli/config.rb +++ b/lib/brightbox-cli/config.rb @@ -102,7 +102,7 @@ module Brightbox else # Is client ambigious? if default_client.nil? && clients.length > 1 - raise BBConfigError, "You must specify a default client using brightbox-config client_default" + raise BBConfigError, "You must specify a default client using brightbox config client_default" end @client_name = default_client || clients.first end diff --git a/spec/unit/brightbox/bb_config/client_name_spec.rb b/spec/unit/brightbox/bb_config/client_name_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/brightbox/bb_config/client_name_spec.rb +++ b/spec/unit/brightbox/bb_config/client_name_spec.rb @@ -70,7 +70,7 @@ describe Brightbox::BBConfig do it "raises an error" do expect { @config.client_name - }.to raise_error(Brightbox::BBConfigError, "You must specify a default client using brightbox-config client_default") + }.to raise_error(Brightbox::BBConfigError, "You must specify a default client using brightbox config client_default") end end
Updates command to run in output "brightbox config" should be used in preference to "brightbox-config"
brightbox_brightbox-cli
train
rb,rb
4688f58764fade3de06a50ca7e209e3257475e48
diff --git a/classes/PodsAPI.php b/classes/PodsAPI.php index <HASH>..<HASH> 100644 --- a/classes/PodsAPI.php +++ b/classes/PodsAPI.php @@ -1752,7 +1752,7 @@ class PodsAPI { return $object; } - $result = pods_query( "SELECT * FROM `@wp_pods_objects` WHERE $where `type` = '{$params->type}' LIMIT 1", $this ); + $result = pods_query( "SELECT * FROM `@wp_pods_objects` WHERE $where AND `type` = '{$params->type}' LIMIT 1", $this ); if ( empty( $result ) ) return pods_error( ucwords( $params->type ) . ' Object not found', $this );
Fixed PodsAPI->load_object method by adding AND to WHERE clause
pods-framework_pods
train
php
4c1faa8a2f02a75834274a92cb03594d4901b7ff
diff --git a/src/Graviton/CoreBundle/Tests/Controller/AppControllerTest.php b/src/Graviton/CoreBundle/Tests/Controller/AppControllerTest.php index <HASH>..<HASH> 100644 --- a/src/Graviton/CoreBundle/Tests/Controller/AppControllerTest.php +++ b/src/Graviton/CoreBundle/Tests/Controller/AppControllerTest.php @@ -146,7 +146,7 @@ class AppControllerTest extends RestTestCase $this->assertTrue($results->showInMenu); $this->assertContains( - '<http://localhost/core/app/new>; rel="self"', + '<http://localhost/core/app/'.$results->id.'>; rel="self"', explode(',', $response->headers->get('Link')) ); }
fix id handling in app test..
libgraviton_graviton
train
php
270d8aec8b83c7c06cfbc6b4e3e5707a509a093a
diff --git a/pkg/kubelet/cadvisor/cadvisor_linux.go b/pkg/kubelet/cadvisor/cadvisor_linux.go index <HASH>..<HASH> 100644 --- a/pkg/kubelet/cadvisor/cadvisor_linux.go +++ b/pkg/kubelet/cadvisor/cadvisor_linux.go @@ -42,8 +42,8 @@ type cadvisorClient struct { var _ Interface = new(cadvisorClient) // TODO(vmarmol): Make configurable. -// The number of stats to keep in memory. -const statsToCache = 60 +// The amount of time for which to keep stats in memory. +const statsCacheDuration = 2 * time.Minute // Creates a cAdvisor and exports its API on the specified port if port > 0. func New(port uint) (Interface, error) { @@ -53,7 +53,7 @@ func New(port uint) (Interface, error) { } // Create and start the cAdvisor container manager. - m, err := manager.New(memory.New(statsToCache, nil), sysFs) + m, err := manager.New(memory.New(statsCacheDuration, nil), sysFs) if err != nil { return nil, err }
Raise cAdvisor stats cache to 2m. This used to be <I>ns which was a bug from when we switched from number of stats to duration. Seems like the type was silently converted/ignored.
kubernetes_kubernetes
train
go
cc7a9e2301cdd17c4be013e64b84481c95d8d988
diff --git a/lib/generators/geocoder/config/templates/initializer.rb b/lib/generators/geocoder/config/templates/initializer.rb index <HASH>..<HASH> 100644 --- a/lib/generators/geocoder/config/templates/initializer.rb +++ b/lib/generators/geocoder/config/templates/initializer.rb @@ -9,8 +9,7 @@ Geocoder.configure( # https_proxy: nil, # HTTPS proxy server (user:pass@host:port) # api_key: nil, # API key for geocoding service # cache: nil, # cache object (must respond to #[], #[]=, and #del) - # cache_prefix: 'geocoder:', # prefix (string) to use for all cache keys - # cache_expiration: 1.day, # expiration time (ttl) + # cache_prefix: 'geocoder:', # - DEPRECATED - prefix (string) to use for all cache keys # Exceptions that should not be rescued by default # (if you want to implement custom error handling); @@ -20,4 +19,13 @@ Geocoder.configure( # Calculation options # units: :mi, # :km for kilometers or :mi for miles # distances: :linear # :spherical or :linear + + # Cache service type-specific configurations + # cache_options: {} + + # Redis cache configurations (for cache_options): + # { + # expiration: 2.days # redis ttl for all cache + # prefix: 'geocoder:' # prefix to add to redis keys, if used cache_prefix will be ignored + # } )
Update the docs in the initializer
alexreisner_geocoder
train
rb
9acce8d017462e20e65c5875862661a0d9519f90
diff --git a/lib/sheepsafe/controller.rb b/lib/sheepsafe/controller.rb index <HASH>..<HASH> 100644 --- a/lib/sheepsafe/controller.rb +++ b/lib/sheepsafe/controller.rb @@ -87,6 +87,7 @@ module Sheepsafe Process.kill("TERM", pid) exit 0 end + sleep 2 # wait a bit before starting proxy loop do pid = fork do exec("ssh -ND #{@config.socks_port} #{@config.ssh_host}")
lib/sheepsafe/controller.rb: Wait a bit before starting proxy
nicksieger_sheepsafe
train
rb
03733caa738e0a2cdd1b8c711e0113a0d24704d6
diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/TypeWriter.java b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/TypeWriter.java index <HASH>..<HASH> 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/TypeWriter.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/TypeWriter.java @@ -2954,7 +2954,7 @@ public interface TypeWriter<T> { String superTypeInternalName, String[] interfaceTypeInternalName) { super.visit(classFileVersionNumber, - instrumentedType.getActualModifiers((modifiers & Opcodes.ACC_SUPER) != 0), + instrumentedType.getActualModifiers((modifiers & Opcodes.ACC_SUPER) != 0 && !instrumentedType.isInterface()), instrumentedType.getInternalName(), instrumentedType.getGenericSignature(), (instrumentedType.getSuperType() == null ?
Added interface check to super flag.
raphw_byte-buddy
train
java
c17f4a7c2f6013108be500e5b16e78b8393e941e
diff --git a/lib/Channel.js b/lib/Channel.js index <HASH>..<HASH> 100644 --- a/lib/Channel.js +++ b/lib/Channel.js @@ -404,6 +404,7 @@ module.exports = Channel; function ChannelStream(channel) { + // TODO: update readable and writable appropriately var self = this; this.readable = true; this.writable = true; @@ -449,6 +450,7 @@ ChannelStream.prototype.write = function(data, encoding, extended) { ChannelStream.prototype.pause = function() { this.paused = true; + this._channel._conn._sock.pause(); }; ChannelStream.prototype.resume = function() { @@ -469,6 +471,8 @@ ChannelStream.prototype.resume = function() { if (ret === true) this.emit('drain'); + + this._channel._conn._sock.resume(); }; ChannelStream.prototype.end = function(data, encoding, extended) {
channel: pause/resume underlying socket when necessary
mscdex_ssh2
train
js
b60b363744d23851dc77796b2552ed727354ca8e
diff --git a/spec/factories/hyrax_collection.rb b/spec/factories/hyrax_collection.rb index <HASH>..<HASH> 100644 --- a/spec/factories/hyrax_collection.rb +++ b/spec/factories/hyrax_collection.rb @@ -8,11 +8,31 @@ FactoryBot.define do collection_type_gid { Hyrax::CollectionType.find_or_create_default_collection_type.to_global_id } transient do + edit_groups { [] } + edit_users { [] } + read_groups { [] } + read_users { [] } members { nil } end after(:build) do |collection, evaluator| collection.member_ids = evaluator.members.map(&:id) if evaluator.members + collection.permission_manager.edit_groups = evaluator.edit_groups + collection.permission_manager.edit_users = evaluator.edit_users + collection.permission_manager.read_groups = evaluator.read_groups + collection.permission_manager.read_users = evaluator.read_users + end + + after(:create) do |collection, evaluator| + collection.permission_manager.edit_groups = evaluator.edit_groups + collection.permission_manager.edit_users = evaluator.edit_users + collection.permission_manager.read_groups = evaluator.read_groups + collection.permission_manager.read_users = evaluator.read_users + collection.permission_manager.acl.save + end + + trait :public do + read_groups { ['public'] } end trait :with_member_works do
extend :hyrax_collection factory to handle ACLs
samvera_hyrax
train
rb
a9a2dfbddeaf26335ae0280fa8ed1ec943479310
diff --git a/templates/js/ui.combobox.js b/templates/js/ui.combobox.js index <HASH>..<HASH> 100644 --- a/templates/js/ui.combobox.js +++ b/templates/js/ui.combobox.js @@ -30,6 +30,7 @@ }, select: function( event, ui ) { ui.item.option.selected = true; + select.change(); self._trigger( "selected", event, { item: ui.item.option });
add "change" event triggering into combobox
atk4_atk4
train
js
4d0b5aaf3750958f7ba2560b2ad4dd0b0edb51df
diff --git a/lxd-user/proxy.go b/lxd-user/proxy.go index <HASH>..<HASH> 100644 --- a/lxd-user/proxy.go +++ b/lxd-user/proxy.go @@ -32,7 +32,12 @@ func tlsConfig(uid uint32) (*tls.Config, error) { tlsClientKey := string(content) // Load the server certificate. - content, err = ioutil.ReadFile(shared.VarPath("server.crt")) + certPath := shared.VarPath("cluster.crt") + if !shared.PathExists(certPath) { + certPath = shared.VarPath("server.crt") + } + + content, err = ioutil.ReadFile(certPath) if err != nil { return nil, fmt.Errorf("Unable to open server certificate: %w", err) }
lxd-user: Fix use with clusters
lxc_lxd
train
go
caa78eb33ea23067adba2effc09fdac58d71863c
diff --git a/nece/managers.py b/nece/managers.py index <HASH>..<HASH> 100644 --- a/nece/managers.py +++ b/nece/managers.py @@ -1,11 +1,9 @@ from django.db import models -from distutils.version import StrictVersion -from django import get_version from django.conf import settings -if StrictVersion(get_version()) >= StrictVersion('1.9.0'): +try: from django.db.models.query import ModelIterable -else: +except ImportError: ModelIterable = object # just mocking it diff --git a/nece/models.py b/nece/models.py index <HASH>..<HASH> 100644 --- a/nece/models.py +++ b/nece/models.py @@ -1,15 +1,13 @@ from __future__ import unicode_literals -from distutils.version import StrictVersion -from django import get_version from django.db import models from django.db.models import options from nece.managers import TranslationManager, TranslationMixin from nece.exceptions import NonTranslatableFieldError -if StrictVersion(get_version()) >= StrictVersion('1.9.0'): +try: from django.contrib.postgres.fields import JSONField -else: +except ImportError: from nece.fields.pgjson import JSONField options.DEFAULT_NAMES += ('translatable_fields',)
Detect features instead of checking Django version Working on the `master` branch of Django, `get_version` returns something like '<I>.de<I>', which doesn't play well with `StrictVersion`. Instead of relying on this mechanism, we use a `try/except` block to import what we need and fallback, if necessary, on what's actually available.
tatterdemalion_django-nece
train
py,py
5621807c487a0b040a7bc003e24f684bc4cfc469
diff --git a/test/define.js b/test/define.js index <HASH>..<HASH> 100644 --- a/test/define.js +++ b/test/define.js @@ -389,7 +389,7 @@ describe("define", function () { }); -if (gpf.host() === gpf.hosts.nodejs) { +if (config.features.es6class) { include("define.es6");
Use features (#<I>)
ArnaudBuchholz_gpf-js
train
js
8f2c4919ccda59e607dd9fca061d668e7e139fba
diff --git a/lib/httparty/request.rb b/lib/httparty/request.rb index <HASH>..<HASH> 100644 --- a/lib/httparty/request.rb +++ b/lib/httparty/request.rb @@ -20,9 +20,9 @@ module HTTParty end def uri - uri = path.relative? ? URI.parse("#{options[:base_uri]}#{path}") : path - uri.query = query_string(uri) - uri + new_uri = path.relative? ? URI.parse("#{options[:base_uri]}#{path}") : path + new_uri.query = query_string(new_uri) + new_uri end def format @@ -61,7 +61,7 @@ module HTTParty end def perform_actual_request - http(uri).request(@raw_request) + http.request(@raw_request) end def get_response #:nodoc:
removed uri from http call as it is no longer needed. Changed uri variable to new_uri to better differentiate it from uri method.
jnunemaker_httparty
train
rb
a564842bb09db0f586e536586776f3a192d58dca
diff --git a/spring-security-oauth2/src/test/java/org/springframework/security/oauth2/client/token/TestOAuth2AccessTokenSupport.java b/spring-security-oauth2/src/test/java/org/springframework/security/oauth2/client/token/TestOAuth2AccessTokenSupport.java index <HASH>..<HASH> 100644 --- a/spring-security-oauth2/src/test/java/org/springframework/security/oauth2/client/token/TestOAuth2AccessTokenSupport.java +++ b/spring-security-oauth2/src/test/java/org/springframework/security/oauth2/client/token/TestOAuth2AccessTokenSupport.java @@ -80,6 +80,7 @@ public class TestOAuth2AccessTokenSupport { @Test(expected = OAuth2AccessDeniedException.class) public void testRetrieveTokenFailsWhenTokenEndpointNotAvailable() { error = new IOException("Planned"); + response.setStatus(HttpStatus.BAD_REQUEST); support.retrieveToken(form, requestHeaders, resource); } @@ -120,6 +121,10 @@ public class TestOAuth2AccessTokenSupport { public void setHeaders(HttpHeaders headers) { this.headers = headers; } + + public void setStatus(HttpStatus status) { + this.status = status; + } public int getRawStatusCode() throws IOException { return status.value();
Fix bug in unit test tickled by Spring <I>
spring-projects_spring-security-oauth
train
java
77957d9e2cd1aeab30ac8b03de515748074983b4
diff --git a/scripts/release/releaseNotesTemplate.js b/scripts/release/releaseNotesTemplate.js index <HASH>..<HASH> 100644 --- a/scripts/release/releaseNotesTemplate.js +++ b/scripts/release/releaseNotesTemplate.js @@ -54,10 +54,36 @@ ${feat.map(Package).join('\n')} ` } +function writeDocs(docs) { + if (!docs.length) { + return '' + } + + return ` +## documentation +${docs.map(Package).join('\n')} +--- +` +} + +function writeChore(chore) { + if (!chore.length) { + return '' + } + + return ` +## ${chore.length} ${chore.length === 1 ? 'chore' : 'chores'} +${chore.map(Package).join('\n')} +--- +` +} + export default release => { - return `${writeBreaks(release.breaks)} -${writeFixes(release.fix)} -${writeFeat(release.feat)} + return `${writeBreaks(release.summary.breaks)} +${writeFixes(release.summary.fix)} +${writeFeat(release.summary.feat)} +${writeDocs(release.summary.docs)} +${writeChore(release.summary.chore)} With :heart: from the Cerebral Team! `
chore(release): update release template to show docs and chore
cerebral_cerebral
train
js
b881ee968bc75f08f47b9b7eb74d3055de1d6dad
diff --git a/src/hieroglyph/__init__.py b/src/hieroglyph/__init__.py index <HASH>..<HASH> 100644 --- a/src/hieroglyph/__init__.py +++ b/src/hieroglyph/__init__.py @@ -75,6 +75,12 @@ def setup(app): app.connect('builder-inited', html.inspect_config) app.connect('html-page-context', html.add_link) + return { + 'version': __version__, + 'parallel_read_safe': True, + 'parallel_write_safe': True, + } + from ._version import get_versions __version__ = get_versions()['version'] del get_versions
Enable parallel reading of source files with Sphinx (#<I>)
nyergler_hieroglyph
train
py
e894f5fa2a79a6bd0ac6ad0e4c9cb9bfdbc0bc89
diff --git a/bosh-stemcell/spec/support/os_image_shared_examples.rb b/bosh-stemcell/spec/support/os_image_shared_examples.rb index <HASH>..<HASH> 100644 --- a/bosh-stemcell/spec/support/os_image_shared_examples.rb +++ b/bosh-stemcell/spec/support/os_image_shared_examples.rb @@ -123,8 +123,13 @@ shared_examples_for 'every OS image' do end context 'telnet-server is not installed (stig: V-38587, V-38589)' do - describe package('telnet-server') do - it { should_not be_installed } + it "shouldn't be installed" do + expect(package('telnet-server')).to_not be_installed + expect(package('telnetd')).to_not be_installed + expect(package('telnetd-ssl')).to_not be_installed + expect(package('telnet-server-krb5')).to_not be_installed + expect(package('inetutils-telnetd')).to_not be_installed + expect(package('mactelnet-server')).to_not be_installed end end
Check more telnet server packages aren't installed [finishes #<I>](<URL>)
cloudfoundry_bosh
train
rb
6915b9c0790f7762e4ab79f84c594a3b76299119
diff --git a/tools/azure-sdk-tools/packaging_tools/code_report.py b/tools/azure-sdk-tools/packaging_tools/code_report.py index <HASH>..<HASH> 100644 --- a/tools/azure-sdk-tools/packaging_tools/code_report.py +++ b/tools/azure-sdk-tools/packaging_tools/code_report.py @@ -15,7 +15,7 @@ from typing import Dict, Any, Optional try: # If I'm started as a module __main__ from .venvtools import create_venv_with_package -except ModuleNotFoundError: +except (ModuleNotFoundError, ImportError) as e: # If I'm started by my main directly from venvtools import create_venv_with_package
Update code_report to support python <I> (#<I>)
Azure_azure-sdk-for-python
train
py
d828d2415b9266623d78fede4b0bbacfd424e7dd
diff --git a/lib/action_tracker.rb b/lib/action_tracker.rb index <HASH>..<HASH> 100644 --- a/lib/action_tracker.rb +++ b/lib/action_tracker.rb @@ -9,6 +9,7 @@ require 'action_tracker/configuration' module ActionTracker if defined?(Rails) require 'action_tracker/engine' - ActiveSupport.on_load(:action_controller) { ::ActionController::Base.include ActionTracker::Concerns::Tracker } - end + ActiveSupport.on_load(:action_controller) do + ::ActionController::Base.include ActionTracker::Concerns::Tracker + end end
fix [houndci-bot] Line is too long
appprova_action_tracker
train
rb
bbe4944f60e90c86de703f4dfea9372fc6d039e5
diff --git a/lib/link/utils.js b/lib/link/utils.js index <HASH>..<HASH> 100644 --- a/lib/link/utils.js +++ b/lib/link/utils.js @@ -6,18 +6,18 @@ exports.types = { }; // Virtual link types. -exports.vl_types = [ - 'bridge', // Ethernet Bridge device. - 'can', // Controller Area Network interface. - 'dummy', // Dummy network interface. - 'ifb', // Intermediate Functional Block device. - 'ipoib', // IP over Infiniband device. - 'macvlan', // Virtual interface base on link layer address (MAC). - 'vcan', // Virtual Local CAN interface. - 'veth', // Virtual ethernet interface. - 'vlan', // 802.1q tagged virtual LAN interface. - 'vxlan' // Virtual eXtended LAN. -]; +exports.vl_types = { + bridge : 'bridge', // Ethernet Bridge device. + can : 'can', // Controller Area Network interface. + dummy : 'dummy', // Dummy network interface. + ifb : 'ifb', // Intermediate Functional Block device. + ipoib : 'ipoib', // IP over Infiniband device. + macvlan: 'macvlan', // Virtual interface base on link layer address (MAC). + vcan : 'vcan', // Virtual Local CAN interface. + veth : 'veth', // Virtual ethernet interface. + vlan : 'vlan', // 802.1q tagged virtual LAN interface. + vxlan : 'vxlan' // Virtual eXtended LAN. +}; // Interface flags. exports.flags = [
ip-link: Changed vl_types to an object format to make it really usable.
diosney_node-iproute
train
js
d45fa67ad8d1ff807bed157915de9fcd4de67715
diff --git a/lib/addressable/uri.rb b/lib/addressable/uri.rb index <HASH>..<HASH> 100644 --- a/lib/addressable/uri.rb +++ b/lib/addressable/uri.rb @@ -867,12 +867,18 @@ module Addressable validate() end - # Returns the password for this URI. + ## + # The password component for this URI. + # + # @return [String] The password component. def password return @password end - # Returns the URI's password component, normalized. + ## + # The password component for this URI, normalized. + # + # @return [String] The password component, normalized. def normalized_password @normalized_password ||= (begin if self.password @@ -888,7 +894,10 @@ module Addressable end) end - # Sets the password for this URI. + ## + # Sets the password component for this URI. + # + # @param [String, #to_str] new_password The new password component. def password=(new_password) @password = new_password ? new_password.to_str : nil
Updated the documentation for the password methods.
sporkmonger_addressable
train
rb
85f842061196801bc9ec203586ab37910bd4672f
diff --git a/test/integration/generated_regress_test.rb b/test/integration/generated_regress_test.rb index <HASH>..<HASH> 100644 --- a/test/integration/generated_regress_test.rb +++ b/test/integration/generated_regress_test.rb @@ -1216,12 +1216,23 @@ describe Regress do end describe "Regress::TestStructB" do + let(:instance) { Regress::TestStructB.new } it "has a writable field some_int8" do - skip + instance.some_int8.must_equal 0 + instance.some_int8 = 42 + instance.some_int8.must_equal 42 end + it "has a writable field nested_a" do - skip + instance.nested_a.some_int.must_equal 0 + + nested = Regress::TestStructA.new + nested.some_int = -4321 + + instance.nested_a = nested + instance.nested_a.some_int.must_equal(-4321) end + it "has a working method #clone" do a = Regress::TestStructB.new a.some_int8 = 42
Add tests for Regress::TestStructB's fields
mvz_gir_ffi
train
rb
ad989530eaa12be78b51e9c2afcbaeb584e5e00b
diff --git a/pkg/endpoint/bpf.go b/pkg/endpoint/bpf.go index <HASH>..<HASH> 100644 --- a/pkg/endpoint/bpf.go +++ b/pkg/endpoint/bpf.go @@ -75,7 +75,7 @@ func (e *Endpoint) writeHeaderfile(prefix string, owner Owner) error { } } if err != nil { - e.LogStatus(BPF, Warning, fmt.Sprintf("Unable to create a base64: %s", err)) + e.logStatusLocked(BPF, Warning, fmt.Sprintf("Unable to create a base64: %s", err)) } if e.DockerID == "" {
pkg/endpoint: use logStatusLocked in writeHeaderfile writeHeaderfile is called with the endpoint Mutex is held. LogStatus tries to acquire the endpoint Mutex, and is called within writeHeaderfile. This is a deadlock scenario. Fix by calling logStatusLocked instead, which assumes the endpoint Mutex is held. Fixes: #<I>
cilium_cilium
train
go
b70cfb70bd41f25861aaf242c1159ef4d2a4e1a8
diff --git a/housekeeper/store/api.py b/housekeeper/store/api.py index <HASH>..<HASH> 100644 --- a/housekeeper/store/api.py +++ b/housekeeper/store/api.py @@ -85,10 +85,11 @@ def cases(query_str=None, missing=None, version=None, onhold=None): query = Case.query.filter(Case.is_manual == None).order_by(Case.created_at) if missing == 'analyzed': + not_analyzed = ((Sample.sequenced_at > datetime.date(2017, 1, 1)) & + (AnalysisRun.analyzed_at == None)) query = (query.outerjoin(Case.runs) .join(Case.samples) - .filter(AnalysisRun.analyzed_at == None, - Sample.sequenced_at > datetime.date(2017, 1, 1))) + .filter(not_analyzed | Case.rerun_requested)) elif missing == 'delivered': query = (query.join(Case.runs) .filter(AnalysisRun.analyzed_at != None,
include cases marked to be rerun in list of cases to analyze
Clinical-Genomics_housekeeper
train
py
84c57ba761bd1f716ecebe65f5807011c5d48182
diff --git a/salt/grains/metadata.py b/salt/grains/metadata.py index <HASH>..<HASH> 100644 --- a/salt/grains/metadata.py +++ b/salt/grains/metadata.py @@ -30,7 +30,7 @@ HOST = 'http://{0}/'.format(IP) def __virtual__(): - if __salt__['config.get']('metadata_server_grains', False) is False: + if __opts__.get('metadata_server_grains', False) is False: return False sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.settimeout(.1)
use opts for metadata grains I checked for them, but apparently we manually load the cmdmod stuff for the core grains, so __salt__ is not loaded in metadata grain. This just means that this setting will have to be put in the minion config to enable it.
saltstack_salt
train
py
cab23d6625d2eeb92844cd66e40aaafd6cd50f5a
diff --git a/lib/discordrb/data.rb b/lib/discordrb/data.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/data.rb +++ b/lib/discordrb/data.rb @@ -1250,20 +1250,20 @@ module Discordrb end # Bans a user from this server. - # @param user [User] The user to ban. + # @param user [User, #resolve_id] The user to ban. # @param message_days [Integer] How many days worth of messages sent by the user should be deleted. def ban(user, message_days = 0) API.ban_user(@bot.token, @id, user.resolve_id, message_days) end # Unbans a previously banned user from this server. - # @param user [User] The user to unban. + # @param user [User, #resolve_id] The user to unban. def unban(user) API.unban_user(@bot.token, @id, user.resolve_id) end # Kicks a user from this server. - # @param user [User] The user to kick. + # @param user [User, #resolve_id] The user to kick. def kick(user) API.kick_user(@bot.token, @id, user.resolve_id) end
Make it clear in doc comments that other resolvables can be used now
meew0_discordrb
train
rb
f9c0b02c215cf73b3dfc95f973a407957708f833
diff --git a/manager/manager/manager_test.go b/manager/manager/manager_test.go index <HASH>..<HASH> 100644 --- a/manager/manager/manager_test.go +++ b/manager/manager/manager_test.go @@ -400,8 +400,12 @@ func TestExpand(t *testing.T) { t.Error("Failed to expand template into manifest.") } - if m.InputConfig != nil { - t.Errorf("Input config not nil: %v", *m) + if m.Name != "" { + t.Errorf("Name was not empty: %v", *m) + } + + if m.Deployment != "" { + t.Errorf("Deployment was not empty: %v", *m) } if m.InputConfig != nil {
Adding the rest of validations for manager expand test.
helm_helm
train
go
a8b63c7b816ef600e9945c434c9a3d178378cb9a
diff --git a/core/src/main/java/org/testcontainers/dockerclient/DockerClientProviderStrategy.java b/core/src/main/java/org/testcontainers/dockerclient/DockerClientProviderStrategy.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/testcontainers/dockerclient/DockerClientProviderStrategy.java +++ b/core/src/main/java/org/testcontainers/dockerclient/DockerClientProviderStrategy.java @@ -54,7 +54,7 @@ public abstract class DockerClientProviderStrategy { LOGGER.info("Looking for Docker environment. Trying {}", strategy.getDescription()); strategy.test(); return strategy; - } catch (Exception | ExceptionInInitializerError e) { + } catch (Exception | ExceptionInInitializerError | NoClassDefFoundError e) { @Nullable String throwableMessage = e.getMessage(); @SuppressWarnings("ThrowableResultOfMethodCallIgnored") Throwable rootCause = Throwables.getRootCause(e);
Fix uncaught NoClassDefFoundError when environment variables are set on OS X
testcontainers_testcontainers-java
train
java
14b685ee3ae534b73711dd443c44bd510ccb4efc
diff --git a/releng/org.eclipse.orion.client.releng/builder/scripts/orion.build.js b/releng/org.eclipse.orion.client.releng/builder/scripts/orion.build.js index <HASH>..<HASH> 100644 --- a/releng/org.eclipse.orion.client.releng/builder/scripts/orion.build.js +++ b/releng/org.eclipse.orion.client.releng/builder/scripts/orion.build.js @@ -125,7 +125,6 @@ { name: "plugins/webEditingPlugin" }, { name: "profile/user-list" }, { name: "profile/userservicePlugin" }, - { name: "search/search" }, { name: "settings/settings" }, { name: "shell/plugins/shellPagePlugin" }, { name: "shell/shellPage" },
Bug <I> build failure: module path does not exist: search/search.js
eclipse_orion.client
train
js
fcb817e3f1bbf9f8a016d118878fb04877154c6f
diff --git a/lib/support/chromePerflogParser.js b/lib/support/chromePerflogParser.js index <HASH>..<HASH> 100644 --- a/lib/support/chromePerflogParser.js +++ b/lib/support/chromePerflogParser.js @@ -213,7 +213,7 @@ module.exports = { queryString: parseQueryData(urlParser.parse(url, true).query), postData: parsePostData(getHeaderValue(request.headers, 'Content-Type'), request.postData), headersSize: -1, - bodySize: -1, + bodySize: -1, // FIXME calculate based on postData _initialPriority: request.initialPriority, cookies: parseRequestCookies(cookieHeader), headers: parseHeaders(request.headers) @@ -348,6 +348,7 @@ module.exports = { timings.send + timings.wait + timings.receive; entry._loadingFinishedTime = params.timestamp; + // FIXME, encodedDataLength includes headers according to https://github.com/cyrus-and/chrome-har-capturer/issues/25 entry.response.bodySize = params.encodedDataLength > 0 ? params.encodedDataLength : entry.response.bodySize; //if (entry.response.headersSize > -1) { // entry.response.bodySize -= entry.response.headersSize;
Add FIXMEs for incorrect size calculations.
sitespeedio_browsertime
train
js
92d5f0df1563bf8c6018591affb642c2ba745028
diff --git a/jumeaux/executor.py b/jumeaux/executor.py index <HASH>..<HASH> 100644 --- a/jumeaux/executor.py +++ b/jumeaux/executor.py @@ -163,7 +163,7 @@ def judgement(r_one: Response, r_other: Response, regard_as_same: bool = global_addon_executor.apply_judgement( JudgementAddOnPayload.from_dict({ "remaining_diff_keys": diff_keys, - "regard_as_same": r_one.body == r_other.body, + "regard_as_same": r_one.body == r_other.body if diff_keys is None else diff_keys.is_empty(), }), JudgementAddOnReference.from_dict({ "name": name, diff --git a/jumeaux/models.py b/jumeaux/models.py index <HASH>..<HASH> 100644 --- a/jumeaux/models.py +++ b/jumeaux/models.py @@ -274,6 +274,9 @@ class DiffKeys(OwlMixin): changed: TList[str] removed: TList[str] + def is_empty(self) -> bool: + return len(self.added) == len(self.changed) == len(self.removed) == 0 + class ResponseSummary(OwlMixin): url: str
:skull: Fix bug that regard as different even if properties are same #<I>
tadashi-aikawa_jumeaux
train
py,py
4d232e25e19b3c6d0d4a705a918d9c32aff1630c
diff --git a/zhmcclient/_session.py b/zhmcclient/_session.py index <HASH>..<HASH> 100644 --- a/zhmcclient/_session.py +++ b/zhmcclient/_session.py @@ -378,7 +378,6 @@ class Session(object): if logon_required: self.logon() url = self.base_url + uri - data = json.dumps(body) stats = self.time_stats_keeper.get_stats('post ' + uri) stats.begin() req = self._session or requests @@ -387,6 +386,7 @@ class Session(object): result = req.post(url, headers=self.headers, verify=False) else: + data = json.dumps(body) result = req.post(url, data=data, headers=self.headers, verify=False) self._log_hmc_request_id(result)
Moved the setting of data into the branch where it is used.
zhmcclient_python-zhmcclient
train
py
f4e6b0f02c6f4bf04b9d28a493b39e922ef2039f
diff --git a/lib/aerospike/cluster/cluster.rb b/lib/aerospike/cluster/cluster.rb index <HASH>..<HASH> 100644 --- a/lib/aerospike/cluster/cluster.rb +++ b/lib/aerospike/cluster/cluster.rb @@ -35,7 +35,7 @@ module Aerospike @cluster_nodes = [] @partition_write_map = {} @node_index = Atomic.new(0) - @closed = Atomic.new(false) + @closed = Atomic.new(true) @mutex = Mutex.new # setup auth info for cluster @@ -271,6 +271,8 @@ module Aerospike thr.kill if thr.alive? end + @closed.value = false if @cluster_nodes.length > 0 + end def set_partitions(part_map)
Fix cluster connection logic to correctly set the @closed value
aerospike_aerospike-client-ruby
train
rb
68ca7af8f8aff1b47a6dd0ff6daa334610800012
diff --git a/tests/test_attacks.py b/tests/test_attacks.py index <HASH>..<HASH> 100644 --- a/tests/test_attacks.py +++ b/tests/test_attacks.py @@ -33,7 +33,8 @@ attacks: List[Tuple[fbn.Attack, bool, bool]] = [ (fa.L2FastGradientAttack(L2(100.0)), True, False), (fa.LinfFastGradientAttack(Linf(100.0)), True, False), (fa.GaussianBlurAttack(steps=10), True, True), - (fa.L2DeepFoolAttack(steps=50), True, False), + (fa.L2DeepFoolAttack(steps=50, loss="logits"), True, False), + (fa.L2DeepFoolAttack(steps=50, loss="crossentropy"), True, False), (fa.LinfDeepFoolAttack(steps=50), True, False), ]
added test for DeepFool with crossentropy
bethgelab_foolbox
train
py
178b6f2874fe1eddb2f8084bdaf6c2a3c811bdf7
diff --git a/src/CoandaCMS/Coanda/Coanda.php b/src/CoandaCMS/Coanda/Coanda.php index <HASH>..<HASH> 100644 --- a/src/CoandaCMS/Coanda/Coanda.php +++ b/src/CoandaCMS/Coanda/Coanda.php @@ -149,7 +149,7 @@ class Coanda { { return Coanda::route($slug); - })->where('slug', '[\/_\-\_A-Za-z]+'); + })->where('slug', '[\/_\-\_A-Za-z0-9]+'); } /**
Bugfix - allowed numbers in the URL's
CoandaCMS_coanda-core
train
php
e792b5a9b0cbe4acc10de7c57dd40a2b4c3c26c2
diff --git a/src/walk.js b/src/walk.js index <HASH>..<HASH> 100644 --- a/src/walk.js +++ b/src/walk.js @@ -312,11 +312,10 @@ function begin (delay) { if (quoting) { quoting = false; - return next().then(function (character) { - escape(character).then(function (escaped) { - string += escaped; - next().then(step); - }); + return escape(character).then(function (escaped) { + console.log('walkString::escaped: ' + escaped); + string += escaped; + next().then(step); }); } @@ -326,10 +325,8 @@ function begin (delay) { } if (character !== '"') { - return next().then(function (character) { - string += character; - next().then(step); - }); + string += character; + return next().then(step); } insideString = false;
Eliminate bad calls to next.
philbooth_bfj
train
js
2185474c7af60edfbc9aa98e368898bf3cdb6135
diff --git a/src/org/parosproxy/paros/core/scanner/VariantUserDefined.java b/src/org/parosproxy/paros/core/scanner/VariantUserDefined.java index <HASH>..<HASH> 100644 --- a/src/org/parosproxy/paros/core/scanner/VariantUserDefined.java +++ b/src/org/parosproxy/paros/core/scanner/VariantUserDefined.java @@ -71,7 +71,7 @@ public class VariantUserDefined implements Variant { if (isInHeader(this.injectionPoints[i]) || isInBody(this.injectionPoints[i]) ) { list.add(new NameValuePair(NameValuePair.TYPE_UNDEFINED, "", "", i)); } else { - logger.equals("Invalid injection point: " + this.injectionPoints[i]); + logger.warn("Invalid injection point: " + this.injectionPoints[i]); } } }
Address FindBugs Item: * logger.equals was used in assignment instead of comparison
zaproxy_zaproxy
train
java
cc969bc9e4264a7a529c302d0f5d3e23de0827cb
diff --git a/nece/managers.py b/nece/managers.py index <HASH>..<HASH> 100644 --- a/nece/managers.py +++ b/nece/managers.py @@ -77,5 +77,7 @@ class TranslationManager(models.Manager, TranslationMixin): def language(self, language_code): language_code = self.get_language_key(language_code) + if self.is_default_language(language_code): + return self.language_or_default(language_code) return self.language_or_default(language_code).filter( translations__has_key=(language_code))
get records by their default language_code as settled over language method
tatterdemalion_django-nece
train
py
582c2e340c1657ff3118a9aa0b4f552c913dbf09
diff --git a/rails_event_store/spec/browser_integration_spec.rb b/rails_event_store/spec/browser_integration_spec.rb index <HASH>..<HASH> 100644 --- a/rails_event_store/spec/browser_integration_spec.rb +++ b/rails_event_store/spec/browser_integration_spec.rb @@ -16,11 +16,11 @@ module RailsEventStore specify 'api' do event_store.publish(events = 21.times.map { DummyEvent.new }) request = ::Rack::MockRequest.new(app) - response = request.get('/res/streams/all') + response = request.get('/res/streams/all/relationships/events') expect(JSON.parse(response.body)["links"]).to eq({ - "last" => "http://example.org/res/streams/all/head/forward/20", - "next" => "http://example.org/res/streams/all/#{events[1].event_id}/backward/20" + "last" => "http://example.org/res/streams/all/relationships/events/head/forward/20", + "next" => "http://example.org/res/streams/all/relationships/events/#{events[1].event_id}/backward/20" }) end
Fix tests from RailsEventStore::Browser The URL structure has slightly changed in the meantime
RailsEventStore_rails_event_store
train
rb
4bf9443b6f5a4569ac93d2713732336870d17202
diff --git a/lib/capybara/driver/webkit.rb b/lib/capybara/driver/webkit.rb index <HASH>..<HASH> 100644 --- a/lib/capybara/driver/webkit.rb +++ b/lib/capybara/driver/webkit.rb @@ -126,6 +126,10 @@ class Capybara::Driver::Webkit @cookie_jar ||= CookieJar.new(browser) end + def invalid_element_errors + [] + end + private def url(path)
Added empty invalid_element_errors method. Driver does not inherit from Base driver and was intermittently causing the following error: undefined method `invalid_element_errors' for #<Capybara::Driver::Webkit:0x...> (NoMethodError) (eval):2:in `has_content?'
thoughtbot_capybara-webkit
train
rb
19889cd1f78ef91af272d479021cc71cb698afae
diff --git a/streak_client/streak_client.py b/streak_client/streak_client.py index <HASH>..<HASH> 100644 --- a/streak_client/streak_client.py +++ b/streak_client/streak_client.py @@ -2,7 +2,7 @@ import json, requests from streak_objects import * import requests -DEBUG = 1 +DEBUG = 0 class StreakClientBaseObject(object): '''Specified basics for the Streak API Client @@ -96,7 +96,7 @@ class StreakClient(StreakClientBaseObject): Args: my_api_key api key for this instance ''' - super(StreakClient, self).__init__(my_api_key) + super(self.__class__, self).__init__(my_api_key) self.sort_by_postfix = '?sortBy=' self.boxes_suffix = 'boxes' @@ -852,6 +852,7 @@ class StreakClient(StreakClientBaseObject): ]) return self._req('get', uri) ############ +#Temporary test routines. ############ def user_api_test(s_client): code, user_data = s_client.get_user() @@ -1201,6 +1202,7 @@ def box_reminder_api_test(s_client): print("------------------") raw_input() ############ +#Main as temporary test runner ############ def main(): """Code to run simple demo commands"""
Minor changes. Comments need to be cleaned up along with uri generation parts.
mehmetg_streak_client
train
py
6f682bcb46edd436e7434ca1b0ceef16f33c74fc
diff --git a/tofu/geom/_core.py b/tofu/geom/_core.py index <HASH>..<HASH> 100644 --- a/tofu/geom/_core.py +++ b/tofu/geom/_core.py @@ -2802,11 +2802,11 @@ class Rays(utils.ToFuObject): if dgeom['case'] in ['A','B']: u = dgeom['u'][:,0:1] sca2 = np.sum(dgeom['u'][:,1:]*u,axis=0)**2 - if np.all(sca2<1.-1.e-9): + if np.all(sca2 < 1.-1.e-9): DDb = dgeom['D'][:,1:]-dgeom['D'][:,0:1] - k = np.sum(DDb*(u + np.sqrt(sca)*dgeom['u'][:,1:]),axis=0) - k = k / (1.-sca**2) - if np.all(k[1:]-k[0]<1.e-9): + k = np.sum(DDb*(u + np.sqrt(sca2)*dgeom['u'][:,1:]),axis=0) + k = k / (1.-sca2) + if k[0] > 0 and np.all(k[1:]-k[0]<1.e-9): pinhole = dgeom['D'][:,0] + k[0]*u dgeom['pinhole'] = pinhole
[debugging] debugging raytracing
ToFuProject_tofu
train
py
436e098a45ec951140880ce60d91c854e4b26692
diff --git a/reactor-net/src/main/java/reactor/rx/net/NetStreams.java b/reactor-net/src/main/java/reactor/rx/net/NetStreams.java index <HASH>..<HASH> 100644 --- a/reactor-net/src/main/java/reactor/rx/net/NetStreams.java +++ b/reactor-net/src/main/java/reactor/rx/net/NetStreams.java @@ -74,7 +74,7 @@ public enum NetStreams { ; static { - if (!DependencyUtils.hasReactorFluxion()) { + if (!DependencyUtils.hasReactorStream()) { throw new IllegalStateException("io.projectreactor:reactor-stream dependency is missing from the classpath."); }
revert module Reactor Fluxion to Reactor Stream
reactor-attic_reactor-ipc
train
java
441fc3ad97b8cd2c66d9591705ca50db4a0d4375
diff --git a/dvc/project.py b/dvc/project.py index <HASH>..<HASH> 100644 --- a/dvc/project.py +++ b/dvc/project.py @@ -229,7 +229,8 @@ class Project(object): self._check_dag(self.stages() + stages) for stage in stages: - stage.dump() + if stage is not None: + stage.dump() self._remind_to_git_add() diff --git a/tests/test_add.py b/tests/test_add.py index <HASH>..<HASH> 100644 --- a/tests/test_add.py +++ b/tests/test_add.py @@ -188,3 +188,19 @@ class TestCmdAdd(TestDvc): ret = main(["add", "non-existing-file"]) self.assertNotEqual(ret, 0) + + +class TestDoubleAddUnchanged(TestDvc): + def test_file(self): + ret = main(["add", self.FOO]) + self.assertEqual(ret, 0) + + ret = main(["add", self.FOO]) + self.assertEqual(ret, 0) + + def test_dir(self): + ret = main(["add", self.DATA_DIR]) + self.assertEqual(ret, 0) + + ret = main(["add", self.DATA_DIR]) + self.assertEqual(ret, 0)
add: don't try to save cached stages Cached stages are already saved, so there is no need to try to save them once again. Fixes #<I>
iterative_dvc
train
py,py
6caa9076d989cb0ff173c53ac08fce9028d7d984
diff --git a/test/func/add.spec.js b/test/func/add.spec.js index <HASH>..<HASH> 100644 --- a/test/func/add.spec.js +++ b/test/func/add.spec.js @@ -56,7 +56,7 @@ describe('Functional: add()', function () { const seven = add(archive, source) seven.on('end', function () { const size = statSync(archive).size - expect(size).to.greaterThan(398) + expect(size).to.greaterThan(350) expect(existsSync(archive)).to.equal(true) done() })
test: Lower min size threshold cause 7-Zip is better on Windows
quentinrossetti_node-7z
train
js
3dbb7475bfdb983af19565592396ed9912fd3055
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ setup( author_email='sebastien.eustace@gmail.com', url='https://github.com/SDisPater/cleo', download_url='https://github.com/SDisPater/cleo/archive/v%s.tar.gz' % __version__, - packages=find_packages(), + packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), install_requires=['nose', 'pylev', 'mock'], tests_require=['nose', 'mock'], test_suite='nose.collector',
Fix #<I>: Added list of exclude values for tests in the `find_packages` function.
sdispater_cleo
train
py
746005969ecf027f678dd6511f026bbf5dd408ea
diff --git a/lxd/network/driver_bridge.go b/lxd/network/driver_bridge.go index <HASH>..<HASH> 100644 --- a/lxd/network/driver_bridge.go +++ b/lxd/network/driver_bridge.go @@ -512,7 +512,7 @@ func (n *bridge) Delete(clientType request.ClientType) error { } // Delete apparmor profiles. - err = apparmor.NetworkDelete(n.state, n) + err = apparmor.NetworkDelete(n.state.OS, n) if err != nil { return err } @@ -1479,7 +1479,7 @@ func (n *bridge) setup(oldConfig map[string]string) error { } // Generate and load apparmor profiles. - err = apparmor.NetworkLoad(n.state, n) + err = apparmor.NetworkLoad(n.state.OS, n) if err != nil { return err } @@ -1760,7 +1760,7 @@ func (n *bridge) Stop() error { } // Unload apparmor profiles. - err = apparmor.NetworkUnload(n.state, n) + err = apparmor.NetworkUnload(n.state.OS, n) if err != nil { return err }
lxd/network: Remove state.State dependency from apparmor package
lxc_lxd
train
go
b0067559f9d0a62b0dce30010e5b1d172219fc7e
diff --git a/helper/i18n.js b/helper/i18n.js index <HASH>..<HASH> 100755 --- a/helper/i18n.js +++ b/helper/i18n.js @@ -141,7 +141,7 @@ I18n.setStatic(async function getTranslation(domain, key, parameters) { } if (!source) { - return ''; + source = key; } let result; @@ -677,7 +677,11 @@ XI18n.setMethod(function introduced() { } promise.then(function gotTranslation(result) { - that.innerHTML = result; + + if (result) { + that.innerHTML = result; + } + that.fallback = false; }); }
Use key if fallback method still can't find translation
skerit_alchemy-i18n
train
js
763af60cf4512ad28e3ab3ce8d55bc9e56dd6155
diff --git a/lib/Doctrine/Common/Collections/ArrayCollection.php b/lib/Doctrine/Common/Collections/ArrayCollection.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/Common/Collections/ArrayCollection.php +++ b/lib/Doctrine/Common/Collections/ArrayCollection.php @@ -312,6 +312,10 @@ class ArrayCollection implements Collection, Selectable * {@inheritDoc} * * @return static + * + * @psalm-template U + * @psalm-param Closure(T=):U $func + * @psalm-return static<TKey, U> */ public function map(Closure $func) {
fix #<I> by including psalm-* annotations to ArrayCollection#map() method
doctrine_collections
train
php
248e2a1e690deb3bd44f8fb0b58b2b7d8eef1b34
diff --git a/tests/test_blobservice.py b/tests/test_blobservice.py index <HASH>..<HASH> 100644 --- a/tests/test_blobservice.py +++ b/tests/test_blobservice.py @@ -339,7 +339,7 @@ class BlobServiceTest(AzureTestCase): connection.send(content) resp = connection.getresponse() - respheaders = resp.getheaders() + respheaders = [(name.lower(), val) for name, val in resp.getheaders()] respbody = None if resp.length is None: respbody = resp.read()
Changes blob tests so that headers are returned with a lowercase name. This matches the behavior of the SDK, which does this to ensure consistency across httplib on python 2.x and 3.x, winhttp, as well as other platforms.
Azure_azure-sdk-for-python
train
py
16b73456d2b605ddea8c74014bb7a270e6a0106b
diff --git a/lib/inventory_refresh/save_collection/saver/concurrent_safe_batch.rb b/lib/inventory_refresh/save_collection/saver/concurrent_safe_batch.rb index <HASH>..<HASH> 100644 --- a/lib/inventory_refresh/save_collection/saver/concurrent_safe_batch.rb +++ b/lib/inventory_refresh/save_collection/saver/concurrent_safe_batch.rb @@ -184,9 +184,9 @@ module InventoryRefresh::SaveCollection [:resource_counter, :resource_counters_max] end - next if skeletonize_or_skip_record(record.try(version_attr) || record.try(:[], version_attr), + next if skeletonize_or_skip_record(record_key(record, version_attr), hash[version_attr], - record.try(max_version_attr) || record.try(:[], max_version_attr), + record_key(record, max_version_attr), inventory_object) end
Use the right accessor to the record
ManageIQ_inventory_refresh
train
rb
836450342daed1beb2c1419dee6dbac1b3547eda
diff --git a/framework/src/main/java/com/jetdrone/vertx/yoke/middleware/Static.java b/framework/src/main/java/com/jetdrone/vertx/yoke/middleware/Static.java index <HASH>..<HASH> 100644 --- a/framework/src/main/java/com/jetdrone/vertx/yoke/middleware/Static.java +++ b/framework/src/main/java/com/jetdrone/vertx/yoke/middleware/Static.java @@ -67,8 +67,11 @@ public class Static extends Middleware { * @param includeHidden in the directory listing show dot files */ public Static(String root, long maxAge, boolean directoryListing, boolean includeHidden) { - if (root.endsWith("/")) { - root = root.substring(0, root.length() - 1); + // if the root is not empty it should end with / for convenience + if (!"".equals(root)) { + if (!root.endsWith("/")) { + root = root + "/"; + } } this.root = root; this.maxAge = maxAge;
add trailing slash to static middleware
pmlopes_yoke
train
java
f92d846260ce6ca4efbc453db8bc0131b2349e9b
diff --git a/extensions/cms/Panes.php b/extensions/cms/Panes.php index <HASH>..<HASH> 100644 --- a/extensions/cms/Panes.php +++ b/extensions/cms/Panes.php @@ -27,12 +27,13 @@ class Panes extends \lithium\core\StaticObject { $options += [ 'title' => Inflector::humanize($name), 'url' => null, - 'group' => Panes::GROUP_NONE + 'group' => Panes::GROUP_NONE, + 'nested' => [] ]; if (is_callable($options['url'])) { $options['url'] = $options['url'](); } - Environment::set(true, ['panes' => [$name => compact('name', 'library') + $options]]); + Environment::set(true, ['panes' => [$name => compact('name', 'library') + $options]]); } public static function grouped() {
Allow nested panes.
bseries_cms_core
train
php
fdd849682d68503286db2ef2c8dbf3e059fdd3fd
diff --git a/src/de/mrapp/android/preference/activity/PreferenceFragment.java b/src/de/mrapp/android/preference/activity/PreferenceFragment.java index <HASH>..<HASH> 100644 --- a/src/de/mrapp/android/preference/activity/PreferenceFragment.java +++ b/src/de/mrapp/android/preference/activity/PreferenceFragment.java @@ -206,13 +206,12 @@ public abstract class PreferenceFragment extends } else if (preference.getKey() != null && !preference.getKey().isEmpty() && !isBlackListed(preference.getKey()) - && (!areDisabledPreferencesRestored() || preference + && (areDisabledPreferencesRestored() || preference .isEnabled())) { sharedPreferences.edit().remove(preference.getKey()).commit(); + preferenceGroup.removePreference(preference); + preferenceGroup.addPreference(preference); } - - preferenceGroup.removePreference(preference); - preferenceGroup.addPreference(preference); } }
Bugfix #1: The default values of disabled preferences are not restored anymore, when the restoreDisabledPreferences-attribute is set to false.
michael-rapp_AndroidPreferenceActivity
train
java
b0fc6792c9d9da36f99558bcd628b374016ae823
diff --git a/tests/contrib/django/middleware.py b/tests/contrib/django/middleware.py index <HASH>..<HASH> 100644 --- a/tests/contrib/django/middleware.py +++ b/tests/contrib/django/middleware.py @@ -1,13 +1,22 @@ -class BrokenRequestMiddleware(object): +try: + # Django >= 1.10 + from django.utils.deprecation import MiddlewareMixin +except ImportError: + # Not required for Django <= 1.9, see: + # https://docs.djangoproject.com/en/1.10/topics/http/middleware/#upgrading-pre-django-1-10-style-middleware + MiddlewareMixin = object + + +class BrokenRequestMiddleware(MiddlewareMixin): def process_request(self, request): raise ImportError('request') -class BrokenResponseMiddleware(object): +class BrokenResponseMiddleware(MiddlewareMixin): def process_response(self, request, response): raise ImportError('response') -class BrokenViewMiddleware(object): +class BrokenViewMiddleware(MiddlewareMixin): def process_view(self, request, func, args, kwargs): raise ImportError('view')
Add `MiddlewareMixin` for these test classes as well
getsentry_raven-python
train
py
fbf9f1090e190aa79f6bf85db928ff7cc0b8ad2a
diff --git a/components/fuse/src/test/java/org/datacleaner/components/fuse/FuseStreamsComponentIntegrationTest.java b/components/fuse/src/test/java/org/datacleaner/components/fuse/FuseStreamsComponentIntegrationTest.java index <HASH>..<HASH> 100644 --- a/components/fuse/src/test/java/org/datacleaner/components/fuse/FuseStreamsComponentIntegrationTest.java +++ b/components/fuse/src/test/java/org/datacleaner/components/fuse/FuseStreamsComponentIntegrationTest.java @@ -47,6 +47,7 @@ import org.datacleaner.test.MockAnalyzer; import org.datacleaner.test.MockOutputDataStreamAnalyzer; import org.datacleaner.test.TestHelper; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; public class FuseStreamsComponentIntegrationTest { @@ -230,6 +231,7 @@ public class FuseStreamsComponentIntegrationTest { } @Test + @Ignore("Not yet implemented") public void testFuseSourceTableAndOutputDataStream() throws Exception { Assert.fail("Not yet implemented"); }
Marked "for now irrelevant" unittest as ignored
datacleaner_DataCleaner
train
java
46902ac3c4d7569eea0b021c41927e165b22c320
diff --git a/pippo-core/src/main/java/ro/fortsoft/pippo/core/ContentTypeEngines.java b/pippo-core/src/main/java/ro/fortsoft/pippo/core/ContentTypeEngines.java index <HASH>..<HASH> 100644 --- a/pippo-core/src/main/java/ro/fortsoft/pippo/core/ContentTypeEngines.java +++ b/pippo-core/src/main/java/ro/fortsoft/pippo/core/ContentTypeEngines.java @@ -17,6 +17,9 @@ package ro.fortsoft.pippo.core; import ro.fortsoft.pippo.core.util.StringUtils; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import java.util.Map; import java.util.TreeMap; @@ -59,6 +62,15 @@ public class ContentTypeEngines { } /** + * Returns the list of registered content types. + * + * @return the list of registered content types + */ + public List<String> getContentTypes() { + return Collections.unmodifiableList(new ArrayList<>(engines.keySet())); + } + + /** * Registers a content type engine if no other engine has been registered * for the content type. *
Add accessor to retrieve registered content types in ContentTypeEngines
pippo-java_pippo
train
java
f43f5ca1989c6e20f1ab401a4003269a9d556502
diff --git a/tests/integration/modules/test_network.py b/tests/integration/modules/test_network.py index <HASH>..<HASH> 100644 --- a/tests/integration/modules/test_network.py +++ b/tests/integration/modules/test_network.py @@ -1,7 +1,3 @@ -# -*- coding: utf-8 -*- - -from __future__ import absolute_import - import pytest import salt.utils.path import salt.utils.platform
Drop Py2 and six on tests/integration/modules/test_network.py
saltstack_salt
train
py
d0224aa3955d7001a5e6f5d962b3325e8b56541f
diff --git a/stdnet/utils/encoders.py b/stdnet/utils/encoders.py index <HASH>..<HASH> 100644 --- a/stdnet/utils/encoders.py +++ b/stdnet/utils/encoders.py @@ -94,10 +94,7 @@ between python 2 and python 3.''' elif isinstance(x, bytes): try: return pickle.loads(x) - except pickle.UnpicklingError: - return None - except EOFError: - # Probably it wasn't a pickle string, treat it as binary data + except (pickle.UnpicklingError,EOFError): return x.decode('utf-8','ignore') else: return x
another fix for the python pickler encoder
lsbardel_python-stdnet
train
py
d4766d44b1e4c452c0e7e4ba0e36f67a3077efd1
diff --git a/resources/lang/fr-FR/forms.php b/resources/lang/fr-FR/forms.php index <HASH>..<HASH> 100644 --- a/resources/lang/fr-FR/forms.php +++ b/resources/lang/fr-FR/forms.php @@ -153,7 +153,7 @@ return [ 'days-of-incidents' => 'Combien de jours d\'incidents à montrer ?', 'time_before_refresh' => 'Fréquence de rafraîchissement de la page de statut (en secondes).', 'banner' => 'Image d\'en-tête', - 'banner-help' => 'Il est recommandé de téléchargez un fichier ne dépassant pas 930px de large .', + 'banner-help' => "Il est recommandé de téléchargez un fichier ne dépassant pas 930px de large .", 'subscribers' => 'Permettre aux personnes de s\'inscrire aux notifications par e-mail ?', 'skip_subscriber_verification' => 'Ne pas vérifier les utilisateurs ? (Attention, vous pourriez être spammé)', 'automatic_localization' => 'Traduire automatiquement votre page de statut dans la langue du visiteur ?',
New translations forms.php (French)
CachetHQ_Cachet
train
php
8cc34a04ea911d789951096dc6281afbe999ad57
diff --git a/duolingo.py b/duolingo.py index <HASH>..<HASH> 100644 --- a/duolingo.py +++ b/duolingo.py @@ -25,6 +25,10 @@ class AlreadyHaveStoreItemException(DuolingoException): pass +class InsufficientFundsException(DuolingoException): + pass + + class CaptchaException(DuolingoException): pass @@ -128,8 +132,11 @@ class Duolingo(object): returns a text like: {"streak_freeze":"2017-01-10 02:39:59.594327"} """ - if request.status_code == 400 and request.json()['error'] == 'ALREADY_HAVE_STORE_ITEM': - raise AlreadyHaveStoreItemException('Already equipped with ' + item_name + '.') + if request.status_code == 400: + if request.json()["error"] == "ALREADY_HAVE_STORE_ITEM": + raise AlreadyHaveStoreItemException("Already equipped with {}.".format(item_name)) + if request.json()["error"] == "INSUFFICIENT_FUNDS": + raise InsufficientFundsException("Insufficient funds to purchase {}.".format(item_name)) if not request.ok: # any other error: raise DuolingoException('Not possible to buy item.')
Adding an InsufficientFundsException while I'm at it
KartikTalwar_Duolingo
train
py
0d3e769dc3c3a3a10cd6130c658d34247ea2b27a
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -89,11 +89,11 @@ function EVC(options) { data.content = dataFound.content; cb(null, true); } else { + var headers = req.headers; + headers.express_view_cache = cacheKey; curl({ 'method': 'GET', - 'headers': { - 'express_view_cache': cacheKey - }, + 'headers': headers, 'url': 'http://localhost:' + config.appPort + key }, function (error, response, body) { if (error) {
passing headers for populating cache call
vodolaz095_express-view-cache
train
js
0833eedb454b1cc77c74a0eb6990a4bb21504ca1
diff --git a/src/main/java/com/googlecode/lanterna/terminal/text/ANSITerminal.java b/src/main/java/com/googlecode/lanterna/terminal/text/ANSITerminal.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/googlecode/lanterna/terminal/text/ANSITerminal.java +++ b/src/main/java/com/googlecode/lanterna/terminal/text/ANSITerminal.java @@ -180,6 +180,9 @@ public abstract class ANSITerminal extends StreamBasedTerminal case RESET_ALL: writeToTerminal((byte)'0'); break; + case EXIT_BLINK: + default: + break; } if(index++ < options.length - 1) writeToTerminal((byte)';');
ANSITerminal: handle (i.e. don't handle) EXIT_BLINK
mabe02_lanterna
train
java
fa4e7b435e5d4399a258cf5febeb43d42fd18d9b
diff --git a/spec/event_sourcery/event_store/subscription_spec.rb b/spec/event_sourcery/event_store/subscription_spec.rb index <HASH>..<HASH> 100644 --- a/spec/event_sourcery/event_store/subscription_spec.rb +++ b/spec/event_sourcery/event_store/subscription_spec.rb @@ -20,7 +20,7 @@ RSpec.describe EventSourcery::EventStore::Subscription do end let(:event_types) { nil } - let(:event_store) { EventSourcery::EventStore::Postgres::Connection.new(pg_connection) } + let(:event_store) { EventSourcery::EventStore::Postgres::ConnectionWithOptimisticConcurrency.new(pg_connection) } subject(:subscription) { described_class.new(event_store: event_store, poll_waiter: waiter, event_types: event_types,
Use optimistic concurrency connection in subscription spec
envato_event_sourcery
train
rb
3d30c302c0fcd5796ead0764347b3863ba0e5f46
diff --git a/devices.js b/devices.js index <HASH>..<HASH> 100755 --- a/devices.js +++ b/devices.js @@ -13152,7 +13152,7 @@ const devices = [ fromZigbee: [fz.on_off_skip_duplicate_transaction_and_disable_default_response], }, { - zigbeeModel: ['ZB-SW02'], + zigbeeModel: ['ZB-SW02', 'E220-KR2N0Z0-HA'], model: 'ZB-SW02', vendor: 'eWeLink', description: 'Smart light switch - 2 gang',
added support for E<I>-KR2N0Z0-HA (#<I>)
Koenkk_zigbee-shepherd-converters
train
js
a42822521c9aaf7c4839ccebc37b284e3bfa7fc7
diff --git a/lib/octopress/page.rb b/lib/octopress/page.rb index <HASH>..<HASH> 100644 --- a/lib/octopress/page.rb +++ b/lib/octopress/page.rb @@ -25,7 +25,15 @@ module Octopress end def path - File.join(@config['source'], "#{@options['path']}.#{extension}") + file = @options['path'] + + # If path ends with a slash, make it an index + file << "index" if file =~ /\/$/ + + # if path has no extension, add the default extension + file << ".#{extension}" unless file =~ /\.\w+$/ + + File.join(@config['source'], file) end def extension
Improved new page command. Now trailing slashes create index pages.
octopress_octopress
train
rb
a091d39f0ddc6543b8572c5781a5fd8b181bc45a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ lint_requires = [ ] doc_requires = [ - 'mkdocs', + 'mkdocs==1.1', 'mkdocs-material', 'mkdocstrings==0.15.0' ]
pin mkdocs to avoid build issue with <I>
planetlabs_planet-client-python
train
py
eb7f29e9a6a28859af6dd6e71725864875caaf03
diff --git a/test/conftest.py b/test/conftest.py index <HASH>..<HASH> 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -87,8 +87,8 @@ def rabbit_config(request, rabbit_manager): conf['vhost'] = vhost conf['username'] = username - reset_rabbit_vhost(vhost, username, rabbit_manager) reset_rabbit_connections(vhost, rabbit_manager) + reset_rabbit_vhost(vhost, username, rabbit_manager) yield conf diff --git a/test/test_queue_consumer.py b/test/test_queue_consumer.py index <HASH>..<HASH> 100644 --- a/test/test_queue_consumer.py +++ b/test/test_queue_consumer.py @@ -279,8 +279,12 @@ def test_prefetch_count(rabbit_manager, rabbit_config): queue_consumer1.unregister_provider(handler1) queue_consumer2.unregister_provider(handler2) + queue_consumer1.stop() + queue_consumer2.stop() + def test_kill_closes_connections(rabbit_manager, rabbit_config): + container = Mock() container.config = rabbit_config container.max_workers = 1
reset rabbit connections before the vhost; stop queueconsumers before resetting connections (avoiding bugs documented here <URL>)
nameko_nameko
train
py,py
6da5797b922709bb0aa1d6325f0f3817810347ec
diff --git a/src/require/javascript.js b/src/require/javascript.js index <HASH>..<HASH> 100644 --- a/src/require/javascript.js +++ b/src/require/javascript.js @@ -124,6 +124,10 @@ _gpfRequireProcessor[".js"] = function (resourceName, content) { var wrapper = _gpfRequireWrapGpf(this, resourceName); return _gpfRequireJSGetStaticDependencies.call(this, resourceName, content) .then(function (staticDependencies) { - return _gpfRequireJS(wrapper.gpf, content, staticDependencies) || wrapper.promise; + var exports = _gpfRequireJS(wrapper.gpf, content, staticDependencies); + if (undefined === exports) { + return wrapper.promise; + } + return exports; }); };
Exports might be a falsy value, improves switch (#<I>)
ArnaudBuchholz_gpf-js
train
js
2df9c9aa5070d4847f411166bc3e219e51ef0f67
diff --git a/nblr/src/main/java/jlibs/nblr/codegen/java/JavaCodeGenerator.java b/nblr/src/main/java/jlibs/nblr/codegen/java/JavaCodeGenerator.java index <HASH>..<HASH> 100644 --- a/nblr/src/main/java/jlibs/nblr/codegen/java/JavaCodeGenerator.java +++ b/nblr/src/main/java/jlibs/nblr/codegen/java/JavaCodeGenerator.java @@ -681,16 +681,9 @@ public class JavaCodeGenerator extends CodeGenerator{ ); } - String keyWord, suffix; - if(booleanProperty(HANDLER_IS_CLASS)){ - keyWord = "class"; - suffix = "implements"; - }else{ - keyWord = "interface"; - suffix = " extends "; - } + String keyWord = booleanProperty(HANDLER_IS_CLASS) ? "class" : "interface"; printer.printlns( - "public "+keyWord+" "+className[1]+"<E extends Exception>"+suffix+"<E>{", + "public "+keyWord+" "+className[1]+"<E extends Exception>{", PLUS ); }
generated consumer class/interface doesn't extend/implement anything
santhosh-tekuri_jlibs
train
java
d681ad65267e453364eb498f91cf5811e489c1ec
diff --git a/scout_apm/core_agent_manager.py b/scout_apm/core_agent_manager.py index <HASH>..<HASH> 100644 --- a/scout_apm/core_agent_manager.py +++ b/scout_apm/core_agent_manager.py @@ -91,9 +91,9 @@ class CoreAgentManager: subprocess.Popen( [ executable, 'daemon', - '--api-key', 'Qnk5SKpNEeboPdeJkhae', - '--log-level', 'info', - '--app-name', 'CoreAgent', + '--api-key', self.api_key(), + '--log-level', self.log_level(), + '--app-name', self.app_name(), '--socket', self.socket_path() ]) @@ -101,6 +101,15 @@ class CoreAgentManager: print('Socket path', agent_context.config.value('socket_path')) return agent_context.config.value('socket_path') + def log_level(self): + return 'debug' + + def app_name(self): + return 'CoreAgent' + + def api_key(self): + return 'Qnk5SKpNEeboPdeJkhae' + def atexit(self, directory): print('Atexit shutting down agent') CoreAgentProbe().shutdown()
Extract functions for args to CoreAgent
scoutapp_scout_apm_python
train
py
0b4fcbb58d99637f67a1abbead3c38e208d535d1
diff --git a/nodeserver.js b/nodeserver.js index <HASH>..<HASH> 100755 --- a/nodeserver.js +++ b/nodeserver.js @@ -52,6 +52,20 @@ module.exports = exports = new function() { } } } + + //double check with regex + for(var i = 0; i < websitesCount; i++) { + var website = this.websites[i]; + var bindingsCount = website.bindings.length; + + for(var j = 0; j < bindingsCount; j++) { + var regex = new RegExp(website.bindings[j], "gi") + + if(regex.test(url)) { + return website; + } + } + } } @@ -72,7 +86,10 @@ module.exports = exports = new function() { this.config = JSON.parse(config); for(var i = 0; i < this.config.sites.length; i++) { - this.addWebsite(this.config.sites[i]); + var site = this.config.sites[i]; + + site.id = site.id || site.bindings[0]; + this.addWebsite(site); } if(this.config.nodeserver.admin.active) {
new regex double check and added id to site object
altairstudios_nodeserver
train
js
e389c211863d9f01ea1f14535740e21e991039b5
diff --git a/url.go b/url.go index <HASH>..<HASH> 100644 --- a/url.go +++ b/url.go @@ -48,9 +48,9 @@ func NewURL(ref string) (*url.URL, error) { } func ConvertGitURLHTTPToSSH(url *url.URL) (*url.URL, error) { - user := url.User.Username() - if user == "" { - user = "git" + user := "git"; + if url.User != nil { + user = url.User.Username() } sshURL := fmt.Sprintf("ssh://%s@%s%s", user, url.Host, url.Path) return url.Parse(sshURL)
Fix nil pointer dereference on older Go versions
motemen_ghq
train
go
c8a1fd5fc74e0b7b45c9ecc748fdc15717b7e2ae
diff --git a/src/layout/Force.js b/src/layout/Force.js index <HASH>..<HASH> 100644 --- a/src/layout/Force.js +++ b/src/layout/Force.js @@ -16,9 +16,9 @@ var FORCE_MAP = map() .set('y', forceY); var FORCES = 'forces', - PARAMS = ['alpha', 'alphaMin', 'alphaTarget', 'drag', 'forces'], + PARAMS = ['alpha', 'alphaMin', 'alphaTarget', 'velocityDecay', 'drag', 'forces'], CONFIG = ['static', 'iterations'], - FIELDS = ['x', 'y', 'vx', 'vy']; + FIELDS = ['x', 'y', 'vx', 'vy', 'fx', 'fy']; /** * Force simulation layout. @@ -51,8 +51,8 @@ prototype.transform = function(_, pulse) { // fix / unfix nodes as needed if (_.modified('fixed')) { - sim.unfixAll(); - array(_.fixed).forEach(function(t) { sim.fix(t); }); + sim.nodes().forEach(function(t) { t.fx = null; t.fy = null; }); + array(_.fixed).forEach(function(t) { t.fx = t.x; t.fy = t.y; }); } // run simulation
Update Force to d3-force <I> API.
vega_vega-dataflow
train
js
2e5c15f3761fa3edc9fad7777a34eca4f09a5361
diff --git a/internetarchive/cli/ia_upload.py b/internetarchive/cli/ia_upload.py index <HASH>..<HASH> 100644 --- a/internetarchive/cli/ia_upload.py +++ b/internetarchive/cli/ia_upload.py @@ -237,6 +237,9 @@ def main(argv, session): local_file.seek(0) else: local_file = args['<file>'] + # Properly expand a period to the contents of the current working directory. + if local_file and local_file[0] == '.': + local_file = os.listdir('.') if isinstance(local_file, (list, tuple, set)) and args['--remote-name']: local_file = local_file[0]
Expand a period to the contents of the current directory. The previous behavior when specifying a period as a wildcard was faulty. Now a period is properly expanded to the contents of the current directory. ia_upload.py seemed to be the most sensible location for this fix, since it is the closest to receiving the path and so that the behavior of the library does not change. Closes #<I>, fixes #<I>.
jjjake_internetarchive
train
py
bd8542b8aa3bb6a87b9abbade84b278b3caed2d7
diff --git a/logentry/logentry.go b/logentry/logentry.go index <HASH>..<HASH> 100644 --- a/logentry/logentry.go +++ b/logentry/logentry.go @@ -31,6 +31,8 @@ type Response struct { type Body struct { ElapsedTime int `json:"elapsedTime"` Date int `json:"date"` + Index string `json:"index"` + Type string `json:"type"` Request Request `json:"request"` Response Response `json:"response"` } @@ -59,6 +61,6 @@ func New(indexPrefix, typeName, JobType, WorkerName string, Code, ElapsedTime in response := Response{Metadata: responseMetadata} Date := int((now.UnixNano() / 1000000)) - ElapsedTime - body := Body{Request: request, Response: response, ElapsedTime: ElapsedTime, Date: Date} + body := Body{Request: request, Response: response, ElapsedTime: ElapsedTime, Date: Date, Index: index, Type: typeName} return &LogEntry{Index: index, Type: typeName, Body: body} } diff --git a/logentry/version.go b/logentry/version.go index <HASH>..<HASH> 100644 --- a/logentry/version.go +++ b/logentry/version.go @@ -1,4 +1,4 @@ package logentry // VERSION is the current library Version -var VERSION = "1.1.0" +var VERSION = "1.2.0"
<I> Add index and type to logentry body
octoblu_go-logentry
train
go,go
680efb6c3ff9f904fd4aed228b53c6d2d0434ec9
diff --git a/src/comfy.js b/src/comfy.js index <HASH>..<HASH> 100644 --- a/src/comfy.js +++ b/src/comfy.js @@ -11,7 +11,7 @@ * @class */ function Comfy(env) { - this.env = env; + this._env = env; } /** @@ -74,13 +74,13 @@ Comfy.prototype.property = function (name, options) { var opts = this.withOptions(options); var envName = this.nameToEnvKey(name); - var envValue = this.env[envName]; + var envValue = this._env[envName]; if (typeof envValue === "undefined") { if (opts.optional) { envValue = opts.defaultValue; } else { - throw "Required property " + envName + " not present in env:" + this.env; + throw "Required property " + envName + " not present in env:" + this._env; } }
Rename internal env property to _env to reduce chance of collisions
filp_comfy
train
js
27f62432f56c808d7c83ffaaa529a2ad1b1c2140
diff --git a/src/python/grpcio/setup.py b/src/python/grpcio/setup.py index <HASH>..<HASH> 100644 --- a/src/python/grpcio/setup.py +++ b/src/python/grpcio/setup.py @@ -146,7 +146,7 @@ TEST_PACKAGE_DATA = { TESTS_REQUIRE = ( 'oauth2client>=1.4.7', - 'protobuf==3.0.0a3', + 'protobuf>=3.0.0a3', 'coverage>=4.0', ) + INSTALL_REQUIRES
Remove ceiling on required protobuf version This is possible now that <URL>.
grpc_grpc
train
py
7639efff2626d3545bd9bbe443bb03466fd2093a
diff --git a/src/base/Response.php b/src/base/Response.php index <HASH>..<HASH> 100644 --- a/src/base/Response.php +++ b/src/base/Response.php @@ -23,6 +23,15 @@ class Response extends Component */ public $exitStatus = 0; + /** + * @var Application + */ + protected $app; + + public function __construct(Application $app) + { + $this->app = $app; + } /** * Sends the response to client.
Added app with DI to `Response`
yiisoft_yii-core
train
php
74bd543a631a51a342185cbcb50e31369dd1f262
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -8,7 +8,7 @@ var webpack = require('webpack-stream'); var del = require('del'); var runSequence = require('run-sequence'); -gulp.task('default', ['spec']); +gulp.task('default', ['ci']); function testAssetsStream(watch) { return gulp.src(['spec/**/*_spec.js'])
change default task to one that actually makes sense
atomanyih_spy-on-render
train
js
cd9230f9c0bf16f8725493037804d9dbb9d4b39d
diff --git a/lib/Model-rest.js b/lib/Model-rest.js index <HASH>..<HASH> 100644 --- a/lib/Model-rest.js +++ b/lib/Model-rest.js @@ -20,7 +20,7 @@ module.exports = function(Model,options){ } var isEmpty = function(obj){ - return !Object.keys(obj).length; + return !obj || !Object.keys(obj).length; }; var handleResponse = function(err,res,callback,type){
fix exception when trying to check an empty object
misejs_Model-rest
train
js
07c979aef544de47e23deec3e889ae5340c168cb
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup(name='pyscroll', author='bitcraft', author_email='leif.theden@gmail.com', packages=['pyscroll', 'tests'], - install_requires=['pygame', 'six'], + install_requires=['six'], license='LGPLv3', long_description='see README.md', package_data={
remove pygame from deps, as it causes problems on some windows systems.
bitcraft_pyscroll
train
py
1aaf23d9dddd526d003595e6a5f520359035d4c4
diff --git a/admin/test/spec/controllers/inspectionCtrl.js b/admin/test/spec/controllers/inspectionCtrl.js index <HASH>..<HASH> 100644 --- a/admin/test/spec/controllers/inspectionCtrl.js +++ b/admin/test/spec/controllers/inspectionCtrl.js @@ -20,14 +20,15 @@ describe('Controller: inspectionCtrl', function () { then: function (cb) { cb(new Inspection(id, {'foo': 'bar'})); } - } + }; } }; inspectionCtrl = $controller('inspectionCtrl', { $scope: scope, $routeParams: {inspectionId: 123}, - $inspectionsRepository: $inspectionsRepository + $inspectionsRepository: $inspectionsRepository, + RDT_REPORTS: {'report-name': 'report/script/path.html'} }); })); @@ -36,4 +37,8 @@ describe('Controller: inspectionCtrl', function () { expect(scope.inspection.id).toBe(123); expect(scope.inspection.data.foo).toBe('bar'); }); + + it('should load the reports map in the scope', function () { + expect(scope.reports).toEqual({'report-name': 'report/script/path.html'}); + }); });
Expecting reports map to be filled in the scope of the `inspectionCtrl`
Roave_RoaveDeveloperTools
train
js
5b1b5086934b90d3369b0bc04654bbb03d550ec1
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java index <HASH>..<HASH> 100644 --- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java +++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java @@ -625,7 +625,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration try { final Client client = cluster.connect(name.getMethodName()); - final ResultSet first = client.submit("Thread.sleep(5000);g.V().fold().coalesce(unfold(), g.addV('person'))"); + final ResultSet first = client.submit("Thread.sleep(5000);g.V().fold().coalesce(unfold(), __.addV('person'))"); final ResultSet second = client.submit("g.V().count()"); final CompletableFuture<List<Result>> futureFirst = first.all();
Use anonymous traversal for child in test CTR
apache_tinkerpop
train
java
4eeebe56bddf741b9165344ccf9ef9043b0e0de0
diff --git a/fedmsg/consumers/ircbot.py b/fedmsg/consumers/ircbot.py index <HASH>..<HASH> 100644 --- a/fedmsg/consumers/ircbot.py +++ b/fedmsg/consumers/ircbot.py @@ -231,7 +231,6 @@ class IRCBotConsumer(FedmsgConsumer): if f and re.search(f, topic): return False for f in filters.get('body', []): - type(msg) if f and re.search(f, str(msg)): return False return True
Remove old debug artifact.
fedora-infra_fedmsg
train
py
38133745b8d45047a7851393b681004f2113aa5f
diff --git a/contrib/parseq-restli-client/src/main/java/com/linkedin/restli/client/ParSeqRestClientBuilder.java b/contrib/parseq-restli-client/src/main/java/com/linkedin/restli/client/ParSeqRestClientBuilder.java index <HASH>..<HASH> 100644 --- a/contrib/parseq-restli-client/src/main/java/com/linkedin/restli/client/ParSeqRestClientBuilder.java +++ b/contrib/parseq-restli-client/src/main/java/com/linkedin/restli/client/ParSeqRestClientBuilder.java @@ -50,7 +50,7 @@ public class ParSeqRestClientBuilder { return this; } - public ParSeqRestClientBuilder setInboundRequestFinder(InboundRequestContextFinder inboundRequestContextFinder) { + public ParSeqRestClientBuilder setInboundRequestContextFinder(InboundRequestContextFinder inboundRequestContextFinder) { ArgumentUtil.requireNotNull(inboundRequestContextFinder, "inboundRequestContextFinder"); _inboundRequestContextFinder = inboundRequestContextFinder; return this;
renamed setInboundRequestFinder to setInboundRequestContextFinder
linkedin_parseq
train
java
f71888da92a796336ee974661fcd6c310256748e
diff --git a/airflow/models.py b/airflow/models.py index <HASH>..<HASH> 100644 --- a/airflow/models.py +++ b/airflow/models.py @@ -826,6 +826,7 @@ class TaskInstance(Base): successes, skipped, failed, upstream_failed, done = qry.first() upstream = len(task._upstream_list) tr = task.trigger_rule + upstream_done = done >= upstream # handling instant state assignment based on trigger rules if flag_upstream_failed: @@ -838,10 +839,10 @@ class TaskInstance(Base): if successes or skipped: self.set_state(State.SKIPPED) elif tr == TR.ONE_SUCCESS: - if done >= upstream and not successes: + if upstream_done and not successes: self.set_state(State.SKIPPED) elif tr == TR.ONE_FAILED: - if successes or skipped: + if upstream_done and not(failed or upstream_failed): self.set_state(State.SKIPPED) if ( @@ -849,7 +850,7 @@ class TaskInstance(Base): (tr == TR.ONE_FAILED and (failed or upstream_failed)) or (tr == TR.ALL_SUCCESS and successes >= upstream) or (tr == TR.ALL_FAILED and failed + upstream_failed >= upstream) or - (tr == TR.ALL_DONE and done >= upstream) + (tr == TR.ALL_DONE and upstream_done) ): return True
Fixing bad ONE_FAILED in recent PR
apache_airflow
train
py
6e933604fb86ac22e6d71309fa29f600ab022fae
diff --git a/src/lib/DocSearch.js b/src/lib/DocSearch.js index <HASH>..<HASH> 100644 --- a/src/lib/DocSearch.js +++ b/src/lib/DocSearch.js @@ -36,6 +36,7 @@ class DocSearch { appId = 'BH4D9OD16A', debug = false, algoliaOptions = {}, + queryDataCallback = null, autocompleteOptions = { debug: false, hint: false, @@ -53,6 +54,7 @@ class DocSearch { inputSelector, debug, algoliaOptions, + queryDataCallback, autocompleteOptions, transformData, queryHook, @@ -66,6 +68,7 @@ class DocSearch { this.indexName = indexName; this.input = DocSearch.getInputFromSelector(inputSelector); this.algoliaOptions = { hitsPerPage: 5, ...algoliaOptions }; + this.queryDataCallback = queryDataCallback || null; const autocompleteOptionsDebug = autocompleteOptions && autocompleteOptions.debug ? autocompleteOptions.debug @@ -214,6 +217,9 @@ class DocSearch { }, ]) .then(data => { + if (this.queryDataCallback && typeof this.queryDataCallback == "function") { + this.queryDataCallback(data) + } let hits = data.results[0].hits; if (transformData) { hits = transformData(hits) || hits;
implement query data callback method into src (#<I>)
algolia_docsearch
train
js
594cb1a6cd27829fcfbdf5ea3c068a6e67fcaac5
diff --git a/activiti-cycle/src/main/java/org/activiti/cycle/impl/connector/signavio/SignavioConnector.java b/activiti-cycle/src/main/java/org/activiti/cycle/impl/connector/signavio/SignavioConnector.java index <HASH>..<HASH> 100644 --- a/activiti-cycle/src/main/java/org/activiti/cycle/impl/connector/signavio/SignavioConnector.java +++ b/activiti-cycle/src/main/java/org/activiti/cycle/impl/connector/signavio/SignavioConnector.java @@ -706,7 +706,7 @@ public class SignavioConnector extends AbstractRepositoryConnector implements Si sendRequest(jsonRequest); // TODO: return the object - return getRepositoryArtifact(id); + return getRepositoryArtifact("/"+id); } catch (Exception je) { throw new RepositoryException("Unable to create model '" + artifactName + "' in parent folder '" + parentFolderId + "'", je); }
Fixed Problem with SignavioConnector returning wrong id
camunda_camunda-bpm-platform
train
java
98b0d91d091b554cb3ab9ed9f972d358c7cae01a
diff --git a/src/core/lombok/ToString.java b/src/core/lombok/ToString.java index <HASH>..<HASH> 100644 --- a/src/core/lombok/ToString.java +++ b/src/core/lombok/ToString.java @@ -64,7 +64,7 @@ public @interface ToString { * Include the result of the superclass's implementation of {@code toString} in the output. * <strong>default: false</strong> * - * @return Whether to call the superclass's {@code equals} implementation as part of the generated equals algorithm. + * @return Whether to call the superclass's {@code toString} implementation as part of the generated equals algorithm. */ boolean callSuper() default false;
fix JavaDoc of callSuper in the ToString annotation
rzwitserloot_lombok
train
java
6a44a79922846897ad3c374d262a04aee9d1beeb
diff --git a/src/UserManager.js b/src/UserManager.js index <HASH>..<HASH> 100644 --- a/src/UserManager.js +++ b/src/UserManager.js @@ -406,7 +406,10 @@ export class UserManager extends OidcClient { if (postLogoutRedirectUri){ args.post_logout_redirect_uri = postLogoutRedirectUri; } - return this._signoutStart(args, this._redirectNavigator).then(()=>{ + let navParams = { + useReplaceToNavigate : args.useReplaceToNavigate + }; + return this._signoutStart(args, this._redirectNavigator, navParams).then(()=>{ Log.info("UserManager.signoutRedirect: successful"); }); }
Pass navigator params for signout to allow for useReplaceToNavigate flag #<I>
IdentityModel_oidc-client-js
train
js
48da244058eac217aed80d59583fb77cc276bd96
diff --git a/spacy/cli/converters/conllu2json.py b/spacy/cli/converters/conllu2json.py index <HASH>..<HASH> 100644 --- a/spacy/cli/converters/conllu2json.py +++ b/spacy/cli/converters/conllu2json.py @@ -2,6 +2,7 @@ from __future__ import unicode_literals import json +from ...compat import json_dumps from ... import util @@ -29,7 +30,8 @@ def conllu2json(input_path, output_path, n_sents=10, use_morphology=False): output_filename = input_path.parts[-1].replace(".conllu", ".json") output_file = output_path / output_filename - json.dump(docs, output_file.open('w', encoding='utf-8'), indent=2) + with output_file.open('w', encoding='utf-8') as f: + f.write(json_dumps(docs)) util.print_msg("Created {} documents".format(len(docs)), title="Generated output file {}".format(output_file))
Use spacy.compat.json_dumps for Python 2/3 compatibility (resolves #<I>)
explosion_spaCy
train
py
dce782953316d4adc3fb62ef24cbed0c5da5b51d
diff --git a/src/DM/AjaxCom/Resources/public/js/ajaxcom.js b/src/DM/AjaxCom/Resources/public/js/ajaxcom.js index <HASH>..<HASH> 100644 --- a/src/DM/AjaxCom/Resources/public/js/ajaxcom.js +++ b/src/DM/AjaxCom/Resources/public/js/ajaxcom.js @@ -2,6 +2,15 @@ // https://github.com/advertize/AjaxCom (function($) { "use strict"; + + $.event.props.push('state'); + $(window).on('popstate.ajaxcom', function(event) { + if (typeof event.state === 'object' && event.state !== null) { + window.location.reload(); + } + }); + window.history.replaceState({}, null); + // Intercept click and submit events and perform an ajax request then // handle instructions returned // @@ -157,12 +166,12 @@ switch (options.method) { case 'push': setTimeout(function() { - window.history.pushState(null, null, options.url); + window.history.pushState({}, null, options.url); }, options.wait); break; case 'replace': setTimeout(function() { - window.history.replaceState(null, null, options.url); + window.history.replaceState({}, null, options.url); }, options.wait); break; case 'redirect':
Force back/forward buttons to reload the page
everlutionsk_AjaxCom
train
js
8a7440eae6dcdfa12315ce3f5ea5f7ebd5b26d5e
diff --git a/cdn/types.go b/cdn/types.go index <HASH>..<HASH> 100644 --- a/cdn/types.go +++ b/cdn/types.go @@ -9,7 +9,7 @@ import ( const ( Web = "web" Download = "download" - video = "video" + Video = "video" LiveStream = "liveStream" Ipaddr = "ipaddr" Domain = "domain" @@ -27,7 +27,7 @@ const ( AccessControlMaxAge = "Access-Control-Max-Age" ) -var CdnTypes = []string{Web, Download, video, LiveStream} +var CdnTypes = []string{Web, Download, Video, LiveStream} var SourceTypes = []string{Ipaddr, Domain, OSS} var Scopes = []string{Domestic, Overseas, Global} var HeaderKeys = []string{ContentType, CacheControl, ContentDisposition, ContentLanguage, Expires, AccessControlAllowMethods, AccessControlAllowOrigin, AccessControlMaxAge}
make the variable Video visable outside the package
denverdino_aliyungo
train
go
cf95dc9eab3ca59c2b47aa44a58ee88e5bd51640
diff --git a/casacore/functionals/functional.py b/casacore/functionals/functional.py index <HASH>..<HASH> 100644 --- a/casacore/functionals/functional.py +++ b/casacore/functionals/functional.py @@ -146,7 +146,7 @@ class functional(_functional): if len(retval) == n: return numpy.array(retval) return numpy.array(retval).reshape(self.npar() + 1, - n / self.ndim()).transpose() + n // self.ndim()).transpose() def add(self, other): if not isinstance(other, functional): diff --git a/tests/test_functionals.py b/tests/test_functionals.py index <HASH>..<HASH> 100644 --- a/tests/test_functionals.py +++ b/tests/test_functionals.py @@ -1,5 +1,5 @@ import unittest2 as unittest -from pyrap.functionals import * +from casacore.functionals import * class TestFunctionals(unittest.TestCase):
fixed the integer division bug in functionals
casacore_python-casacore
train
py,py
6417e3871746d3859c98bb03a94c5ac8f0b34ee6
diff --git a/httprunner/models.py b/httprunner/models.py index <HASH>..<HASH> 100644 --- a/httprunner/models.py +++ b/httprunner/models.py @@ -124,7 +124,7 @@ class RequestData(BaseModel): url: Url headers: Headers = {} cookies: Cookies = {} - body: Union[Text, bytes, Dict, List, None] = {} + body: Union[Text, bytes, List, Dict, None] = {} class ResponseData(BaseModel): @@ -133,7 +133,7 @@ class ResponseData(BaseModel): cookies: Cookies encoding: Union[Text, None] = None content_type: Text - body: Union[Text, bytes, Dict, List] + body: Union[Text, bytes, List, Dict] class ReqRespData(BaseModel):
fix:resolved list read error caused by Pydantic.BaseModel #<I>
HttpRunner_HttpRunner
train
py
94920203582be308d8586ceca2d46a37efa29006
diff --git a/src/cartesian/Area.js b/src/cartesian/Area.js index <HASH>..<HASH> 100644 --- a/src/cartesian/Area.js +++ b/src/cartesian/Area.js @@ -50,7 +50,6 @@ class Area extends Component { PropTypes.func, PropTypes.element, PropTypes.object, PropTypes.bool, ]), hide: PropTypes.bool, - // have curve configuration layout: PropTypes.oneOf(['horizontal', 'vertical']), baseLine: PropTypes.oneOfType([ diff --git a/src/chart/LineChart.js b/src/chart/LineChart.js index <HASH>..<HASH> 100644 --- a/src/chart/LineChart.js +++ b/src/chart/LineChart.js @@ -5,4 +5,3 @@ import generateCategoricalChart from './generateCategoricalChart'; import Line from '../cartesian/Line'; export default generateCategoricalChart('LineChart', Line); -
feat: add props `hide` for each graphic Component
recharts_recharts
train
js,js
9a26e91d4731b40d75842ad979bfd93934a32419
diff --git a/alot/buffers.py b/alot/buffers.py index <HASH>..<HASH> 100644 --- a/alot/buffers.py +++ b/alot/buffers.py @@ -5,7 +5,7 @@ import widgets import settings import commands from walker import PipeWalker -from message import decode_header +from helper import shorten_author_string class Buffer(object): @@ -86,7 +86,8 @@ class EnvelopeBuffer(Buffer): Buffer.__init__(self, ui, self.body, 'envelope') def __str__(self): - return "to: %s" % decode_header(self.mail['To']) + to = self.envelope.get('To', fallback='unset') + return "to: %s" % shorten_author_string(to, 400) def get_email(self): return self.mail
EnvelopeBuffer statusline love use unencoded recipient string from envelope for EnvelopeBuffers statusline and shorten it using helper.shorten_authors_string.
pazz_alot
train
py