<s> from . . core import Machine <EOL> from . nesting import HierarchicalMachine , NestedTransition , NestedEvent <EOL> from . locking import LockedMachine , LockedEvent <EOL> from . diagrams import GraphMachine , TransitionGraphSupport <EOL> class MachineFactory ( object ) : <EOL> @ staticmethod <EOL> def get_predefined ( graph = False , nested = False , locked = False ) : <EOL> if graph and nested and locked : <EOL> return LockedHierarchicalGraphMachine <EOL> elif locked and nested : <EOL> return LockedHierarchicalMachine <EOL> elif locked and graph : <EOL> return LockedGraphMachine <EOL> elif nested and graph : <EOL> return HierarchicalGraphMachine <EOL> elif graph : <EOL> return GraphMachine <EOL> elif nested : <EOL> return HierarchicalMachine <EOL> elif locked : <EOL> return LockedMachine <EOL> else : <EOL> return Machine <EOL> class NestedGraphTransition ( TransitionGraphSupport , NestedTransition ) : <EOL> pass <EOL> class LockedNestedEvent ( LockedEvent , NestedEvent ) : <EOL> pass <EOL> class HierarchicalGraphMachine ( GraphMachine , HierarchicalMachine ) : <EOL> @ staticmethod <EOL> def _create_transition ( * args , ** kwargs ) : <EOL> return NestedGraphTransition ( * args , ** kwargs ) <EOL> class LockedHierarchicalMachine ( LockedMachine , HierarchicalMachine ) : <EOL> @ staticmethod <EOL> def _create_event ( * args , ** kwargs ) : <EOL> return LockedNestedEvent ( * args , ** kwargs ) <EOL> class LockedGraphMachine ( GraphMachine , LockedMachine ) : <EOL> pass <EOL> class LockedHierarchicalGraphMachine ( GraphMachine , LockedMachine , HierarchicalMachine ) : <EOL> @ staticmethod <EOL> def _create_transition ( * args , ** kwargs ) : <EOL> return NestedGraphTransition ( * args , ** kwargs ) <EOL> @ staticmethod <EOL> def _create_event ( * args , ** kwargs ) : <EOL> return LockedNestedEvent ( * args , ** kwargs ) </s>
