<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def labels(indices, node_labels=None):
 """Get the labels for a tuple of mechanism indices."""

    if node_labels is None:
        return tuple(map(str, indices))
    return node_labels.indices2labels(indices)