def METHOD_NAME(spec,
                                       state,
                                       shard_lateness=None,
                                       shard=None,
                                       validator_index=None,
                                       block_lengths=None,
                                       slashing_message_data=None,
                                       correct=True,
                                       valid=True):
    transition_to(spec, state, state.slot + 1)  # Make len(offset_slots) == 1
    if shard_lateness is None:
        shard_lateness = spec.SLOTS_PER_EPOCH
    transition_to(spec, state, state.slot + shard_lateness)
    if shard is None:
        shard = 0
    if validator_index is None:
        validator_index = spec.get_beacon_committee(state, state.slot, shard)[0]
    offset_slots = spec.get_offset_slots(state, shard)
    if block_lengths is None:
        block_lengths = [2**15 // 3] * len(offset_slots)
    custody_secret = spec.get_custody_secret(
        state,
        validator_index,
        privkeys[validator_index],
        spec.get_current_epoch(state),
    )
    shard_transition, slashable_test_vector = get_custody_slashable_shard_transition(
        spec,
        state.slot,
        block_lengths,
        custody_secret,
        slashable=correct,
    )
    attestation = get_valid_attestation(spec, state, index=shard, signed=True,
                                        shard_transition=shard_transition)
    transition_to(spec, state, state.slot + spec.MIN_ATTESTATION_INCLUSION_DELAY)
    _, _, _ = run_attestation_processing(spec, state, attestation)
    transition_to(spec, state, state.slot + spec.SLOTS_PER_EPOCH * (spec.EPOCHS_PER_CUSTODY_PERIOD - 1))
    slashing = get_valid_custody_slashing(spec, state, attestation, shard_transition,
                                          custody_secret, slashable_test_vector)
    if slashing_message_data is not None:
        slashing.message.data = slashing_message_data
    yield from run_custody_slashing_processing(spec, state, slashing, valid=valid, correct=correct)