code: def LockScanNode(self, path_spec):
      
      scan_node = self._scan_nodes.get(path_spec, None)
      if not scan_node:
        raise KeyError('Scan node does not exist.')
  
      self._locked_scan_nodes[path_spec] = scan_node
docs: Marks a scan node as locked.
  
      Args:
        path_spec (PathSpec): path specification.
  
      Raises:
        KeyError: if the scan node does not exists.