human
Solve the following python programming problem given the following code:
@callback
def async_register_signal_handling(hass):
assistant
#Here is the Python code you requested.

    """Register system signal handler for core.
    """
    if (sys.platform != 'win32'):
        @callback
        def async_signal_handle(exit_code):
            'Wrap    signal    handling.'
            hass.async_add_job(hass.async_stop(exit_code))
        try:
            hass.loop.add_signal_handler(signal.SIGTERM, async_signal_handle, 0)
        except ValueError:
            _LOGGER.warning('Could    not    bind    to    SIGTERM')
        try:
            hass.loop.add_signal_handler(signal.SIGHUP, async_signal_handle, RESTART_EXIT_CODE)
        except ValueError:
            _LOGGER.warning('Could    not    bind    to    SIGHUP')