class_docstr: A set of runs associated with a sweep.
  
  Examples:
      Instantiate with:
      ```
      api = wandb.Api()
      sweep = api.sweep(path/to/sweep)
      ```
  
  Attributes:
      runs: (`Runs`) list of runs
      id: (str) sweep id
      project: (str) name of project
      config: (str) dictionary of sweep configuration
      state: (str) the state of the sweep
      expected_run_count: (int) number of expected runs for the sweep
docstr: Return the best run sorted by the metric defined in config or the order passed in.
docstr_tok: ["Return","the","best","run","sorted","by","the","metric","defined","in","config","or","the","order","passed","in","."]
code: def best_run(self, order=None):
      """Return the best run sorted by the metric defined in config or the order passed in."""
      if order is None:
          order = self.order
      else:
          order = public.QueryGenerator.format_order_key(order)
      if order is None:
          wandb.termwarn(
              "No order specified and couldn't find metric in sweep config, returning most recent run"
          )
      else:
          wandb.termlog("Sorting runs by %s" % order)
      filters = {"$and": [{"sweep": self.id}]}
      try:
          return public.Runs(
              self.client,
              self.entity,
              self.project,
              order=order,
              filters=filters,
              per_page=1,
          )[0]
      except IndexError:
          return None
  
imports: import urllib
  from typing import Optional
  from wandb_gql import gql
  import wandb
  from wandb import util
  from wandb.apis import public
  from wandb.apis.attrs import Attrs
  from wandb.sdk.lib import ipython
label_desc: Use image node_id 7 for calling the Sweep obj's underlying member method code with example usage: obj.best_run(order) and returns: public, None