def save_topic_similarities(topic_similarities):
 topic_similarities_entity = recommendations_models.TopicSimilaritiesModel.get(recommendations_models.TOPIC_SIMILARITIES_ID, strict=False)
 if (topic_similarities_entity is None):
  topic_similarities_entity = recommendations_models.TopicSimilaritiesModel(id=recommendations_models.TOPIC_SIMILARITIES_ID, content=json.dumps(topic_similarities))
 else:
  topic_similarities_entity.content = json.dumps(topic_similarities)
 topic_similarities_entity.put()
 return topic_similarities_entity

def save_topic_similarities ( topic_similarities ) : topic_similarities_entity = recommendations_models . TopicSimilaritiesModel . get ( recommendations_models . TOPIC_SIMILARITIES_ID , strict = False ) if ( topic_similarities_entity is None ) : topic_similarities_entity = recommendations_models . TopicSimilaritiesModel ( id = recommendations_models . TOPIC_SIMILARITIES_ID , content = json . dumps ( topic_similarities ) ) else : topic_similarities_entity . content = json . dumps ( topic_similarities ) topic_similarities_entity . put ( ) return topic_similarities_entity
stores topic similarities in the datastore .