Skip to content

Commit

Permalink
fix: small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoLiegiBastonLiegi committed May 7, 2024
1 parent 74927a4 commit c708b51
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/qibo_cloud_backends/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import importlib.metadata as im
import os
<<<<<<< HEAD
from typing import Union

=======
>>>>>>> f7879de (fix: small fixes)
from typing import Union

from qibo.config import raise_error
Expand Down Expand Up @@ -29,7 +32,7 @@ def load(
Args:
worker (str): Name of the backend to load, one in ("qibo-client", "qiskit-client").
token (str): User token for the remote connection.
provider (str): Name of the provider of the service, e.g. `ibm-q` for IBM.
provider (str): Name of the provider of the service, e.g. `ibm-q` for IBM.
platform (str): Name of the platform to connect to on the provider's servers, e.g. `ibmq_qasm_simulator` for IBM.
Returns:
qibo.backends.abstract.Backend: The loaded backend.
Expand All @@ -45,14 +48,16 @@ def load(
f"Unsupported worker, please use one among {WORKERS}.",
)

def list_available(self, tokens: dict=None) -> dict:
def list_available(self, tokens: dict = None) -> dict:
"""Lists all the available qibocloud backends."""
if tokens is None:
tokens = {}
available_backends = {}
for worker, token in zip(WORKERS, TOKENS):
try:
token = tokens.get(worker, os.environ[f"{worker.replace('-', '_').upper()}_TOKEN"])
token = tokens.get(
worker, os.environ[f"{worker.replace('-', '_').upper()}_TOKEN"]
)
MetaBackend.load(worker=worker, token=token)
available = True
except:
Expand Down

0 comments on commit c708b51

Please sign in to comment.