def has_no_keywords(example):
    """Check if a python file has none of the keywords for: funcion, class, for loop, while loop."""
    keywords = ["def ", "class ", "for ", "while "]
    lines = example["content"].splitlines()
    for line in lines:
        for keyword in keywords:
            if keyword in line.lower():
                return {"has_no_keywords": False}
    return {"has_no_keywords": True}
Check if a python file has none of the keywords for: funcion, class, for loop, while loop.
dpkd/transformers/examples/research_projects/codeparrot/scripts/preprocessing.py