class_docstr: A mutable uploaded file.
  
  This class extends BytesIO, which has copy-on-write semantics when
  initialized with `bytes`.
class_docstr_tok: ["A","mutable","uploaded","file",".","This","class","extends","BytesIO",",","which","has","copy-on-write","semantics","when","initialized","with","`","bytes","`","."]
code: def __init__(self, record: UploadedFileRec, file_urls: FileURLsProto):
      # BytesIO's copy-on-write semantics doesn't seem to be mentioned in
      # the Python docs - possibly because it's a CPython-only optimization
      # and not guaranteed to be in other Python runtimes. But it's detailed
      # here: https://hg.python.org/cpython/rev/79a5fbe2c78f
      super().__init__(record.data)
      self.file_id = record.file_id
      self.name = record.name
      self.type = record.type
      self.size = len(record.data)
      self._file_urls = file_urls
  
imports: import io
  from abc import abstractmethod
  from typing import List, NamedTuple, Sequence
  from typing_extensions import Protocol
  from streamlit import util
  from streamlit.proto.Common_pb2 import FileURLs
  from streamlit.runtime.stats import CacheStatsProvider
label_desc: Use image node_id 1 to create a new UploadedFile object from inherited base classes: io with example: obj = UploadedFile(record, file_urls)