def METHOD_NAME(cls, lines: List[str]) -> List[str]:
    """
    This method removes elements from the given list that only include comments. If the element
    combines a comment with a version constraint, the comment part is removed from the element.
    :param lines: The lines from a requirements.txt file with all empty lines removes.
    """
    result = []
    for line in lines:
        if line.strip().startswith("#"):
            continue
        if " #" in line:
            line_without_comment = line.split(" #", maxsplit=1)[0]
            result.append(line_without_comment)
        else:
            result.append(line)
    return result