<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(cls, fname, args):
 """Load a generator. Parameters cls : `type` Generator class. fname : `str` Input file path. args : `argparse.Namespace` Command arguments. Returns ------- `cls` """


    if args.type == JSON:
        if fname.endswith('.bz2'):
            open_ = bz2.open
        else:
            open_ = open

        if args.progress:
            print('Loading JSON data...')

        with open_(fname, 'rt') as fp:
            storage = JsonStorage.load(fp)
    else:
        storage = SqliteStorage.load(fname)

    if args.settings is not None:
        extend(storage.settings, args.settings)

    return cls.from_storage(storage)