def load_json_file(filepath):
<EOL>securesystemslib.formats.PATH_SCHEMA.check_match(filepath)<EOL>deserialized_object = None<EOL>if filepath.endswith('<STR_LIT>'):<EOL><INDENT>logger.debug('<STR_LIT>' + str(filepath) + '<STR_LIT:)>')<EOL>fileobject = six.StringIO(gzip.open(filepath).read().decode('<STR_LIT:utf-8>'))<EOL><DEDENT>else:<EOL><INDENT>logger.debug('<STR_LIT>' + str(filepath) + '<STR_LIT:)>')<EOL>fileobject = open(filepath)<EOL><DEDENT>try:<EOL><INDENT>deserialized_object = json.load(fileobject)<EOL><DEDENT>except (ValueError, TypeError) as e:<EOL><INDENT>raise securesystemslib.exceptions.Error('<STR_LIT>'<EOL>'<STR_LIT>' + repr(filepath))<EOL><DEDENT>else:<EOL><INDENT>fileobject.close()<EOL>return deserialized_object<EOL><DEDENT>finally:<EOL><INDENT>fileobject.close()<EOL><DEDENT>
<Purpose>
  Deserialize a JSON object from a file containing the object.

<Arguments>
  filepath:
    Absolute path of JSON file.

<Exceptions>
  securesystemslib.exceptions.FormatError: If 'filepath' is improperly
  formatted.

  securesystemslib.exceptions.Error: If 'filepath' cannot be deserialized to
  a Python object.

  IOError in case of runtime IO exceptions.

<Side Effects>
  None.

<Return>
  Deserialized object.  For example, a dictionary.