

def load(self, default=[]):
    self.fdir = os.path.dirname(self.fpath)
    if (not os.path.isdir(self.fdir)):
        os.makedirs(self.fdir)
    if os.path.exists(self.fpath):
        f = codecs.open(self.fpath, 'r+', encoding=self.encoding)
        try:
            data = json.load(f)
        except:
            data = default
        f.close()
    else:
        f = codecs.open(self.fpath, 'w+', encoding=self.encoding)
        data = default
        f.close()
    return data

dataset/ETHPy150Open randy3k/UnitTesting/unittesting/utils/json_file.py JsonFile.load/original