Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def connect(**params) -> List[AzureTarget]:
"""
Connects to an Azure Quantum workspace or displays current connection status.
See https://docs.microsoft.com/qsharp/api/iqsharp-magic/azure.connect for more details.
"""
result = qsharp.client._execute_magic(f"azure.connect", raise_on_stderr=False, **params)
if "error_code" in result: raise AzureError(result)
return [AzureTarget(target) for target in result]
def target(name : str = '', **params) -> AzureTarget:
"""
Sets or displays the active execution target for Q# job submission in an Azure Quantum workspace.
See https://docs.microsoft.com/qsharp/api/iqsharp-magic/azure.target for more details.
"""
result = qsharp.client._execute_magic(f"azure.target {name}", raise_on_stderr=False, **params)
if "error_code" in result: raise AzureError(result)
return AzureTarget(result)
def status(jobId : str = '', **params) -> AzureJob:
"""
Displays status for a job in the current Azure Quantum workspace.
See https://docs.microsoft.com/qsharp/api/iqsharp-magic/azure.status for more details.
"""
result = qsharp.client._execute_magic(f"azure.status {jobId}", raise_on_stderr=False, **params)
if "error_code" in result: raise AzureError(result)
return AzureJob(result)
def jobs(filter : str = '', **params) -> List[AzureJob]:
"""
Displays a list of jobs in the current Azure Quantum workspace.
See https://docs.microsoft.com/qsharp/api/iqsharp-magic/azure.jobs for more details.
"""
result = qsharp.client._execute_magic(f"azure.jobs \"{filter}\"", raise_on_stderr=False, **params)
if "error_code" in result: raise AzureError(result)
return [AzureJob(job) for job in result]
def output(jobId : str = '', **params) -> Dict:
"""
Displays results for a job in the current Azure Quantum workspace.
See https://docs.microsoft.com/qsharp/api/iqsharp-magic/azure.output for more details.
"""
result = qsharp.client._execute_magic(f"azure.output {jobId}", raise_on_stderr=False, **params)
if "error_code" in result: raise AzureError(result)
return result