def METHOD_NAME(spec, state, chunk_challenge, challenge_index,
                                     block_length_or_custody_data,
                                     invalid_chunk_data=False):
    if isinstance(block_length_or_custody_data, int):
        custody_data = get_custody_test_vector(block_length_or_custody_data)
    else:
        custody_data = block_length_or_custody_data
    custody_data_block = ByteList[spec.MAX_SHARD_BLOCK_SIZE](custody_data)
    chunks = custody_chunkify(spec, custody_data_block)
    chunk_index = chunk_challenge.chunk_index
    leaf_index = chunk_index + 2**spec.CUSTODY_RESPONSE_DEPTH
    serialized_length = len(custody_data_block).to_bytes(32, 'little')
    data_branch = build_proof(custody_data_block.get_backing().get_left(), leaf_index) + [serialized_length]
    return spec.CustodyChunkResponse(
        challenge_index=challenge_index,
        chunk_index=chunk_index,
        chunk=chunks[chunk_index],
        branch=data_branch,
    )