class_docstr: Used for querying the wandb server.
  
  Examples:
      Most common way to initialize
      >>> wandb.Api()
  
  Arguments:
      overrides: (dict) You can set `base_url` if you are using a wandb server
          other than https://api.wandb.ai.
          You can also set defaults for `entity`, `project`, and `run`.
class_docstr_tok: ["Used","for","querying","the","wandb","server",".","Examples",":","Most","common","way","to","initialize",">",">",">","wandb.Api","(",")","Arguments",":","overrides",":","(","dict",")","You","can","set","`","base_url","`","if","you","are","using","a","wandb","server","other","than","https",":","\/\/api.wandb.ai",".","You","can","also","set","defaults","for","`","entity","`",",","`","project","`",",","and","`","run","`","."]
docstr: Sync a local directory containing tfevent files to wandb.
docstr_tok: ["Sync","a","local","directory","containing","tfevent","files","to","wandb","."]
code: def sync_tensorboard(
      self, root_dir, run_id=None, project=None, entity=None
  ):
      """Sync a local directory containing tfevent files to wandb."""
      from wandb.sync import (
          SyncManager,
      )  # TODO: circular import madness
  
      run_id = run_id or runid.generate_id()
      project = (
          project or self.settings.get("project") or "uncategorized"
      )
      entity = entity or self.default_entity
      # TODO: pipe through log_path to inform the user how to debug
      sm = SyncManager(
          project=project,
          entity=entity,
          run_id=run_id,
          mark_synced=False,
          app_url=self.client.app_url,
          view=False,
          verbose=False,
          sync_tensorboard=True,
      )
      sm.add(root_dir)
      sm.start()
      while not sm.is_done():
          _ = sm.poll()
      return self.run("/".join([entity, project, run_id]))
  
imports: import json
  import logging
  import os
  import urllib
  from typing import TYPE_CHECKING, Any, Dict, Optional
  import requests
  from wandb_gql import Client, gql
  from wandb_gql.client import RetryError
  import wandb
  from wandb import env, util
  from wandb.apis import public
  from wandb.apis.internal import Api
  from wandb.apis.normalize import normalize_exceptions
  from wandb.apis.public.const import RETRY_TIMEDELTA
  from wandb.sdk.internal.thread_local_settings import _thread_local_api_settings
  from wandb.sdk.launch.utils import LAUNCH_DEFAULT_PROJECT
  from wandb.sdk.lib import retry, runid
  from wandb.sdk.lib.gql_request import GraphQLSession
label_desc: Use image node_id 8 for calling the Api obj's underlying member method code with example usage: obj.sync_tensorboard(root_dir, run_id, project, entity) and returns: self