docs: def GetClientConfig(self, context, validate=True, deploy_timestamp=True):
      """Generates the client config file for inclusion in deployable binaries."""
      with utils.TempDirectory() as tmp_dir:
        # Make sure we write the file in yaml format.
        filename = os.path.join(
            tmp_dir,
            config.CONFIG.Get("ClientBuilder.config_filename", context=context))
  
        new_config = config.CONFIG.MakeNewConfig()
        new_config.Initialize(reset=True, data="")
        new_config.SetWriteBack(filename)
  
        # Only copy certain sections to the client. We enumerate all
        # defined options and then resolve those from the config in the
        # client's context. The result is the raw option as if the
        # client read our config file.
        client_context = context[:]
        while contexts.CLIENT_BUILD_CONTEXT in client_context:
          client_context.remove(contexts.CLIENT_BUILD_CONTEXT)
        for descriptor in sorted(config.CONFIG.type_infos, key=lambda x: x.name):
          if descriptor.name in self.SKIP_OPTION_LIST:
            continue
  
          if descriptor.section in self.CONFIG_SECTIONS:
            value = config.CONFIG.GetRaw(
                descriptor.name, context=client_context, default=None)
  
            if value is not None:
              logging.debug("Copying config option to client: %s",
                            descriptor.name)
  
              new_config.SetRaw(descriptor.name, value)
  
        if deploy_timestamp:
          deploy_time_string = str(rdfvalue.RDFDatetime.Now())
          new_config.Set("Client.deploy_time", deploy_time_string)
        new_config.Write()
  
        if validate:
          self.ValidateEndConfig(new_config)
  
        private_validator = config.CONFIG.Get(
            "ClientBuilder.private_config_validator_class", context=context)
        if private_validator:
          try:
            validator = config_validator_base.PrivateConfigValidator.classes[
                private_validator]()
          except KeyError:
            logging.error(
                "Couldn't find config validator class %s, "
                "you probably need to copy it into lib/local", private_validator)
            raise
          validator.ValidateEndConfig(new_config, self.context)
  
        return io.open(filename, "r").read()