parameters: (unified_state: _RobotInterfaceState,
                   parts : Dict[str,List[int]])
return_statement: return res
docstring: Splits a macro-state into a list of sub-parts' states
docstring_summary: Splits a macro-state into a list of sub-parts' states
docstring_tokens: Splits a macro - state into a list of sub - parts states
function: def _split_state(unified_state: _RobotInterfaceState,
                   parts : Dict[str,List[int]]) -> Dict[str,_RobotInterfaceState]:
      """Splits a macro-state into a list of sub-parts' states"""
      res = dict()
      for (name,inds) in parts.items():
          if name is None: continue
          state = _RobotInterfaceState()
          res[name] = state
          state.clock = unified_state.clock
          state.rate = unified_state.rate
          state.status = unified_state.status
          state.isMoving = unified_state.isMoving
          _split_state_var(unified_state,state,inds,'sensedPosition')
          _split_state_var(unified_state,state,inds,'sensedPosition')
          _split_state_var(unified_state,state,inds,'sensedVelocity')
          _split_state_var(unified_state,state,inds,'commandedPosition')
          _split_state_var(unified_state,state,inds,'commandedVelocity')
          _split_state_var(unified_state,state,inds,'commandedTorque')
          _split_state_var(unified_state,state,inds,'destinationPosition')
          _split_state_var(unified_state,state,inds,'destinationVelocity')
  
          state.destinationTime = unified_state.destinationTime
          if unified_state.queuedTrajectory is not None:
              state.queuedTrajectory = [unified_state.queuedTrajectory[j] for j in inds]
          
          _split_state_var(unified_state,state,inds,'jointControlModes')
          for k,v in unified_state.stateValue.items():
              state.stateValue[k] = [v[j] for j in inds]
          
          if name in unified_state.children:
              partState = unified_state.children[name]
              state.sensorState = copy.copy(partState.sensorState)
              state.cartesianState = copy.copy(partState.cartesianState)
              state.children = copy.deepcopy(partState.children)
      return res
function_tokens: def _split_state ( unified_state : _RobotInterfaceState , parts : Dict [ str , List [ int ] ] ) -> Dict [ str , _RobotInterfaceState ] : res = dict ( ) for ( name , inds ) in parts . items ( ) : if name is None : continue state = _RobotInterfaceState ( ) res [ name ] = state state . clock = unified_state . clock state . rate = unified_state . rate state . status = unified_state . status state . isMoving = unified_state . isMoving _split_state_var ( unified_state , state , inds , 'sensedPosition' ) _split_state_var ( unified_state , state , inds , 'sensedPosition' ) _split_state_var ( unified_state , state , inds , 'sensedVelocity' ) _split_state_var ( unified_state , state , inds , 'commandedPosition' ) _split_state_var ( unified_state , state , inds , 'commandedVelocity' ) _split_state_var ( unified_state , state , inds , 'commandedTorque' ) _split_state_var ( unified_state , state , inds , 'destinationPosition' ) _split_state_var ( unified_state , state , inds , 'destinationVelocity' ) state . destinationTime = unified_state . destinationTime if unified_state . queuedTrajectory is not None : state . queuedTrajectory = [ unified_state . queuedTrajectory [ j ] for j in inds ] _split_state_var ( unified_state , state , inds , 'jointControlModes' ) for k , v in unified_state . stateValue . items ( ) : state . stateValue [ k ] = [ v [ j ] for j in inds ] if name in unified_state . children : partState = unified_state . children [ name ] state . sensorState = copy . copy ( partState . sensorState ) state . cartesianState = copy . copy ( partState . cartesianState ) state . children = copy . deepcopy ( partState . children ) return res