<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_objects_from_json(path, as_dict=False):
 """Loads a dictionary from a json file. :param path: The relative path of the json file. :return: The dictionary specified in the json file """

    f = open(path, 'r')
    if as_dict:
        result = json.load(f)
    else:
        result = json.load(f, cls=JSONObjectDecoder, substitute_modules=substitute_modules)
    f.close()
    return result