#NEWLINE# def _get_alpha_div( alphas , Ks , dim , ns = None ) : #NEWLINE# #INDENT# alphas = np . reshape ( alphas , ( ( - 1 ) , 1 ) ) #NEWLINE# Ks = np . reshape ( Ks , ( 1 , ( - 1 ) ) ) #NEWLINE# omas = ( 1 - alphas ) #NEWLINE# Bs = np . exp ( ( ( ( gammaln ( Ks ) * 2 ) - gammaln ( ( Ks + omas ) ) ) - gammaln ( ( Ks - omas ) ) ) ) #NEWLINE# return partial ( _alpha_div , omas , Bs , dim )