code: def Parse(self, stat, _):
      
      if isinstance(stat, rdf_client_fs.StatEntry):
        value = stat.registry_data.GetValue()
      elif isinstance(stat, rdfvalue.RDFString):
        value = stat
      if not value:
        raise parser.ParseError("Invalid value for key %s" % stat.pathspec.path)
  
      systemdrive = value[0:2]
      if re.match(r"^[A-Za-z]:$", systemdrive):
        yield rdfvalue.RDFString(systemdrive)
      else:
        raise parser.ParseError(
            "Bad drive letter for key %s" % stat.pathspec.path)
docs: Parses a SystemDrive environment variable.