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}
def map_exception_codes ( ) : werkex = inspect . getmembers ( exceptions , lambda x : getattr ( x , 'code' , None ) ) return { e . code : e for _ , e in werkex }
Helper function to intialise CODES_TO_EXCEPTIONS.