<commit_before>#! /usr/bin/python

import json
import pdb
import sys
from pox.lib.addresses import EthAddr
from VMOCGlobals import VMOCGlobals

# Class for representing the details of a slice from the
# perspective of the VMOC
# A slice has a controller (possibly None), a name and a list of VLAN's


# Represents the configuration of a slice: its ID, controller URL
# and list of vlan's
class VMOCSliceConfiguration:
    def __init__(self, slice_id=None, controller_url=None, 
                 vlans=None, attribs=None):
        if attribs != None:
            slice_id = attribs['slice_id']
            controller_url = attribs['controller_url']
            vlans  = [int(v) for v in attribs['vlans']]
        self._slice_id = slice_id
        self._controller_url = controller_url
        self._vlans = vlans
    
    def getSliceID(self) : return self._slice_id
    def getControllerURL(self) : return self._controller_url
    def setControllerURL(self, controller_url) : self._controller_url = controller_url
    def getVLANs(self) : return self._vlans

    def belongsToSlice(self, vlan_id, src, dst):
        return vlan_id in self._vlans

    def __attr__(self):
        return {'slice_id' : self._slice_id, 
             'controller_url' : self._controller_url,<commit_msg>Remove dependency on pox<commit_after>#! /usr/bin/python

import json
import pdb
import sys
from VMOCGlobals import VMOCGlobals

# Class for representing the details of a slice from the
# perspective of the VMOC
# A slice has a controller (possibly None), a name and a list of VLAN's


# Represents the configuration of a slice: its ID, controller URL
# and list of vlan's
class VMOCSliceConfiguration:
    def __init__(self, slice_id=None, controller_url=None, 
                 vlans=None, attribs=None):
        if attribs != None:
            slice_id = attribs['slice_id']
            controller_url = attribs['controller_url']
            vlans  = [int(v) for v in attribs['vlans']]
        self._slice_id = slice_id
        self._controller_url = controller_url
        self._vlans = vlans
    
    def getSliceID(self) : return self._slice_id
    def getControllerURL(self) : return self._controller_url
    def setControllerURL(self, controller_url) : self._controller_url = controller_url
    def getVLANs(self) : return self._vlans

    def belongsToSlice(self, vlan_id, src, dst):
        return vlan_id in self._vlans

    def __attr__(self):
        return {'slice_id' : self._slice_id, 
             'controller_url' : self._controller_url,
{'fraction_non_alphanumeric': 0.07883326763894363, 'fraction_numerical': 0.0, 'mean_word_length': 3.1470588235294117, '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': '5794916', 'n_tokens_mistral': 789, 'n_tokens_neox': 766, 'n_words': 234}