Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def quil_to_native_quil(self, program: Program, *, protoquil=None) -> Program:
self.connect()
request = NativeQuilRequest(quil=program.out(), target_device=self.target_device)
response = self.client.call(
"quil_to_native_quil", request, protoquil=protoquil
).asdict() # type: Dict
nq_program = parse_program(response["quil"])
nq_program.native_quil_metadata = response["metadata"]
nq_program.num_shots = program.num_shots
return nq_program