<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def LockScanNode(self, path_spec):
 """Marks a scan node as locked. Args: path_spec (PathSpec):
 path specification. Raises: KeyError: if the scan node does not exists. """

    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