import json
import zlib
import base64


def _GetOutputJsonHash(content):
  """Gets hash for output.json.

  Parses response content of the request using hash for .isolated file and
  returns the hash for output.json file.

  Args:
    content (string): Content returned by the POST request to isolated server
        for hash to output.json.
  """
  content_json = json.loads(content)
  content_string = zlib.decompress(base64.b64decode(content_json['content']))
  json_result = json.loads(content_string)
  return json_result.get('files', {}).get('output.json', {}).get('h')