code: def file_size(f):
      
      if isinstance(f, (six.string_types, six.text_type)):
          return os.path.getsize(f)
      else:
          cur = f.tell()
          f.seek(0, 2)
          size = f.tell()
          f.seek(cur)
          return size
docs: Returns the size of a file in bytes.
  
      Raises
      ------
      OSError : Accessing the given file path failed
  
      Parameters
      ----------
      f : io.IOBase | str
          The file path or object for which the size should be determined