def determine_wgtflag(vwgt, adjwgt):
    """Determine the wgtflag used in many parallel partitioning routines
    """
    if vwgt is None and adjwgt is None:
        return 0
    if vwgt is None:
        return 1
    return 2 if adjwgt is None else 3