#NEWLINE# def get_tf_idf_vector( tags , all_terms , idf_map ) : #NEWLINE# #INDENT# 'Computes a tf-idf vector for a given set of tags.\n\n    Args:\n        tags: list of string object tags.\n\n        all_terms: global list of all known terms\n        idf_map: string->float idf map.\n\n    Returns:\n        List of float tf-idf vector coordinates.\n    ' #NEWLINE# return [ ( ( 1 if ( term in tags ) else 0 ) * idf_map [ term ] ) for term in all_terms ]