<commit_before>import sys
import os

from orbit.utils import orbitFinalize
from orbit.utils import NamedObject
from orbit.utils import TypedObject

from orbit.lattice import AccActionsContainer
from orbit.lattice import AccNode

import orbit

class AccLattice(NamedObject,TypedObject):
	"""
	The accelerator lattice class contains child nodes.
	"""
	
	ENTRANCE = AccActionsContainer.ENTRANCE
	BODY = AccActionsContainer.BODY
	EXIT = AccActionsContainer.EXIT
		
	BEFORE = AccActionsContainer.BEFORE 
	AFTER = AccActionsContainer.AFTER	
	
	def __init__(self, name = "no name"):
		"""
		Constructor creates an empty accelerator lattice.
		"""
		NamedObject.__init__(self,name)
		TypedObject.__init__(self,"lattice")				
		self.__length = 0.
		self.__isInitialized = False
		self.__children = []
		self.__childPositions = {}

	def getLength(self):
		"""
		It returns the physical length of the lattice.
		"""
		return self.__length

	def isInitialized(self):
		"""
		It returns the initialization status (True or False).
		"""
		return self.__isInitialized

	def initialize(self):
		"""
		Method. Initializes the lattice and child node structures.
		"""
		for node in self.__children:
			if(self.__children.count(node) > 1):
				msg = "The AccLattice class instance should not have duplicate nodes!"
				msg = msg + os.linesep
				msg = msg + "Method initialize():"
				msg = msg + os.linesep
				msg = msg + "Name of node=" + node.getName()
				msg = msg + os.linesep
				msg = msg + "Type of node=" + node.getType()
				msg = msg + os.linesep
				orbitFinalize(msg)

		paramsDict = {}
		actions = AccActionsContainer()
		d = [0.]
		poss = {}

		def accNodeExitAction(paramsDict):
			node = paramsDict["node"]
			parentNode = paramsDict["parentNode"]
			if(isinstance(parentNode,AccLattice)):
				posBefore = d[0]<commit_msg>The initialization of the child nodes added to the lattice initialize()<commit_after>import sys
import os

from orbit.utils import orbitFinalize
from orbit.utils import NamedObject
from orbit.utils import TypedObject

from orbit.lattice import AccActionsContainer
from orbit.lattice import AccNode

import orbit

class AccLattice(NamedObject,TypedObject):
	"""
	The accelerator lattice class contains child nodes.
	"""
	
	ENTRANCE = AccActionsContainer.ENTRANCE
	BODY = AccActionsContainer.BODY
	EXIT = AccActionsContainer.EXIT
		
	BEFORE = AccActionsContainer.BEFORE 
	AFTER = AccActionsContainer.AFTER	
	
	def __init__(self, name = "no name"):
		"""
		Constructor creates an empty accelerator lattice.
		"""
		NamedObject.__init__(self,name)
		TypedObject.__init__(self,"lattice")				
		self.__length = 0.
		self.__isInitialized = False
		self.__children = []
		self.__childPositions = {}

	def getLength(self):
		"""
		It returns the physical length of the lattice.
		"""
		return self.__length

	def isInitialized(self):
		"""
		It returns the initialization status (True or False).
		"""
		return self.__isInitialized

	def initialize(self):
		"""
		Method. Initializes the lattice and child node structures.
		"""
		for node in self.__children:
			if(self.__children.count(node) > 1):
				msg = "The AccLattice class instance should not have duplicate nodes!"
				msg = msg + os.linesep
				msg = msg + "Method initialize():"
				msg = msg + os.linesep
				msg = msg + "Name of node=" + node.getName()
				msg = msg + os.linesep
				msg = msg + "Type of node=" + node.getType()
				msg = msg + os.linesep
				orbitFinalize(msg)
			node.initialize()

		paramsDict = {}
		actions = AccActionsContainer()
		d = [0.]
		poss = {}

		def accNodeExitAction(paramsDict):
			node = paramsDict["node"]
			parentNode = paramsDict["parentNode"]
			if(isinstance(parentNode,AccLattice)):
				posBefore = d[0]
{'fraction_non_alphanumeric': 0.10287402632285791, 'fraction_numerical': 0.0021488047273704003, 'mean_word_length': 3.8113695090439275, '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': '496228', 'n_tokens_mistral': 1261, 'n_tokens_neox': 1110, 'n_words': 326}