code: def from_stream(cls, stream, filename, verbose, log):
      # type: (IO[AnyStr], str, bool, logging.Logger) -> Optional[UploadProgressReport]
      if hasattr(stream, "seek"):
          total_size = cls._get_stream_length(stream)
          return UploadProgressReport(
              filename, verbose, total_size, log
          )
  
imports: import logging
  import os
  from time import time
  from typing import Optional, AnyStr, IO
  from ..config import config
label_desc: Use image node_id 3 for calling the UploadProgressReport obj's underlying member method code with example usage: obj.from_stream(cls, stream, filename, verbose, log) and returns: UploadProgressReport