You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: keys.go
    path of file: ./repos/cosmos-sdk/x/staking/migrations/v5
    
    the code of the file until where you have to start completion: package v5

import (
	"bytes"
	"encoding/binary"
	"fmt"
	"strconv"

	sdk "github.com/cosmos/cosmos-sdk/types"
	"github.com/cosmos/cosmos-sdk/types/address"
)

const (
	// ModuleName is the name of the module
	ModuleName = "staking"
)

var (
	DelegationKey           = []byte{0x31} // key for a delegation
	HistoricalInfoKey       = []byte{0x50} // prefix for the historical info
	DelegationByValIndexKey = []byte{0x71} // key for delegations by a validator

)

// ParseDelegationKey parses given key and returns delagator, validator address bytes
func ParseDelegationKey(bz []byte) (sdk.AccAddress, sdk.ValAddress, error) {
	prefixLength := len(DelegationKey)
	if prefix :
    
func ParseDelegationsByValKey(bz []byte) (sdk.ValAddress, sdk.AccAddress, error) {
	prefixLength := len(DelegationByValIndexKey)
	if prefix := bz[:prefixLength]; !bytes.Equal(prefix, DelegationByValIndexKey) {
		return nil, nil, fmt.Errorf("invalid prefix; expected: %X, got: %x", DelegationByValIndexKey, prefix)
	}

	bz = bz[prefixLength:] // remove the prefix byte
	if len(bz) == 0 {
		return nil, nil, fmt.Errorf("no bytes left to parse: %X", bz)
	}

	valAddrLen := bz[0]
	bz = bz[1:] // remove the length byte of validator address.
	if len(bz) == 0 {
		return nil, nil, fmt.Errorf("no bytes left to parse validator address: %X", bz)
	}

	val := bz[0:int(valAddrLen)]

	bz = bz[int(valAddrLen):] // remove the delegator bytes
	if len(bz) == 0 {
		return nil, nil, fmt.Errorf("no bytes left to parse delegator address: %X", bz)
	}

	del := bz

	return val, del, nil
}