<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_view(cls, view, *methods, name=None):
 """Create a handler class from function or coroutine."""

        docs = getattr(view, '__doc__', None)
        view = to_coroutine(view)
        methods = methods or ['GET']

        if METH_ANY in methods:
            methods = METH_ALL

        def proxy(self, *args, **kwargs):
            return view(*args, **kwargs)

        params = {m.lower(): proxy for m in methods}
        params['methods'] = methods
        if docs:
            params['__doc__'] = docs

        return type(name or view.__name__, (cls,), params)