def METHOD_NAME(
    remote_command_executor,
    scheduler_commands,
    slots_per_instance,
    scheduler,
    hyperthreading_disabled=True,
    partition=None,
    default_threads_per_core=2,
):
    expected_cpus_per_instance = (
        slots_per_instance // default_threads_per_core if hyperthreading_disabled else slots_per_instance
    )
    expected_threads_per_core = 1 if hyperthreading_disabled else default_threads_per_core
    # Test disable hyperthreading on head node
    logging.info("Test Disable Hyperthreading on head node")
    result = remote_command_executor.run_remote_command("lscpu")
    if partition:
        # If partition is supplied, assume this is HIT setting where ht settings are at the queue level
        # In this case, ht is not disabled on head node
        assert_that(result.stdout).matches(r"Thread\(s\) per core:\s+{0}".format(default_threads_per_core))
        _assert_active_cpus(result.stdout, slots_per_instance)
    else:
        assert_that(result.stdout).matches(r"Thread\(s\) per core:\s+{0}".format(expected_threads_per_core))
        _assert_active_cpus(result.stdout, expected_cpus_per_instance)
    # Test disable hyperthreading on Compute
    logging.info("Test Disable Hyperthreading on Compute")
    if partition:
        result = scheduler_commands.submit_command("lscpu > /shared/lscpu.out", partition=partition)
    else:
        result = scheduler_commands.submit_command("lscpu > /shared/lscpu.out")
    job_id = scheduler_commands.assert_job_submitted(result.stdout)
    scheduler_commands.wait_job_completed(job_id)
    scheduler_commands.assert_job_succeeded(job_id)
    # Check compute has 1 thread per core
    result = remote_command_executor.run_remote_command("cat /shared/lscpu.out")
    assert_that(result.stdout).matches(r"Thread\(s\) per core:\s+{0}".format(expected_threads_per_core))
    _assert_active_cpus(result.stdout, expected_cpus_per_instance)
    # Check scheduler has correct number of cores
    if partition:
        result = scheduler_commands.get_node_cores(partition=partition)
    else:
        result = scheduler_commands.get_node_cores()
    logging.info("{0} Cores: [{1}]".format(scheduler, result))
    assert_that(int(result)).is_equal_to(expected_cpus_per_instance)
    if hyperthreading_disabled:
        # check scale up to 2 nodes
        if partition:
            result = scheduler_commands.submit_command(
                "hostname > /shared/hostname.out", slots=2 * expected_cpus_per_instance, partition=partition
            )
        else:
            result = scheduler_commands.submit_command(
                "hostname > /shared/hostname.out", slots=2 * expected_cpus_per_instance
            )
        job_id = scheduler_commands.assert_job_submitted(result.stdout)
        scheduler_commands.wait_job_completed(job_id)
        scheduler_commands.assert_job_succeeded(job_id)
        if partition:
            assert_that(scheduler_commands.compute_nodes_count(filter_by_partition=partition)).is_equal_to(2)
        else:
            assert_that(scheduler_commands.compute_nodes_count()).is_equal_to(2)