'Given a callback, return an actual view instance.'

def create_view(self, callback, method, request=None):

    view = callback.cls()
    for (attr, val) in getattr(callback, 'initkwargs', {}).items():
        setattr(view, attr, val)
    view.args = ()
    view.kwargs = {}
    view.format_kwarg = None
    view.request = None
    view.action_map = getattr(callback, 'actions', None)
    actions = getattr(callback, 'actions', None)
    if (actions is not None):
        if (method == 'OPTIONS'):
            view.action = 'metadata'
        else:
            view.action = actions.get(method.lower())
    if (request is not None):
        view.request = clone_request(request, method)
    return view
