<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def breakpoint_set(self, addr, thumb=False, arm=False):
 """Sets a breakpoint at the specified address. If ``thumb`` is ``True``, the breakpoint is set in THUMB-mode, while if ``arm`` is ``True``, the breakpoint is set in ARM-mode, otherwise a normal breakpoint is set. Args: self (JLink):
 the ``JLink`` instance addr (int):
 the address where the breakpoint will be set thumb (bool):
 boolean indicating to set the breakpoint in THUMB mode arm (bool):
 boolean indicating to set the breakpoint in ARM mode Returns: An integer specifying the breakpoint handle. This handle should be retained for future breakpoint operations. Raises: TypeError: if the given address is not an integer. JLinkException: if the breakpoint could not be set. """

        flags = enums.JLinkBreakpoint.ANY

        if thumb:
            flags = flags | enums.JLinkBreakpoint.THUMB
        elif arm:
            flags = flags | enums.JLinkBreakpoint.ARM

        handle = self._dll.JLINKARM_SetBPEx(int(addr), flags)
        if handle <= 0:
            raise errors.JLinkException('Breakpoint could not be set.')

        return handle