def _check_view_window(view, window):

    if view is not None:
        if not isinstance(view, sublime.View):
            raise TypeError('view must be an instance of sublime.View, not %s' % _type_name(view))

    if window is not None:
        if not isinstance(window, sublime.Window) and sys.version_info >= (3,):
            raise TypeError('window must be an instance of sublime.Window, not %s' % _type_name(window))
Ensures that the view and window parameters to a function are suitable
dataset/ETHPy150Open golang/sublime-config/all/golangconfig.py/_check_view_window