code: def Analyze(self, source_path, output_writer):
      
      if not os.path.exists(source_path):
        raise RuntimeError('No such source: {0:s}.'.format(source_path))
  
      scan_context = source_scanner.SourceScannerContext()
      scan_path_spec = None
      scan_step = 0
  
      scan_context.OpenSourcePath(source_path)
  
      while True:
        self._source_scanner.Scan(
            scan_context, auto_recurse=self._auto_recurse,
            scan_path_spec=scan_path_spec)
  
        if not scan_context.updated:
          break
  
        if not self._auto_recurse:
          output_writer.WriteScanContext(scan_context, scan_step=scan_step)
        scan_step += 1
  
        # The source is a directory or file.
        if scan_context.source_type in [
            definitions.SOURCE_TYPE_DIRECTORY, definitions.SOURCE_TYPE_FILE]:
          break
  
        # The source scanner found a locked volume, e.g. an encrypted volume,
        # and we need a credential to unlock the volume.
        for locked_scan_node in scan_context.locked_scan_nodes:
          self._PromptUserForEncryptedVolumeCredential(
              scan_context, locked_scan_node, output_writer)
  
        if not self._auto_recurse:
          scan_node = scan_context.GetUnscannedScanNode()
          if not scan_node:
            return
          scan_path_spec = scan_node.path_spec
  
      if self._auto_recurse:
        output_writer.WriteScanContext(scan_context)
docs: Analyzes the source.
  
      Args:
        source_path (str): the source path.
        output_writer (StdoutWriter): the output writer.
  
      Raises:
        RuntimeError: if the source path does not exists, or if the source path
            is not a file or directory, or if the format of or within the source
            file is not supported.