code: def serialize(
      self, files: SomeUploadedFiles
  ) -> FileUploaderStateProto:
      state_proto = FileUploaderStateProto()
  
      if not files:
          return state_proto
      elif not isinstance(files, list):
          files = [files]
  
      for f in files:
          if isinstance(f, DeletedFile):
              continue
          file_info: UploadedFileInfoProto = (
              state_proto.uploaded_file_info.add()
          )
          file_info.file_id = f.file_id
          file_info.name = f.name
          file_info.size = f.size
          file_info.file_urls.CopyFrom(f._file_urls)
  
      return state_proto
  
imports: from dataclasses import dataclass
  from textwrap import dedent
  from typing import List, Optional, Sequence, Union, cast, overload
  from typing_extensions import Literal
  import streamlit
  from streamlit import config
  from streamlit.elements.form import current_form_id
  from streamlit.elements.utils import check_callback_rules, check_session_state_rules, get_label_visibility_proto_value
  from streamlit.proto.Common_pb2 import FileUploaderState
  from streamlit.proto.Common_pb2 import UploadedFileInfo
  from streamlit.proto.FileUploader_pb2 import FileUploader
  from streamlit.runtime.metrics_util import gather_metrics
  from streamlit.runtime.scriptrunner import ScriptRunContext, get_script_run_ctx
  from streamlit.runtime.state import WidgetArgs, WidgetCallback, WidgetKwargs, register_widget
  from streamlit.runtime.state.common import compute_widget_id
  from streamlit.runtime.uploaded_file_manager import DeletedFile, UploadedFile
  from streamlit.type_util import Key, LabelVisibility, maybe_raise_label_warnings, to_key
label_desc: Use image node_id 2 for calling the FileUploaderSerde obj's underlying member method code with example usage: obj.serialize(files) and returns: state_proto, state_proto