<commit_before>import networkx as nx
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import MAIN_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_3
from ryu.lib.ip import ipv4_to_bin
from ryu.lib.mac import haddr_to_bin
from ryu.lib.packet import packet
from ryu.lib.packet import ethernet
from ryu.lib.packet import ether_types
from ryu.lib.packet import tcp, udp
from ryu.lib.packet import ipv4, arp
from ryu.topology import api as topo_api


class Fwd(app_manager.RyuApp):
    '''
    Forward utilization
    '''
    _CONTEXTS = {
        'path_db': PathDB
    }
    OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]

    def __init__(self, *args, **kwargs):
        super(Fwd, self).__init__(*args, **kwargs)
        self.dps = {}
        self.path_db = kwargs['path_db']

    def setup_shortest_path(self,
                            from_dpid,
                            to_dpid,
                            to_port_no,
                            to_dst_match,
                            pre_actions=None):
        if pre_actions is None:
            pre_actions = []
        nx_grapth = self.get_nx_graph()
        path = self.get_shortest_path(nx_grapth, from_dpid, to_dpid)<commit_msg>Fix missing import<commit_after>import networkx as nx
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import MAIN_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_3
from ryu.lib.ip import ipv4_to_bin
from ryu.lib.mac import haddr_to_bin
from ryu.lib.packet import packet
from ryu.lib.packet import ethernet
from ryu.lib.packet import ether_types
from ryu.lib.packet import tcp, udp
from ryu.lib.packet import ipv4, arp
from ryu.topology import api as topo_api
from .path_db import PathDB


class Fwd(app_manager.RyuApp):
    '''
    Forward utilization
    '''
    _CONTEXTS = {
        'path_db': PathDB
    }
    OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]

    def __init__(self, *args, **kwargs):
        super(Fwd, self).__init__(*args, **kwargs)
        self.dps = {}
        self.path_db = kwargs['path_db']

    def setup_shortest_path(self,
                            from_dpid,
                            to_dpid,
                            to_port_no,
                            to_dst_match,
                            pre_actions=None):
        if pre_actions is None:
            pre_actions = []
        nx_grapth = self.get_nx_graph()
        path = self.get_shortest_path(nx_grapth, from_dpid, to_dpid)
{'fraction_non_alphanumeric': 0.07585675779745861, 'fraction_numerical': 0.004620716211012707, 'mean_word_length': 2.365284974093264, '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': '1817763', 'n_tokens_mistral': 872, 'n_tokens_neox': 856, 'n_words': 199}