def _get_partners(node_index, part_nodes):
    """
    Returns the left, right and far partners of the node whose index is equal
    to the given node_index.

    :param node_index: the primary index
    :param part_nodes: a list of primary nodes
    :returns: [<node-to-left>, <node-to-right>, <node-opposite>]
    """
    num_nodes = len(part_nodes)
    return [part_nodes[(node_index - 1) % num_nodes], part_nodes[(
        node_index + 1) % num_nodes], part_nodes[(node_index + num_nodes //
        2) % num_nodes]]
