<commit_before>#!/bin/bash
# This expects /input/admin.json to be the generated admin.json file

. /usr/lib/ckan/bin/activate

if /usr/lib/ckan/bin/ckanapi action user_show -c /project/development.ini id=admin; then
    # Step 1: Grab the user's current info, step 2: add new pw, step 3: apply new info
    ckanapi action user_show id=admin -c /project/development.ini | python -c "from sys import stdin, stdout;from json import load, dump;obj = load(stdin);obj['password'] = load(open('/input/admin.json'))['password'];dump(obj, stdout)" | ckanapi action user_update -i -c /project/development.ini 
else
    /usr/lib/ckan/bin/ckanapi action user_create -i -c /project/development.ini < /input/admin.json
fi<commit_msg>remove some extra abspaths<commit_after>#!/bin/bash
# This expects /input/admin.json to be the generated admin.json file

. /usr/lib/ckan/bin/activate

if ckanapi action user_show -c /project/development.ini id=admin; then
    # Step 1: Grab the user's current info, step 2: add new pw, step 3: apply new info
    ckanapi action user_show id=admin -c /project/development.ini | python -c "from sys import stdin, stdout;from json import load, dump;obj = load(stdin);obj['password'] = load(open('/input/admin.json'))['password'];dump(obj, stdout)" | ckanapi action user_update -i -c /project/development.ini 
else
    ckanapi action user_create -i -c /project/development.ini < /input/admin.json
fi
{'fraction_non_alphanumeric': 0.127208480565371, 'fraction_numerical': 0.004240282685512367, 'mean_word_length': 4.1678832116788325, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6870649', 'n_tokens_mistral': 481, 'n_tokens_neox': 459, 'n_words': 144}