parameters: (self)
return_statement: return reservoir
docstring: Returns a random node's value.
          :rtype: int
docstring_summary: Returns a random node's value.
          :rtype: int
docstring_tokens: Returns a random node s value . : rtype : int
function: def getRandom(self):
          """
          Returns a random node's value.
          :rtype: int
          """
          reservoir = -1
          curr, n = self.__head, 0
          while curr:
              reservoir = curr.val if randint(1, n+1) == 1 else reservoir
              curr, n = curr.next, n+1
          return reservoir
function_tokens: def getRandom ( self ) : reservoir = - 1 curr , n = self . __head , 0 while curr : reservoir = curr . val if randint ( 1 , n + 1 ) == 1 else reservoir curr , n = curr . next , n + 1 return reservoir