code: def latency(self):
          
          if not self.shards:
              return float('nan')
          return sum(latency for _, latency in self.latencies) / len(self.shards)
docs: :class:`float`: Measures latency between a HEARTBEAT and a HEARTBEAT_ACK in seconds.
  
          This operates similarly to :meth:`.Client.latency` except it uses the average
          latency of every shard's latency. To get a list of shard latency, check the
          :attr:`latencies` property. Returns ``nan`` if there are no shards ready.