docstr: Serializes the datalab object to disk.
  
  Parameters
  ----------
  path : str
      Path to save the datalab object to.
  
  datalab : Datalab
      The datalab object to save.
  
  force : bool
      If True, will overwrite existing files at the specified path.
docstr_tok: ["Serializes","the","datalab","object","to","disk",".","Parameters","--","--","--","--","--","path",":","str","Path","to","save","the","datalab","object","to",".","datalab",":","Datalab","The","datalab","object","to","save",".","force",":","bool","If","True",",","will","overwrite","existing","files","at","the","specified","path","."]
code: def serialize(cls, path: str, datalab: Datalab, force: bool) -> None:
      """Serializes the datalab object to disk.
  
      Parameters
      ----------
      path : str
          Path to save the datalab object to.
  
      datalab : Datalab
          The datalab object to save.
  
      force : bool
          If True, will overwrite existing files at the specified path.
      """
      path_exists = os.path.exists(path)
      if not path_exists:
          os.mkdir(path)
      else:
          if not force:
              raise FileExistsError(
                  "Please specify a new path or set force=True"
              )
          print(
              f"WARNING: Existing files will be overwritten by newly saved files at: {path}"
          )
  
      # Save the datalab object to disk.
      with open(os.path.join(path, OBJECT_FILENAME), "wb") as f:
          pickle.dump(datalab, f)
  
      # Save the issues to disk. Use placeholder method for now.
      cls._save_data_issues(path=path, datalab=datalab)
  
      # Save the dataset to disk
      cls._save_data(path=path, datalab=datalab)
  
file_path: cleanlab/cleanlab/datalab/internal/serialize.py
imports: from __future__ import annotations
  import os
  import pickle
  import warnings
  from typing import TYPE_CHECKING, Optional
  import pandas
  import cleanlab
  from cleanlab.datalab.internal.data import Data
label_desc: Use image node_id 4 for calling the _Serializer obj's underlying member method code with example usage: obj.serialize(cls, path, datalab, force) without return types