<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def marginalize_out(node_indices, tpm):
 """Marginalize out nodes from a TPM. Args: node_indices (list[int]):
 The indices of nodes to be marginalized out. tpm (np.ndarray):
 The TPM to marginalize the node out of. Returns: np.ndarray: A TPM with the same number of dimensions, with the nodes marginalized out. """

    return tpm.sum(tuple(node_indices), keepdims=True) / (
        np.array(tpm.shape)[list(node_indices)].prod())