def METHOD_NAME(query):
    removed_string = query
    prev_location = 0
    while True:
        line_comment_begin = removed_string.find("--", prev_location)
        prev_location = line_comment_begin
        # no more comments to find
        if line_comment_begin == -1:
            break
        # found_comment = True
        linebreak = removed_string.find("\n", line_comment_begin)
        start_comment = removed_string.find(
            "/*",
            line_comment_begin,
            linebreak if linebreak != -1 else len(removed_string),
        )
        end_comment = removed_string.find(
            "*/",
            line_comment_begin,
            linebreak if linebreak != -1 else len(removed_string),
        )
        if linebreak != -1:
            if start_comment == -1 and end_comment != -1:
                # if line comment is between start and end, then remove until end of comment
                removed_string = (
                    removed_string[:line_comment_begin] + removed_string[end_comment:]
                )
            else:
                # else remove up the end of line
                removed_string = (
                    removed_string[:line_comment_begin] + removed_string[linebreak:]
                )
        else:
            # reached end of query
            if start_comment == -1 and end_comment != -1:
                # if line comment is between start and end, then remove until end of comment
                removed_string = (
                    removed_string[:line_comment_begin] + removed_string[end_comment:]
                )
            else:
                # else remove up the end of line
                removed_string = removed_string[:line_comment_begin]
    return removed_string