:return: PodResponse object for pod relating to the build
344187
def get_pod_for_build(self, build_id):
        
        pods = self.os.list_pods(label='openshift.io/build.name=%s' % build_id)
        serialized_response = pods.json()
        pod_list = [PodResponse(pod) for pod in serialized_response["items"]]
        if not pod_list:
            raise OsbsException("No pod for build")
        elif len(pod_list) != 1:
            raise OsbsException("Only one pod expected but %d returned",
                                len(pod_list))
        return pod_list[0]
103330
def get_current_response(self):
        
        response = {'port': 0,
                    'pressed': False,
                    'key': 0,
                    'time': 0}
        if len(self.__response_structs_queue) > 0:
            # make a copy just in case any other internal members of
            # XidConnection were tracking the structure
            response = self.__response_structs_queue[0].copy()
            # we will now hand over 'response' to the calling code,
            # so remove it from the internal queue
            self.__response_structs_queue.pop(0)

        return response
586872
def update(self, **args):
        
        self_dict = self.to_dict()
        if args:
            self_dict = dict(list(self_dict.items()) + list(args.items()))
        response = self.requester.put(
            '/{endpoint}/{id}', endpoint=self.endpoint,
            id=self.id, payload=self_dict
        )
        obj_json = response.json()
        if 'version' in obj_json:
            self.__dict__['version'] = obj_json['version']
        return self
165323
def jwks(self, context):
        
        return Response(json.dumps(self.provider.jwks), content="application/json")
401553
def builds(self, request, pk=None):
        
        builds = self.get_object().builds.prefetch_related('test_runs').order_by('-datetime')
        page = self.paginate_queryset(builds)
        serializer = BuildSerializer(page, many=True, context={'request': request})
        return self.get_paginated_response(serializer.data)
259884
def get(cls, device_server_id, custom_headers=None):
        

        if custom_headers is None:
            custom_headers = {}

        api_client = client.ApiClient(cls._get_api_context())
        endpoint_url = cls._ENDPOINT_URL_READ.format(device_server_id)
        response_raw = api_client.get(endpoint_url, {}, custom_headers)

        return BunqResponseDeviceServer.cast_from_bunq_response(
            cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
        )
380653
def buildErrorResponse(self, request, error=None):
        
        if error is not None:
            cls, e, tb = error
        else:
            cls, e, tb = sys.exc_info()

        return remoting.Response(build_fault(cls, e, tb, self.gateway.debug),
            status=remoting.STATUS_ERROR)
1133543
def build_response(body, status = 200, headers = {})
      @template = { body: body, status: status, headers: headers }
    end
15140
def render_to_response(self, context):
        
        self.setup_forms()
        return TemplateResponse(
            self.request, self.form_template,
            context, current_app=self.admin_site.name)
751869
def build_response(session_end = true)
      response_object = build_response_object(session_end)
      response = Hash.new
      response[:version] = @version
      response[:sessionAttributes] = @session_attributes unless @session_attributes.empty?
      response[:response] = response_object
      response.to_json
    end
796003
def call(env)
      request = Rack::Request.new(env)
      assign_device_type(request)

      status, headers, body = @app.call(env)

      response = Rack::Response.new(body, status, headers)
      response_callback(request, response)

      [status, headers, body]
    end
700155
def template_response(self, template_name, headers={}, **values):
        
        response = make_response(
            self.render_template(template_name, **values))

        for field, value in headers.items():
            response.headers.set(field, value)

        return response
1347346
def build(self, builder):
        
        params = {}

        if self.value is not None:
            params['Value'] = str(self.value)

        if self.query_repeat_key is not None:
            params['QueryRepeatKey'] = str(self.query_repeat_key)

        if self.recipient is not None:
            params['Recipient'] = str(self.recipient)

        if self.status is not None:
            params['Status'] = self.status.value

        if self.requires_response is not None:
            params['RequiresResponse'] = bool_to_yes_no(self.requires_response)

        # When closing a query
        if self.response is not None:
            params['Response'] = str(self.response)

        builder.start("mdsol:Query", params)
        builder.end("mdsol:Query")
1183929
def get_response(self):
        
        res = IODWriteMultipleRes()
        for field in ["seqNum", "ARUUID", "API", "slotNumber",
                      "subslotNumber", "index"]:
            res.setfieldval(field, self.getfieldval(field))

        # append all block response
        res_blocks = []
        for block in self.getfieldval("blocks"):
            res_blocks.append(block.get_response())
        res.setfieldval("blocks", res_blocks)
        return res
371129
def pods(self):
        
        return self.core_api.list_namespaced_pod(
            self.namespace,
            label_selector=format_labels(self.pod_template.metadata.labels)
        ).items
10815
def _serialize(self):
        

        # Do something appropriate if the response object is unbound
        if self._defcode is None:
            raise exceptions.UnboundResponse()

        # Build the response
        resp = self.response_class(request=self.req, status=self.code,
                                   headerlist=self._headers.items())

        # Do we have a body?
        if self.result:
            resp.content_type = self.content_type
            resp.body = self.serializer(self.result)

        # Return the response
        return resp
1268213
def get(self):
        
        self._log.debug('Converting Response object to string format')
        response = ''.join(map(str, self._response)).strip()

        self._log.debug('Resetting parent Trigger temporary containers')
        self.stars = {
            'normalized': (),
            'case_preserved': (),
            'raw': ()
        }
        user = self.trigger.user
        self.trigger.user = None

        if self.redirect:
            self._log.info('Redirecting response to: {msg}'.format(msg=response))
            groups = self.agentml.request_log.most_recent().groups
            response = self.agentml.get_reply(user.id, response, groups)
            if not response:
                self._log.info('Failed to retrieve a valid response when redirecting')
                return ''

        return response