<commit_before>#!/usr/bin/env python
import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), "../../pox"))
from pox.openflow.libopenflow_01 import *
from pox.openflow.flow_table import FlowTable, TableEntry, SwitchFlowTable
from pox.openflow.software_switch import OFConnection
from pox.lib.addresses import EthAddr
from pox.lib.packet.ethernet import ethernet
from pox.lib.packet.icmp import icmp
from pox.lib.packet.ipv4 import ipv4
from pox.lib.packet.icmp import _type_to_name as icmp_names
from pox.lib.packet.packet_utils import ipproto_to_str

import argparse
import json
from collections import namedtuple, defaultdict, deque, OrderedDict
import itertools
import pprint
import base64
from copy import copy

from hb_comute_check import CommutativityChecker
from hb_utils import decode_flow_mod
from hb_utils import decode_packet
from hb_utils import pkt_info
from hb_utils import ofp_flow_mod_command_to_str
from hb_utils import nCr
from hb_utils import enum

#
# Do not import any STS types! We would like to be able to run this offline
# from a trace file without having to depend on STS.
#

def enum(*sequential, **named):
    enums = dict(zip(sequential, range(len(sequential))), **named)
    reverse = dict((value, key) for key, value in enums.iteritems())
    @classmethod
    def _names(cls): # returns dict: ordinal -> string
      return reverse
    enums['_names'] = _names
    @classmethod
    def _ordinals(cls): # returns dict: string -> ordinal
      # filter _names, _ordinals
      return {k: v for k, v in enums.items() if not k.startswith('_')}
    enums['_ordinals'] = _ordinals
    return type('Enum', (), enums)
 
EventType = enum('HbPacketHandle',
                 'HbPacketSend',
                 'HbMessageHandle',
                 'HbMessageSend', 
                 'HbHostHandle', 
                 'HbHostSend', 
                 'HbControllerHandle', 
                 'HbControllerSend',
                 'HbAsyncFlowExpiry',
                 )

OpType = enum('TraceSwitchFlowTableRead',<commit_msg>Remove enums from hb_graph<commit_after>#!/usr/bin/env python
import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), "../../pox"))
from pox.openflow.libopenflow_01 import *
from pox.openflow.flow_table import FlowTable, TableEntry, SwitchFlowTable
from pox.openflow.software_switch import OFConnection
from pox.lib.addresses import EthAddr
from pox.lib.packet.ethernet import ethernet
from pox.lib.packet.icmp import icmp
from pox.lib.packet.ipv4 import ipv4
from pox.lib.packet.icmp import _type_to_name as icmp_names
from pox.lib.packet.packet_utils import ipproto_to_str

import argparse
import json
from collections import namedtuple, defaultdict, deque, OrderedDict
import itertools
import pprint
import base64
from copy import copy

from hb_comute_check import CommutativityChecker
from hb_utils import decode_flow_mod
from hb_utils import decode_packet
from hb_utils import pkt_info
from hb_utils import ofp_flow_mod_command_to_str
from hb_utils import nCr
from hb_utils import enum

#
# Do not import any STS types! We would like to be able to run this offline
# from a trace file without having to depend on STS.
#

 
EventType = enum('HbPacketHandle',
                 'HbPacketSend',
                 'HbMessageHandle',
                 'HbMessageSend', 
                 'HbHostHandle', 
                 'HbHostSend', 
                 'HbControllerHandle', 
                 'HbControllerSend',
                 'HbAsyncFlowExpiry',
                 )

OpType = enum('TraceSwitchFlowTableRead',
{'fraction_non_alphanumeric': 0.07692307692307693, 'fraction_numerical': 0.0033444816053511705, 'mean_word_length': 3.403680981595092, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '945003', 'n_tokens_mistral': 1115, 'n_tokens_neox': 1084, 'n_words': 322}