<commit_before>from TwitterAuth import connectToTwitter
from friendsOf import friendsOf
import json

adjacencyList = {}

# example: generateFriendsGraph("katyperry")

def generateFriendsGraph(user, d=0):
    global adjacencyList

    adjacencyList[user] = friendsOf(user)
    
    if d == 8:
        # write adjacencyList to json file
        file = open("data1.json", "w")
        file.write(simplejson.dumps(simplejson.loads(output), indent=4, sort_keys=False))
        file.close()

        return True
    
    else:
        for u in adjacencyList[user]:
            if u not in adjacencyList:
                generateFriendsGraph(u, d+1)<commit_msg>fix json output<commit_after>from TwitterAuth import connectToTwitter
from friendsOf import friendsOf
import json

adjacencyList = {}

# example: generateFriendsGraph("katyperry")

def generateFriendsGraph(user, d=0):
    global adjacencyList

    adjacencyList[user] = friendsOf(user)
    
    if d == 8:
        # write adjacencyList to json file
        file = open("data1.json", "w")
        file.write(json.dumps(json.loads(output), indent=4, sort_keys=False))
        file.close()

        return True
    
    else:
        for u in adjacencyList[user]:
            if u not in adjacencyList:
                generateFriendsGraph(u, d+1)
{'fraction_non_alphanumeric': 0.09244992295839753, 'fraction_numerical': 0.007704160246533128, 'mean_word_length': 2.85459940652819, 'pattern_counts': {'":': 0, '<': 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': '4703407', 'n_tokens_mistral': 409, 'n_tokens_neox': 387, 'n_words': 99}