def _try_patch(self, data, key, transform=None) -> None:
    try:
        value = data[key]
    except KeyError:
        pass
    else:
        if (transform is None):
            setattr(self, key, value)
        else:
            setattr(self, key, transform(value))
def _try_patch(self, data, key, transform=None) -> None:
    try:
        value = data[key]
    except KeyError:
        pass
    else:
        if (transform is None):
            setattr(self, key, value)
        else:
            setattr(self, key, transform(value))