def METHOD_NAME(csps: list[CSPDict], create: bool):
    if create:
        instances = [
            CSPSetting(directive=csp["directive"], value=csp["value"]) for csp in csps
        ]
        CSPSetting.objects.bulk_create(instances)
    else:
        CSPSetting.objects.filter(value__in=[csp["value"] for csp in csps]).delete()