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

# Set default log level
import logging
logging.basicConfig(level=logging.DEBUG)

from pox.core import core
import pox.openflow.openflow
import pox.openflow.of_01

# Turn on extra info for event exceptions
import pox.lib.revent.revent as revent
revent.showEventExceptions = True

options = None

def doLaunch ():
  import sys, os
  # Add pox directory to path
  sys.path.append(os.path.abspath('pox'))

  import collections
  components = collections.OrderedDict()
  #curargs = None

  curargs = collections.OrderedDict()
  global options
  options = curargs

  for arg in sys.argv[1:]:
    if not arg.startswith("--"):
      assert arg not in components
      curargs = collections.OrderedDict()
      components[arg] = curargs
    else:
      arg = arg[2:].split("=", 1)
      if len(arg) == 1: arg.append(True)
      curargs[arg[0]] = arg[1]

  for name,params in components.iteritems():
    name = name.split(":", 1)
    launch = name[1] if len(name) == 2 else "launch"
    name = name[0]

    if "pox." + name in sys.modules:
      name = "pox." + name
    elif name not in sys.modules:
      try:
        __import__("pox." + name, globals(), locals())
        name = "pox." + name
      except:<commit_msg>Rewrite startup to not use Python 2.7 features<commit_after>#!/usr/bin/env python

# Set default log level
import logging
logging.basicConfig(level=logging.DEBUG)

from pox.core import core
import pox.openflow.openflow
import pox.openflow.of_01

# Turn on extra info for event exceptions
import pox.lib.revent.revent as revent
revent.showEventExceptions = True

options = None

def doLaunch ():
  import sys, os
  # Add pox directory to path
  sys.path.append(os.path.abspath('pox'))

  component_order = []
  components = {}
  #curargs = None

  curargs = {}
  global options
  options = curargs

  for arg in sys.argv[1:]:
    if not arg.startswith("--"):
      assert arg not in components
      curargs = {}
      components[arg] = curargs
      component_order.append(arg)
    else:
      arg = arg[2:].split("=", 1)
      if len(arg) == 1: arg.append(True)
      curargs[arg[0]] = arg[1]

  for name in component_order:
    params = components[name]
    name = name.split(":", 1)
    launch = name[1] if len(name) == 2 else "launch"
    name = name[0]

    if "pox." + name in sys.modules:
      name = "pox." + name
    elif name not in sys.modules:
      try:
        __import__("pox." + name, globals(), locals())
        name = "pox." + name
      except:
{'fraction_non_alphanumeric': 0.12529832935560858, 'fraction_numerical': 0.010342084327764518, 'mean_word_length': 2.9481946624803768, 'pattern_counts': {'":': 2, '<': 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': '3530373', 'n_tokens_mistral': 860, 'n_tokens_neox': 834, 'n_words': 243}