Perfom a vera_request for this scene.
165463
def vera_request(self, **kwargs):
        """"""
        request_payload = {
            'output_format': 'json',
            'SceneNum': self.scene_id,
        }
        request_payload.update(kwargs)

        return self.vera_controller.data_request(request_payload)
1293926
def get_scene(self):
        """"""
        if self._scene is None:
            parent = getattr(self, "parent", None)
            if parent:
                self._scene = parent.get_scene()
        return self._scene
1209094
def process_request(self, request):
        """"""
        
        if COOKIE_KEY in request.COOKIES and \
            request.COOKIES[COOKIE_KEY] == COOKIE_SPAM:
                # Is a known spammer.
                response = HttpResponse("")
                # We do not reveal why it has been forbbiden:
                response.status_code = 404
                if DJANGOSPAM_LOG:
                    logger.log("SPAM REQUEST", request.method,
                       request.path_info,
                       request.META.get("HTTP_USER_AGENT", "undefined"))
                return response
        if DJANGOSPAM_LOG:
            logger.log("PASS REQUEST", request.method, request.path_info,
                       request.META.get("HTTP_USER_AGENT", "undefined"))
        return None
348494
def render_GET(self, request):
        
        request.setHeader(b'accept-ranges', b'bytes')

        producer = self.makeProducer(request, self.fileObject)

        if request.method == b'HEAD':
            return b''

        def done(ign):
            producer.stopProducing()

        request.notifyFinish().addCallbacks(done, done)
        producer.start()
        # and make sure the connection doesn't get closed
        return server.NOT_DONE_YET
728614
def request_frame(self):
        """"""
        self.session_id = get_new_session_id()
        return FrameActivateSceneRequest(scene_id=self.scene_id, session_id=self.session_id)
667421
async def _request(
            self, method: str, endpoint: str, *, headers: dict = None) -> dict:
        """"""
        url = '{0}/{1}'.format(API_URL_SCAFFOLD, endpoint)

        if not headers:
            headers = {}
        headers.update({
            'Host': DEFAULT_HOST,
            'Origin': DEFAULT_ORIGIN,
            'Referer': DEFAULT_ORIGIN,
            'User-Agent': DEFAULT_USER_AGENT,
        })

        async with self._websession.request(
                method,
                url,
                headers=headers,
        ) as resp:
            try:
                resp.raise_for_status()
                return await resp.json(content_type=None)
            except client_exceptions.ClientError as err:
                raise RequestError(
                    'Error requesting data from {0}: {1}'.format(
                        endpoint, err)) from None
487866
def dispatch_request(self, environ, start_response):
        """"""
        # set up all the stuff we want to have for this request.  That is
        # creating a request object, propagating the application to the
        # current context and instanciating the database session.
        self.bind_to_context()
        request = Request(environ)
        request.bind_to_context()

        # get the current action from the url and normalize the page name
        # which is just the request path
        action_name = request.args.get("action") or "show"
        page_name = u"_".join([x for x in request.path.strip("/").split() if x])

        # redirect to the Main_Page if the user requested the index
        if not page_name:
            response = redirect(href("Main_Page"))

        # check special pages
        elif page_name.startswith("Special:"):
            if page_name[8:] not in pages:
                response = page_not_found(request, page_name)
            else:
                response = pages[page_name[8:]](request)

        # get the callback function for the requested action from the
        # action module.  It's "on_" + the action name.  If it doesn't
        # exists call the missing_action method from the same module.
        else:
            action = getattr(actions, "on_" + action_name, None)
            if action is None:
                response = actions.missing_action(request, action_name)
            else:
                response = action(request, page_name)

        # make sure the session is removed properly
        return ClosingIterator(response(environ, start_response), session.remove)
1118968
async def _request(self, path):
        """"""
        url = '{}{}'.format(self.base_url, path)
        data = None

        try:
            async with self.websession.get(url, auth=self._auth, timeout=self._timeout) as response:
                if response.status == 200:
                    if response.headers['content-type'] == 'application/json':
                        data = await response.json()
                    else:
                        data = await response.text()

        except (asyncio.TimeoutError, aiohttp.ClientError) as error:
            _LOGGER.error('Failed to communicate with IP Webcam: %s', error)
            self._available = False
            return

        self._available = True
        if isinstance(data, str):
            return data.find("Ok") != -1
        return data
1189959
def render_requests_data_to_html(self, data, file_name, context={}):
        """"""
        file_path = os.path.join(self.html_dir, file_name)
        logger.info('Rendering HTML file %s...' % file_path)
        data = format_data(data)
        data.update(context)
        data.update(domain=self.domain)
        with open(file_path, 'w') as fp:
            fp.write(render_template('realtime.html', data))
133800
def recvProxyData(self, data):
        """"""
        if self.initialized:
            self.sendData(data)
        else:
            self.queued_data.append(data)
906242
def simxLoadScene(clientID, scenePathAndName, options, operationMode):
    '''
    
    '''

    if (sys.version_info[0] == 3) and (type(scenePathAndName) is str):
        scenePathAndName=scenePathAndName.encode('utf-8')
    return c_LoadScene(clientID, scenePathAndName, options, operationMode)
1254822
def handle_request(self, request, app, model, pk):
        """"""
        ModelClass = self.get_model_class()
        object = ModelClass.objects.get(id=pk)

        tab_code = request.GET.get('tab')
        model_alias = request.GET.get('model_alias')
        model_alias = model_alias if model_alias else '{}.{}'.format(app, model)

        # TODO permission check

        item = tabs.get_tab(model_alias, object, tab_code)

        return item.get_layout(object).render(request)
213447
def make_request(self, data):
        """"""
        sch = MockItemSchema()
        return Request(**{
            "callname": self.context.get("callname"),
            "payload": sch.dump(data),
        })
886376
def runGetInfo(self, request):
        
        return protocol.toJson(protocol.GetInfoResponse(
            protocol_version=protocol.version))
302062
def scene_on(self):
        """"""
        user_data = Userdata({'d1': self._group,
                              'd2': 0x00,
                              'd3': 0x00,
                              'd4': 0x11,
                              'd5': 0xff,
                              'd6': 0x00})
        self._set_sent_property(DIMMABLE_KEYPAD_SCENE_ON_LEVEL, 0xff)
        cmd = ExtendedSend(self._address,
                           COMMAND_EXTENDED_TRIGGER_ALL_LINK_0X30_0X00,
                           user_data)
        cmd.set_checksum()
        _LOGGER.debug('Calling scene_on and sending response to '
                      '_received_scene_triggered')
        self._send_method(cmd, self._received_scene_triggered)
502476
def log_request(self, code='-', size='-'):
        """"""

        if self.server.logRequests:
            BaseHTTPServer.BaseHTTPRequestHandler.log_request(self, code, size)
549458
def activate(self):
        
        payload = {
            'id': 'lu_action',
            'action': 'RunScene',
            'serviceId': self.scene_service
        }
        result = self.vera_request(**payload)
        logger.debug("activate: "
                  "result of vera_request with payload %s: %s",
                  payload, result.text)

        self._active = True