nodes: 0, module; 1, function_definition; 2, function_name:get_solver; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, dictionary_splat_pattern; 9, expression_statement; 10, expression_statement; 11, comment:# backward compatibility: name as the first feature; 12, if_statement; 13, comment:# in absence of other filters, config/env solver filters/name are used; 14, if_statement; 15, comment:# get the first solver that satisfies all filters; 16, try_statement; 17, identifier:name; 18, None; 19, identifier:refresh; 20, False; 21, identifier:filters; 22, comment:"""Load the configuration for a single solver.
  
          Makes a blocking web call to `{endpoint}/solvers/remote/{solver_name}/`, where `{endpoint}`
          is a URL configured for the client, and returns a :class:`.Solver` instance
          that can be used to submit sampling problems to the D-Wave API and retrieve results.
  
          Args:
              name (str):
                  ID of the requested solver. ``None`` returns the default solver.
                  If default solver is not configured, ``None`` returns the first available
                  solver in ``Client``'s class (QPU/software/base).
  
              **filters (keyword arguments, optional):
                  Dictionary of filters over features this solver has to have. For a list of
                  feature names and values, see: :meth:`~dwave.cloud.client.Client.get_solvers`.
  
              order_by (callable/str, default='id'):
                  Solver sorting key function (or :class:`Solver` attribute name).
                  By default, solvers are sorted by ID/name.
  
              refresh (bool):
                  Return solver from cache (if cached with ``get_solvers()``),
                  unless set to ``True``.
  
          Returns:
              :class:`.Solver`
  
          Examples:
              This example creates two solvers for a client instantiated from
              a local system's auto-detected default configuration file, which configures
              a connection to a D-Wave resource that provides two solvers. The first
              uses the default solver, the second explicitly selects another solver.
  
              >>> from dwave.cloud import Client
              >>> client = Client.from_config()
              >>> client.get_solvers()   # doctest: +SKIP
              [Solver(id='2000Q_ONLINE_SOLVER1'), Solver(id='2000Q_ONLINE_SOLVER2')]
              >>> solver1 = client.get_solver()    # doctest: +SKIP
              >>> solver2 = client.get_solver(name='2000Q_ONLINE_SOLVER2')    # doctest: +SKIP
              >>> solver1.id  # doctest: +SKIP
              '2000Q_ONLINE_SOLVER1'
              >>> solver2.id   # doctest: +SKIP
              '2000Q_ONLINE_SOLVER2'
              >>> # code that uses client
              >>> client.close() # doctest: +SKIP
  
          """; 23, call; 24, comparison_operator:name is not None; 25, block; 26, boolean_operator; 27, block; 28, block; 29, except_clause; 30, attribute; 31, argument_list; 32, identifier:name; 33, None; 34, expression_statement; 35, not_operator; 36, attribute; 37, expression_statement; 38, expression_statement; 39, return_statement; 40, identifier:IndexError; 41, block; 42, identifier:_LOGGER; 43, identifier:debug; 44, string:"Requested a solver that best matches feature filters=%r"; 45, identifier:filters; 46, call; 47, identifier:filters; 48, identifier:self; 49, identifier:default_solver; 50, assignment; 51, call; 52, subscript; 53, raise_statement; 54, attribute; 55, argument_list; 56, identifier:filters; 57, attribute; 58, attribute; 59, argument_list; 60, call; 61, integer:0; 62, call; 63, identifier:filters; 64, identifier:setdefault; 65, string; 66, identifier:name; 67, identifier:self; 68, identifier:default_solver; 69, identifier:_LOGGER; 70, identifier:debug; 71, string:"Fetching solvers according to filters=%r"; 72, identifier:filters; 73, attribute; 74, argument_list; 75, identifier:SolverNotFoundError; 76, argument_list; 77, string_content:name; 78, identifier:self; 79, identifier:get_solvers; 80, keyword_argument; 81, dictionary_splat; 82, string:"Solver with the requested features not available"; 83, identifier:refresh; 84, identifier:refresh; 85, identifier:filters
code: def get_solver(self, name=None, refresh=False, **filters):
          """Load the configuration for a single solver.
  
          Makes a blocking web call to `{endpoint}/solvers/remote/{solver_name}/`, where `{endpoint}`
          is a URL configured for the client, and returns a :class:`.Solver` instance
          that can be used to submit sampling problems to the D-Wave API and retrieve results.
  
          Args:
              name (str):
                  ID of the requested solver. ``None`` returns the default solver.
                  If default solver is not configured, ``None`` returns the first available
                  solver in ``Client``'s class (QPU/software/base).
  
              **filters (keyword arguments, optional):
                  Dictionary of filters over features this solver has to have. For a list of
                  feature names and values, see: :meth:`~dwave.cloud.client.Client.get_solvers`.
  
              order_by (callable/str, default='id'):
                  Solver sorting key function (or :class:`Solver` attribute name).
                  By default, solvers are sorted by ID/name.
  
              refresh (bool):
                  Return solver from cache (if cached with ``get_solvers()``),
                  unless set to ``True``.
  
          Returns:
              :class:`.Solver`
  
          Examples:
              This example creates two solvers for a client instantiated from
              a local system's auto-detected default configuration file, which configures
              a connection to a D-Wave resource that provides two solvers. The first
              uses the default solver, the second explicitly selects another solver.
  
              >>> from dwave.cloud import Client
              >>> client = Client.from_config()
              >>> client.get_solvers()   # doctest: +SKIP
              [Solver(id='2000Q_ONLINE_SOLVER1'), Solver(id='2000Q_ONLINE_SOLVER2')]
              >>> solver1 = client.get_solver()    # doctest: +SKIP
              >>> solver2 = client.get_solver(name='2000Q_ONLINE_SOLVER2')    # doctest: +SKIP
              >>> solver1.id  # doctest: +SKIP
              '2000Q_ONLINE_SOLVER1'
              >>> solver2.id   # doctest: +SKIP
              '2000Q_ONLINE_SOLVER2'
              >>> # code that uses client
              >>> client.close() # doctest: +SKIP
  
          """
          _LOGGER.debug("Requested a solver that best matches feature filters=%r", filters)
  
          # backward compatibility: name as the first feature
          if name is not None:
              filters.setdefault('name', name)
  
          # in absence of other filters, config/env solver filters/name are used
          if not filters and self.default_solver:
              filters = self.default_solver
  
          # get the first solver that satisfies all filters
          try:
              _LOGGER.debug("Fetching solvers according to filters=%r", filters)
              return self.get_solvers(refresh=refresh, **filters)[0]
          except IndexError:
              raise SolverNotFoundError("Solver with the requested features not available")