class_docstr: The ``Logger`` class is the ClearML console log and metric statistics interface, and contains methods for explicit
  reporting.
  
  Explicit reporting extends ClearML automagical capturing of inputs and output. Explicit reporting
  methods include scalar plots, line plots, histograms, confusion matrices, 2D and 3D scatter
  diagrams, text logging, tables, and image uploading and reporting.
  
  In the **ClearML Web-App (UI)**, ``Logger`` output appears in the **RESULTS** tab, **CONSOLE**, **SCALARS**,
  **PLOTS**, and **DEBUG SAMPLES** sub-tabs. When you compare experiments, ``Logger`` output appears in the
  comparisons.
  
  .. warning::
  
     Do not construct Logger objects directly.
  
  You must get a Logger object before calling any of the other ``Logger`` class methods by calling
  :meth:`.Task.get_logger` or :meth:`Logger.current_logger`.
class_docstr_tok: ["The","``","Logger","``","class","is","the","ClearML","console","log","and","metric","statistics","interface",",","and","contains","methods","for","explicit","reporting",".","Explicit","reporting","extends","ClearML","automagical","capturing","of","inputs","and","output",".","Explicit","reporting","methods","include","scalar","plots",",","line","plots",",","histograms",",","confusion","matrices",",","2D","and","3D","scatter","diagrams",",","text","logging",",","tables",",","and","image","uploading","and","reporting",".","In","the","*","*","ClearML","Web-App","(","UI",")","*","*",",","``","Logger","``","output","appears","in","the","*","*","RESULTS","*","*","tab",",","*","*","CONSOLE","*","*",",","*","*","SCALARS","*","*",",","*","*","PLOTS","*","*",",","and","*","*","DEBUG","SAMPLES","*","*","sub-tabs",".","When","you","compare","experiments",",","``","Logger","``","output","appears","in","the","comparisons",".","..","warning",":",":","Do","not","construct","Logger","objects","directly",".","You","must","get","a","Logger","object","before","calling","any","of","the","other","``","Logger","``","class","methods","by","calling",":","meth",":","`",".Task.get_logger","`","or",":","meth",":","`","Logger.current_logger","`","."]
docstr: Upload a file and report it as link in the debug images section.
  
  File is uploaded to a preconfigured storage (see :meth:`Loggerset_default_upload_destination`)
  describing the task ID, title, series and iteration.
  
  :param title: Title (AKA metric)
  :param series: Series (AKA variant)
  :param iteration: Iteration number
  :param path: A path to file to be uploaded
  :param max_file_history: maximum number of files to store per metric/variant combination         use negative value for unlimited. default is set in global configuration (default=5)
  :param delete_after_upload: if True, one the file was uploaded the local copy will be deleted
docstr_tok: ["Upload","a","file","and","report","it","as","link","in","the","debug","images","section",".","File","is","uploaded","to","a","preconfigured","storage","(","see",":","meth",":","`","Loggerset_default_upload_destination","`",")","describing","the","task","ID",",","title",",","series","and","iteration",".",":","param","title",":","Title","(","AKA","metric",")",":","param","series",":","Series","(","AKA","variant",")",":","param","iteration",":","Iteration","number",":","param","path",":","A","path","to","file","to","be","uploaded",":","param","max_file_history",":","maximum","number","of","files","to","store","per","metric\/variant","combination","use","negative","value","for","unlimited",".","default","is","set","in","global","configuration","(","default=5",")",":","param","delete_after_upload",":","if","True",",","one","the","file","was","uploaded","the","local","copy","will","be","deleted"]
code: def _report_file_and_upload(
      self,
      title,  # type: str
      series,  # type: str
      iteration=None,  # type: Optional[int]
      path=None,  # type: Optional[str]
      max_file_history=None,  # type: Optional[int]
      delete_after_upload=False,  # type: bool
  ):
      """
          Upload a file and report it as link in the debug images section.
  
          File is uploaded to a preconfigured storage (see :meth:`Loggerset_default_upload_destination`)
          describing the task ID, title, series and iteration.
  
          :param title: Title (AKA metric)
          :param series: Series (AKA variant)
          :param iteration: Iteration number
          :param path: A path to file to be uploaded
          :param max_file_history: maximum number of files to store per metric/variant combination \
          use negative value for unlimited. default is set in global configuration (default=5)
          :param delete_after_upload: if True, one the file was uploaded the local copy will be deleted
          """
  
      # if task was not started, we have to start it
      self._start_task_if_needed()
      upload_uri = self.get_default_upload_destination()
      if not upload_uri:
          upload_uri = Path(get_cache_dir()) / "debug_images"
          upload_uri.mkdir(parents=True, exist_ok=True)
          # Verify that we can upload to this destination
          upload_uri = str(upload_uri)
          storage = StorageHelper.get(upload_uri)
          upload_uri = storage.verify_upload(folder_uri=upload_uri)
      # noinspection PyProtectedMember
      self._task._reporter.report_image_and_upload(
          title=title,
          series=series,
          path=path,
          image=None,
          iter=iteration or 0,
          upload_uri=upload_uri,
          max_image_history=max_file_history
          if max_file_history is not None
          else self._default_max_sample_history,
          delete_after_upload=delete_after_upload,
      )
  
imports: import logging
  import math
  import warnings
  from typing import Any, Sequence, Union, List, Optional, Tuple, Dict, TYPE_CHECKING
  import numpy
  import six
  from PIL import Image
  from pathlib2 import Path
  from .debugging.log import LoggerRoot
  from .backend_interface.logger import StdStreamPatch
  from .backend_interface.task import Task
  from .backend_interface.task.log import TaskHandler
  from .backend_interface.util import mutually_exclusive
  from .backend_interface.metrics.events import UploadEvent, MetricsEventAdapter
  from .config import running_remotely, get_cache_dir, config, DEBUG_SIMULATE_REMOTE_TASK, deferred_config
  from .errors import UsageError
  from .storage.helper import StorageHelper
  from .utilities.plotly_reporter import SeriesInfo
label_desc: Use image node_id 37 for calling the Logger obj's underlying member method code with example usage: obj._report_file_and_upload(title, series, iteration, path, max_file_history, delete_after_upload) without return types