def generate_community_tags_scores(database, community):
    """
    This function generates the most important terms that describe
    a community of similar documents, alongside their pagerank and in-degree scores.
    """
    # Get all intersecting nodes of the speficied community, 
    # ranked by their in-degree (which shows to how many documents they belong to).
    # and pagerank score in descending order.
    query = ('MATCH p=((d:Document {community: '+ str(community) +'})-[:includes]->(w:Word)) '
             'WITH w, count(p) as degree '
             'WHERE degree > 1 '
             'RETURN w.key, w.pagerank as pagerank, degree '
             'ORDER BY degree DESC, pagerank DESC')
    tags_scores = database.execute(' '.join(query.split()), 'r')
    return tags_scores