<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run_tpm(tpm, time_scale):
 """Iterate a TPM by the specified number of time steps. Args: tpm (np.ndarray):
 A state-by-node tpm. time_scale (int):
 The number of steps to run the tpm. Returns: np.ndarray """

    sbs_tpm = convert.state_by_node2state_by_state(tpm)
    if sparse(tpm):
        tpm = sparse_time(sbs_tpm, time_scale)
    else:
        tpm = dense_time(sbs_tpm, time_scale)
    return convert.state_by_state2state_by_node(tpm)