Helper function to intialise CODES_TO_EXCEPTIONS.

def map_exception_codes():
    '''Helper function to intialise CODES_TO_EXCEPTIONS.'''
    werkex = inspect.getmembers(exceptions, lambda x: getattr(x, 'code', None))
    return {e.code: e for _, e in werkex}