def _find_sources(sources, target, score_func):
 if isinstance(score_func, string_types):
  score_func = get_score_funcs().get(score_func, score_func)
 if (not callable(score_func)):
  raise ValueError(('%s is not a valid score_func.' % score_func))
 scores = (score_func(sources, target) if (target is not None) else score_func(sources, 1))
 return scores

def _find_sources ( sources , target , score_func ) : if isinstance ( score_func , string_types ) : score_func = get_score_funcs ( ) . get ( score_func , score_func ) if ( not callable ( score_func ) ) : raise ValueError ( ( '%s is not a valid score_func.' % score_func ) ) scores = ( score_func ( sources , target ) if ( target is not None ) else score_func ( sources , 1 ) ) return scores
aux function .