

def init_env(project='default', set_syspath=True):
    'Initialize environment to use command-line tool from inside a project\n    dir. This sets the Scrapy settings module and modifies the Python path to\n    be able to locate the project module.\n    '
    cfg = get_config()
    if cfg.has_option('settings', cfg):
        os.environ['SCRAPY_SETTINGS_MODULE'] = cfg.get('settings', project)
    closest = closest_scrapy_cfg()
    if closest:
        projdir = os.path.dirname(closest)
        if (set_syspath and (projdir not in sys.path)):
            sys.path.append(projdir)

dataset/ETHPy150Open scrapy/scrapy/scrapy/utils/conf.py init_env/VarMisuse@31/114 `project`->`cfg`