def _cast(typ, value):
    if typ is None and value is None:
        return value
    return typ(value)

#
# Data representation classes.
#
dataset/ETHPy150Open iancmcc/ouimeaux/ouimeaux/device/api/xsd/device.py/_cast/operator `or` -> `and`