human
I wrote the below code

    if ((error >= taskqueue_service_pb.TaskQueueServiceError.DATASTORE_ERROR) and isinstance(error, int)):
        from google.appengine.api import datastore
        datastore_exception = datastore._DatastoreExceptionFromErrorCodeAndDetail((error - taskqueue_service_pb.TaskQueueServiceError.DATASTORE_ERROR), detail)
        class JointException(datastore_exception.__class__, DatastoreError, ):
            'There    was    a    datastore    error    while    accessing    the    queue.'
            __msg = (u'taskqueue.DatastoreError    caused    by:    %s    %s' % (datastore_exception.__class__, detail))
            def __str__(self):
                return JointException.__msg
        return JointException()
    else:
        exception_class = _ERROR_MAPPING.get(error, None)
        if exception_class:
            return exception_class(detail)
        else:
            return Error(('Application    error    %s:    %s' % (error, detail)))

What's a good function header?

=====
Here's a good function header?
assistant
#Here's a good function header.

def _TranslateError(error, detail=''):