def getTimeCubes(self, ch, idx, listoftimestamps, resolution):

    # if in a TxN us the transaction cursor.  Otherwise create one.
    if self.txncursor is None:
      cursor = self.conn.cursor()
    else:
      cursor = self.txncursor

    sql = "SELECT zindex,timestamp,cube FROM {} WHERE zindex={} and timestamp in (%s)".format(ch.getTable(resolution), idx)

    # creats a %s for each list element
    in_p=', '.join(map(lambda x: '%s', listoftimestamps))
    # replace the single %s with the in_p string
    sql = in_p % sql

    try:
      rc = cursor.execute(sql, listoftimestamps)
    
      # Get the objects and add to the cube
      while ( True ):
        try: 
          retval = cursor.fetchone() 
        except:
          break
        if retval is not None:
          yield ( retval )
        else:
          return
 
    finally:
      # close the local cursor if not in a transaction
      if self.txncursor is None:
        cursor.close()
dataset/ETHPy150Open neurodata/ndstore/ocpca/mysqlkvio.py/MySQLKVIO.getTimeCubes/swapped operands of `%`