You can refactor this code to make it more concise and readable by using the ternary operator:

pass if a and b else None
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence