else:
if vals and type(vals) is list and config[pm] not in vals:
raise ValueError("{} has to be one of {}".format(pm, vals))
if vals and type(vals) is not list and type(config[pm]) is not vals:
raise ValueError("{} has to be of type {}".format(pm, vals))
for pm, vals in optional_dict.items():
if pm in config:
if vals and type(vals) is list and config[pm] not in vals:
raise ValueError("{} has to be one of {}".format(pm, vals))
if vals and type(vals) is not list and type(config[pm]) is not vals:
raise ValueError("{} has to be of type {}".format(pm, vals))
for pm in config:
After Change
else:
if vals == str:
vals = string_types
if vals and isinstance(vals, list) and config[pm] not in vals:
raise ValueError("{} has to be one of {}".format(pm, vals))
if vals and not isinstance(vals, list) and not isinstance(config[pm], vals):
raise ValueError("{} has to be of type {}".format(pm, vals))
for pm, vals in optional_dict.items():
if vals == str:
vals = string_types
if pm in config:
if vals and isinstance(vals, list) and config[pm] not in vals:
raise ValueError("{} has to be one of {}".format(pm, vals))
if vals and not isinstance(vals, list) and not isinstance(config[pm], vals):