A Generalized Framework of Optimal Two-Stage Designs for Exploratory Basket Trials. (3rd July 2021)