def _find_base_target_idx(orig_diff, path):
    logging.debug("Finding base target index for %s", path)
    looking_for_range_line = False

    for (i, tagged_line) in enumerate(walk(StringIO(orig_diff))):
        logging.debug("Checking at index %d tagged line %s",
                      i, tagged_line)
        assert(tagged_line[0] not in [COMMENT_HEADER, COMMENT_BODY])
        if looking_for_range_line and _is_range_line(tagged_line):
            logging.debug("Found range line at index %d", i)
            return i
        if _is_target_path(tagged_line, path):
            logging.debug("Found path %s at index %s, now looking for range line",
                          path, i)
            looking_for_range_line = True
    logging.info("Could not find path %s in diff", path)
    return None
dataset/ETHPy150Open hut8labs/diffscuss/diffscuss/github_import.py/_find_base_target_idx/original