class_docstr: Represent a GCS Object, including all its revisions.
class_docstr_tok: ["Represent","a","GCS","Object",",","including","all","its","revisions","."]
docstr: Remove the keys from metadata (an update or patch) that are not
  writable.
  
  Both `Objects: patch` and `Objects: update` either ignore non-writable
  keys or return 400 if the key does not match the current value. In
  the testbench we simply always ignore them, to make life easier.
  
  :param metadata:dict a dictionary representing a patch or
      update to the metadata.
  :return metadata but with only any non-writable keys removed.
  :rtype: dict
docstr_tok: ["Remove","the","keys","from","metadata","(","an","update","or","patch",")","that","are","not","writable",".","Both","`","Objects",":","patch","`","and","`","Objects",":","update","`","either","ignore","non-writable","keys","or","return","400","if","the","key","does","not","match","the","current","value",".","In","the","testbench","we","simply","always","ignore","them",",","to","make","life","easier",".",":","param","metadata",":","dict","a","dictionary","representing","a","patch","or","update","to","the","metadata",".",":","return","metadata","but","with","only","any","non-writable","keys","removed",".",":","rtype",":","dict"]
code: def _remove_non_writable_keys(cls, metadata):
      """Remove the keys from metadata (an update or patch) that are not
      writable.
  
      Both `Objects: patch` and `Objects: update` either ignore non-writable
      keys or return 400 if the key does not match the current value. In
      the testbench we simply always ignore them, to make life easier.
  
      :param metadata:dict a dictionary representing a patch or
          update to the metadata.
      :return metadata but with only any non-writable keys removed.
      :rtype: dict
      """
      writeable_keys = {
          "acl",
          "cacheControl",
          "contentDisposition",
          "contentEncoding",
          "contentLanguage",
          "contentType",
          "eventBasedHold",
          "metadata",
          "temporaryHold",
          "storageClass",
          "customTime",
      }
      # Cannot change `metadata` while we are iterating over it, so we make
      # a copy
      keys = [key for key in metadata.keys()]
      for key in keys:
          if key not in writeable_keys:
              metadata.pop(key, None)
      return metadata
  
imports: import base64
  import crc32c
  import error_response
  import hashlib
  import json
  import struct
  import testbench_utils
  import time
label_desc: Use image node_id 4 for calling the GcsObject obj's underlying member method code with example usage: obj._remove_non_writable_keys(cls, metadata) and returns: metadata