<commit_before>'''
Created on 22 Dec 2014

@author: <NAME> <<EMAIL>>
@helpdesk: Grid Services <<EMAIL>>
                                         
usage: python createTokens.py [picas_db_name] [picas_username] [picas_pwd]
description: create 5 tokens with basic fields and a random number for the input field
'''
import simcity_client
import argparse
import numpy as np

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description="Remove all tokens in a view")
    parser.add_argument('view', choices=['todo', 'done', 'locked'], help="View to remove tokens from")
    args = parser.parse_args()
    
    db = simcity_client.init()['database']

    is_deleted = db.delete_tokens_from_view(args.view)
    print "Deleted", np.sum(is_deleted), "out of", len(is_deleted), "tokens from view", args.view<commit_msg>Fixed and updated deleteFromView script<commit_after>'''
Created on 22 Dec 2014

@author: <NAME> <<EMAIL>>
@helpdesk: Grid Services <<EMAIL>>
                                         
usage: python createTokens.py [picas_db_name] [picas_username] [picas_pwd]
description: create 5 tokens with basic fields and a random number for the input field
'''
import simcity_client
import argparse
import numpy as np

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description="Remove all tokens in a view")
    parser.add_argument('view', choices=['todo', 'done', 'locked', 'pending_jobs', 'active_jobs', 'finished_jobs'], help="View to remove tokens from")
    
    args = parser.parse_args()
    
    db = simcity_client.init()['database']

    is_deleted = db.delete_from_view(args.view)
    print "Deleted", np.sum(is_deleted), "out of", len(is_deleted), "tokens from view", args.view
{'fraction_non_alphanumeric': 0.12034883720930233, 'fraction_numerical': 0.00813953488372093, 'mean_word_length': 4.017492711370262, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2068438', 'n_tokens_mistral': 527, 'n_tokens_neox': 515, 'n_words': 160}