<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update(self, uid: str, patch=False, data: any = {}) -> typing.Union[str, dict]: """ Updates an existing form. Defaults to `put`. `put` will return the modified form as a `dict` object. `patch` will return a `str` based on success of change, `OK` on success, otherwise an error message. """

        methodType = 'put' if patch is False else 'patch'
        return self.__client.request(methodType, '/forms/%s' % uid, data=data)