class_docstr: Locking mechanism that issues tickets managing access to conversation IDs.
  
  Tickets are issued in the order in which they are requested. A detailed
  explanation of the ticket lock algorithm can be found at
  http://pages.cs.wisc.edu/~remzi/OSTEP/threads-locks.pdf#page=13
docstr: Get ticket number for `ticket_index`.
  
  Returns:
       Ticket number for `Ticket` with index `ticket_index`. None if there are no
       tickets, or if `ticket_index` is out of bounds of `self.tickets`.
docstr_tok: ["Get","ticket","number","for","`","ticket_index","`",".","Returns",":","Ticket","number","for","`","Ticket","`","with","index","`","ticket_index","`",".","None","if","there","are","no","tickets",",","or","if","`","ticket_index","`","is","out","of","bounds","of","`","self.tickets","`","."]
code: def _ticket_number_for(self, ticket_index: int) -> Optional[int]:
      """Get ticket number for `ticket_index`.
  
      Returns:
           Ticket number for `Ticket` with index `ticket_index`. None if there are no
           tickets, or if `ticket_index` is out of bounds of `self.tickets`.
      """
      self.remove_expired_tickets()
  
      try:
          return self.tickets[ticket_index].number
      except IndexError:
          return None
  
imports: import json
  import logging
  from collections import deque
  import time
  from typing import Text, Optional, Union, Deque, Dict, Any
label_desc: Use image node_id 9 for calling the TicketLock obj's underlying member method code with example usage: obj._ticket_number_for(ticket_index) and returns: self, None