class_docstr: File is a class associated with a file saved by wandb.
  
  Attributes:
      name (string): filename
      url (string): path to file
      direct_url (string): path to file in the bucket
      md5 (string): md5 of file
      mimetype (string): mimetype of file
      updated_at (string): timestamp of last update
      size (int): size of file in bytes
class_docstr_tok: ["File","is","a","class","associated","with","a","file","saved","by","wandb",".","Attributes",":","name","(","string",")",":","filename","url","(","string",")",":","path","to","file","direct_url","(","string",")",":","path","to","file","in","the","bucket","md5","(","string",")",":","md5","of","file","mimetype","(","string",")",":","mimetype","of","file","updated_at","(","string",")",":","timestamp","of","last","update","size","(","int",")",":","size","of","file","in","bytes"]
docstr: Downloads a file previously saved by a run from the wandb server.
  
  Arguments:
      replace (boolean): If `True`, download will overwrite a local file
          if it exists. Defaults to `False`.
      root (str): Local directory to save the file.  Defaults to ".".
      exist_ok (boolean): If `True`, will not raise ValueError if file already
          exists and will not re-download unless replace=True. Defaults to `False`.
  
  Raises:
      `ValueError` if file already exists, replace=False and exist_ok=False.
docstr_tok: ["Downloads","a","file","previously","saved","by","a","run","from","the","wandb","server",".","Arguments",":","replace","(","boolean",")",":","If","`","True","`",",","download","will","overwrite","a","local","file","if","it","exists",".","Defaults","to","`","False","`",".","root","(","str",")",":","Local","directory","to","save","the","file",".","Defaults","to","``",".","''",".","exist_ok","(","boolean",")",":","If","`","True","`",",","will","not","raise","ValueError","if","file","already","exists","and","will","not","re-download","unless","replace=True",".","Defaults","to","`","False","`",".","Raises",":","`","ValueError","`","if","file","already","exists",",","replace=False","and","exist_ok=False","."]
code: def download(
      self,
      root: str = ".",
      replace: bool = False,
      exist_ok: bool = False,
  ) -> io.TextIOWrapper:
      """Downloads a file previously saved by a run from the wandb server.
  
      Arguments:
          replace (boolean): If `True`, download will overwrite a local file
              if it exists. Defaults to `False`.
          root (str): Local directory to save the file.  Defaults to ".".
          exist_ok (boolean): If `True`, will not raise ValueError if file already
              exists and will not re-download unless replace=True. Defaults to `False`.
  
      Raises:
          `ValueError` if file already exists, replace=False and exist_ok=False.
      """
      path = os.path.join(root, self.name)
      if os.path.exists(path) and not replace:
          if exist_ok:
              return open(path)
          else:
              raise ValueError(
                  "File already exists, pass replace=True to overwrite or exist_ok=True to leave it as is and don't error."
              )
  
      util.download_file_from_url(path, self.url, wandb.Api().api_key)
      return open(path)
  
imports: import io
  import os
  import requests
  from wandb_gql import gql
  from wandb_gql.client import RetryError
  import wandb
  from wandb import util
  from wandb.apis.attrs import Attrs
  from wandb.apis.normalize import normalize_exceptions
  from wandb.apis.paginator import Paginator
  from wandb.apis.public.const import RETRY_TIMEDELTA
  from wandb.sdk.lib import retry
label_desc: Use image node_id 3 for calling the File obj's underlying member method code with example usage: obj.download(root, replace, exist_ok) and returns: open, open