<commit_before>class InputParser:
    def __init__(self):
        pass

    def get_input(self):
        print("Please enter vertices and edge weights")
        print("(format: [[start,weight,end],[...],...]")
        inp = input()
        edges = ''.join(inp.split(']')).split('[')
        edges = [x.split(',') for x in edges if x]
        edges[0] = edges[0][0:3]

        verts = sorted(list({x[0] for x in edges}))
        print (verts)
        return edges

<commit_msg>parser returns adjacency matrix<commit_after>class InputParser:
    def __init__(self):
        pass

    def get_input(self):
        print("Please enter vertices and edge weights")
        print("(format: [[start,weight,end],[...],...]")
        inp = input()

        edges = ''.join(inp.split(']')).split('[')
        edges = [x.split(',') for x in edges if x]
        edges[0] = edges[0][0:3]

        verts = sorted(list({x[0] for x in edges}))
        return self.adjmatrix(verts,edges)

    def adjmatrix(self, verts, edges):
        size = len(verts)
        matrix = [[ 0 for i in range(size)] for j in range(size)]

        for v in verts:
            adj = [e for e in edges if e[0]==v]
            for a in adj:
                matrix[verts.index(v)][verts.index(a[2])] = \
                    int(a[1])

        return matrix

{'fraction_non_alphanumeric': 0.1641337386018237, 'fraction_numerical': 0.010638297872340425, 'mean_word_length': 2.06993006993007, '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': '1481101', 'n_tokens_mistral': 430, 'n_tokens_neox': 413, 'n_words': 115}