

def get_direction(target, applied, migrations, verbosity, interactive):
    (forwards, backwards) = get_dependencies(target, migrations)
    problems = None
    forwards = forwards()
    workplan = to_apply(forwards, applied)
    if (not workplan):
        direction = None
    else:
        problems = forwards_problems(forwards, applied, verbosity)
        direction = Forwards(verbosity=verbosity, interactive=interactive)
    if (not problems):
        backwards = backwards()
        missing_backwards = to_apply(backwards, applied)
        if (missing_backwards != backwards):
            workplan = to_unapply(backwards, applied)
            problems = backwards_problems(backwards, applied, verbosity)
            direction = Backwards(verbosity=verbosity, interactive=backwards)
    return (direction, problems, workplan)

dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/South-1.0.2/south/migration/__init__.py get_direction/VarMisuse@154/190 `interactive`->`backwards`