<commit_before>#!/usr/bin/python
import json
import sys
import fileinput

data=""
#for line in sys.stdin:
for line in fileinput.input():
    data += line

jdata = json.loads(data)

for e in jdata:
    lists="no list"
    if e["blacklisted"] and e["whitelisted"]:
        lists="both lists"
    elif e["blacklisted"]:
        lists="black list"
    elif e["whitelisted"]:
        lists="white list"
    print e["groupId"]+":"+e["artifactId"]+":"+e["version"]+"\t"+str(e["bestMatchVersion"])+"\t"+"["+", ".join(e["availableVersions"])+"]\t"+lists<commit_msg>[CLI] Fix pretty-lookup.py so that it does not fail for lookup<commit_after>#!/usr/bin/python
import json
import sys
import fileinput

data=""
#for line in sys.stdin:
for line in fileinput.input():
    data += line

jdata = json.loads(data)

for e in jdata:
    lists="no list"
    if e["blacklisted"] and e["whitelisted"]:
        lists="both lists"
    elif e["blacklisted"]:
        lists="black list"
    elif e["whitelisted"]:
        lists="white list"

    if "availableVersions" in e:
        prettyAvailableVersions = "\t[" + ", ".join(e["availableVersions"]) + "]"
    else:
        prettyAvailableVersions = ""

    print e["groupId"]+":"+e["artifactId"]+":"+e["version"]+"\t"+str(e["bestMatchVersion"]) + prettyAvailableVersions + "\t"+lists
{'fraction_non_alphanumeric': 0.18334606569900688, 'fraction_numerical': 0.0, 'mean_word_length': 3.888059701492537, 'pattern_counts': {'":': 4, '<': 3, '<?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': '5589837', 'n_tokens_mistral': 445, 'n_tokens_neox': 434, 'n_words': 105}