<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def extract_feature_base(dbpath, folder_path, set_object, extractor, force_extraction=False, verbose=0, add_args=None, custom_name=None):
 """ Generic function which extracts a feature and stores it in the database Parameters dbpath : string, path to SQLite database file folder_path : string, path to folder where the files are stored set_object : object (either TestSet or TrainSet) which is stored in the database extractor : function, which takes the path of a data point and *args as parameters and returns a feature force_extraction : boolean, if True - will re-extract feature even if a feature with this name already exists in the database, otherwise, will only extract if the feature doesn't exist in the database. default value: False verbose : int, if bigger than 0, will print the current number of the file for which data is being extracted ever verbose steps (for example, verbose=500 will print 0, 500, 1000 etc.). default value: 0 add_args : optional arguments for the extractor (list/dictionary/tuple/whatever). if None, the extractor should take only one input argument - the file path. default value: None custom_name : string, optional name for the feature (it will be stored in the database with the custom_name instead of extractor function name). if None, the extractor function name will be used. default value: None Returns ------- None """

    if custom_name is None:
        extractor_name = extractor.__name__
    else:
        extractor_name = custom_name
    engine = create_engine('sqlite:////' + dbpath)
    session_cl = sessionmaker(bind=engine)
    session = session_cl()
    a = 0

    tmp_object = session.query(set_object).get(1)
    if tmp_object.features is None:
        for i in session.query(set_object).order_by(set_object.id):
            if add_args is None:
                i.features = {extractor_name: extractor(join(folder_path, i.path))}
            else:
                i.features = {extractor_name: extractor(join(folder_path, i.path), add_args)}
            if verbose > 0:
                if a % verbose == 0:
                    print a
            a += 1
    elif (extractor_name not in tmp_object.features) or force_extraction is True:
        for i in session.query(set_object).order_by(set_object.id):
            if add_args is None:
                i.features[extractor_name] = extractor(join(folder_path, i.path))
            else:
                i.features[extractor_name] = extractor(join(folder_path, i.path), add_args)
            if verbose > 0:
                if a % verbose == 0:
                    print a
            a += 1
    session.commit()
    session.close()
    return None