def get_mechanism_id(mechanism):
    """
    Function to return the mechanism id of the passed mechanism object.  Used
    to sort the list of failure mechanism objects before loading into the
    gtk.TreeView().

    :param mechanism: the :py:class:`rtk.analyses.pof.Mechanism.Model` to
                      return the mechanism id for.
    :return mechanism_id: the mechanism id of the passed mechanism object.
    :rtype: int
    """

    return mechanism.mechanism_id