docs: def is_retryable(err):
      """
      Determines if the given exception is something that is
      network/socket-related and should thus cause the TCP connection to
      close and the operation retried on another node.
  
      :rtype: boolean
      """
      if isinstance(err, ConnectionClosed):
          # NB: only retryable if we're not mid-streaming
          if err.mid_stream:
              return False
          else:
              return True
      elif isinstance(err, socket.error):
          code = err.args[0]
          return code in CONN_CLOSED_ERRORS
      else:
          return False