def qsize(queue):
 try:
  return queue.qsize()
 except NotImplementedError:
  return (-1)

def qsize ( queue ) : try : return queue . qsize ( ) except NotImplementedError : return ( - 1 )
return the queue size where available; -1 where not .