def getQuery(self,resource):
    alpha = 2

    n = resource.get('n')
    key_list = []
    for i in range(n):
      key_list.append( 'Xsum_'+str(i) )
      key_list.append( 'T_'+str(i) )

    key_value_dict = resource.get_many(key_list)

    sumX = []
    T = []
    for i in range(n):
      sumX.append( key_value_dict['Xsum_'+str(i)] )
      T.append( key_value_dict['T_'+str(i)] )

    theta = numpy.zeros(n)
    for i in range(n):
      theta[i] = numpy.random.beta(max(1,(1+sumX[i])/alpha),max(1,(1+T[i]-sumX[i])/alpha))

    index = numpy.argmax(theta)

    alt_index = numpy.random.choice(n)
    while alt_index==index:
      alt_index = numpy.random.choice(n)

    random_fork = numpy.random.choice(2)
    if random_fork==0:
      return index,alt_index,index
    else:
      return alt_index,index,index
dataset/ETHPy150Open nextml/NEXT/next/apps/DuelingBanditsPureExploration/algs/BR_Thompson_b2/BR_Thompson_b2.py/BR_Thompson_b2.getQuery/original