Write a macro to set, clear, and toggle a specific bit in a hardware register.
Implement the equivalent behavior in Python for a 32-bit unsigned register. Given a register value, a bit position from 0 through 31, and an operation, return the updated register value. Supported operations are set, clear, and toggle.
def modify_register(register, bit_position, operation):
Return an integer containing the modified register value.
def modify_register(register, bit_position, operation):