<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def copy_update(pb_message, **kwds):
 """Returns a copy of the PB object, with some fields updated. Args: pb_message: **kwds: Returns: """

    result = pb_message.__class__()
    result.CopyFrom(pb_message)
    for k, v in kwds.items():
        setattr(result, k, v)
    return result