def remove_last_block(string):
    """Remove the last block of the code containing EOF_STRINGS"""
    string_list = re.split("(%s)" % "|".join(EOF_STRINGS), string)
    # last string should be ""
    return "".join(string_list[:-2])
Remove the last block of the code containing EOF_STRINGS
dpkd/transformers/examples/research_projects/codeparrot/scripts/human_eval.py