def _calculate_num_threads(batch_size, shuffle):
 if shuffle:
  return min(10, int(round(math.sqrt(batch_size))))
 else:
  return 1

def _calculate_num_threads ( batch_size , shuffle ) : if shuffle : return min ( 10 , int ( round ( math . sqrt ( batch_size ) ) ) ) else : return 1
calculates an appropriate number of threads for creating this database .