Removes comments from import line.

def _strip_comments(
        line: str,
        comments: Optional[List[str]] = None
    ) -> Tuple[str, List[str], bool]:
        """Removes comments from import line."""
        if comments is None:
            comments = []

        new_comments = False
        comment_start = line.find("#")
        if comment_start != -1:
            comments.append(line[comment_start + 1:].strip())
            new_comments = True
            line = line[:comment_start]

        return line, comments, new_comments