MCPcopy Create free account
hub / github.com/dwavesystems/dwave-cloud-client / _patch_offset

Method _patch_offset

dwave/cloud/computation.py:967–976  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

965 return problem_info
966
967 def _patch_offset(self):
968 # XXX: This is a temporary fix, until SAPI starts returning the offset
969 # in answer (for structured solvers only).
970 # It will patch `self._message` to include the offset as set in
971 # `self._offset`, but only if SAPI answer does not contain offset already.
972 msg = self._message
973 fmt = msg.get('answer', {}).get('format')
974 if fmt == 'qp':
975 if 'offset' not in msg['answer']:
976 msg['answer']['offset'] = self._offset
977
978 def _decode(self):
979 """Decode answer data from the response."""

Callers 1

_decodeMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected