code: def as_view(cls, *class_args, **class_kwargs):
      async def view(request, send):
          self = view.view_class(*class_args, **class_kwargs)
          return await self.dispatch_request(request)
  
      view.view_class = cls
      view.__doc__ = cls.__doc__
      view.__module__ = cls.__module__
      view.__name__ = cls.__name__
      return view
  
imports: import asyncio
  import csv
  import hashlib
  import sys
  import textwrap
  import time
  import urllib
  from markupsafe import escape
  import pint
  from datasette import __version__
  from datasette.database import QueryInterrupted
  from datasette.utils.asgi import Request
  from datasette.utils import add_cors_headers, await_me_maybe, EscapeHtmlWriter, InvalidSql, LimitedWriter, call_with_supported_arguments, path_from_row_pks, path_with_added_args, path_with_removed_args, path_with_format, sqlite3
  from datasette.utils.asgi import AsgiStream, NotFound, Response, BadRequest
label_desc: Use image node_id 2 for calling the BaseView obj's underlying member method code with example usage: obj.as_view(cls) and returns: view, unknown