<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_rank(self, peer):
 """Calculate the peer rank based on connections. If the peer has no incoming connections, it will have largest rank. In our peer selection strategy, the largest number has least priority in the heap. If the peer has incoming connections, we will return number of outbound pending requests and responses. :param peer: instance of `tchannel.tornado.peer.Peer` :return: rank of the peer """

        if not peer.connections:
            return self.TIERS[0]

        if not peer.has_incoming_connections:
            return self.TIERS[1] + peer.total_outbound_pendings

        return self.TIERS[2] + peer.total_outbound_pendings