<commit_before>#!/usr/bin/env python

import yaml
import textfsm
from StringIO import StringIO
from radix import Radix

#config_file = "config.yml"

#config = yaml.load(open(config_file).read())
#print config

""" BGP JSON messages:

    { "exabgp": "3.3.0", "time": 1423308720, "neighbor": { "ip":
        "192.168.127.12", "update": { "attribute": { "origin": "igp", "as-path":
            [ 2914, 1299, 8529, 48159, 57543, 61129 ], "med": 0,
            "local-preference": 100, "atomic-aggregate": false, "community": [
            [ 2914, 420 ], [ 2914, 1206 ], [ 2914, 2203 ], [ 2914, 3200 ] ] },
            "announce": { "172.16.58.3" : { "192.168.3.11/24": {  } } } } }
            }

"""

"""
    route:          172.16.58.3/24
    origin:         AS20927

    route:          172.16.58.3/18
    herpa:          dweoinwf
    origin:         AS2116

"""

template = """# textfsm template
Value Required Prefix ([^ ]+)
Value Required Origin ([0-9]+)

Start
  ^route:\s+${Prefix}
  ^origin:\s+AS${Origin} -> Record Start

"""

template_file = StringIO(template)<commit_msg>Comment out unfinished code<commit_after>#!/usr/bin/env python

#import yaml
#import textfsm
#from StringIO import StringIO
#from radix import Radix

#config_file = "config.yml"

#config = yaml.load(open(config_file).read())
#print config

""" BGP JSON messages:

    { "exabgp": "3.3.0", "time": 1423308720, "neighbor": { "ip":
        "192.168.127.12", "update": { "attribute": { "origin": "igp", "as-path":
            [ 2914, 1299, 8529, 48159, 57543, 61129 ], "med": 0,
            "local-preference": 100, "atomic-aggregate": false, "community": [
            [ 2914, 420 ], [ 2914, 1206 ], [ 2914, 2203 ], [ 2914, 3200 ] ] },
            "announce": { "172.16.58.3" : { "192.168.3.11/24": {  } } } } }
            }

"""

"""
    route:          172.16.58.3/24
    origin:         AS20927

    route:          172.16.58.3/18
    herpa:          dweoinwf
    origin:         AS2116

"""

template = """# textfsm template
Value Required Prefix ([^ ]+)
Value Required Origin ([0-9]+)

Start
  ^route:\s+${Prefix}
  ^origin:\s+AS${Origin} -> Record Start

"""

#template_file = StringIO(template)
{'fraction_non_alphanumeric': 0.18770078017439193, 'fraction_numerical': 0.12482790270766407, 'mean_word_length': 2.4824281150159746, 'pattern_counts': {'":': 28, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 10, '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': '756327', 'n_tokens_mistral': 996, 'n_tokens_neox': 795, 'n_words': 174}