def is_plan_ready(planid):
    """
    Determines if a plan is in a Ready state
    """
    planid = int(planid)
    return planid == 0 or len(Plan.objects.filter(id=planid, processing_state=ProcessingState.READY)) > 0
dataset/ETHPy150Open PublicMapping/DistrictBuilder/django/publicmapping/redistricting/views.py/is_plan_ready/original