code: def total_len(o):
      if hasattr(o, "__len__"):
          return len(o)
  
      if hasattr(o, "len"):
          return o.len
  
      if hasattr(o, "fileno"):
          try:
              fileno = o.fileno()
          except io.UnsupportedOperation:
              pass
          else:
              return os.fstat(fileno).st_size
  
      if hasattr(o, "getvalue"):
          # e.g. BytesIO, cStringIO.StringIO
          return len(o.getvalue())
  
imports: import contextlib
  import io
  import os
  from uuid import uuid4
  import requests
  from .._compat import fields
label_desc: Use image node_id 4 for calling a global function with example usage: total_len(o) and returns: len, o, len, os