This if statement should be

    if options.from_code == "empty"