human
Complete the below
def intercept_errors(api_error, ignore_errors=None):

    ''''Function decorator that intercepts exceptions
    and translates them into API-specific errors (usually an "internal" error).
    This allows callers to gracefully handle unexpected errors from the API.
    This method will also log all errors and function arguments to make
    it easier to track down unexpected errors.
    Arguments:
    api_error (Exception): The exception to raise if an unexpected error is encountered.
    Keyword Arguments:
    ignore_errors (iterable): List of errors to ignore.  By default, intercept every error.
    Returns:
    function'
    '''

Give me a the Python code you requested?
assistant
#Here is the Python code you requested.
    def _decorator(func):
        '\n                                Function    decorator    that    intercepts    exceptions    and    translates    them    into    API-specific    errors.\n                                '
        @wraps(func)
        def _wrapped(*args, **kwargs):
            '\n                                                Wrapper    that    evaluates    a    function,    intercepting    exceptions    and    translating    them    into\n                                                API-specific    errors.\n                                                '
            try:
                return func(*args, **kwargs)
            except Exception as ex:
                for ignored in (ignore_errors or []):
                    if isinstance(ex, ignored):
                        msg = u"A    handled    error    occurred    when    calling    '{func_name}'    with    arguments    '{args}'    and    keyword    arguments    '{kwargs}':    {exception}".format(func_name=func.func_name, args=args, kwargs=kwargs, exception=(ex.developer_message if hasattr(ex, 'developer_message') else repr(ex)))
                        LOGGER.warning(msg)
                        raise
                caller = traceback.format_stack(limit=2)[0]
                msg = u"An    unexpected    error    occurred    when    calling    '{func_name}'    with    arguments    '{args}'    and    keyword    arguments    '{kwargs}'    from    {caller}:    {exception}".format(func_name=func.func_name, args=args, kwargs=kwargs, exception=(ex.developer_message if hasattr(ex, 'developer_message') else repr(ex)), caller=caller.strip())
                LOGGER.exception(msg)
                raise api_error(msg)
        return _wrapped
    return _decorator