class_docstr: Main life2vec data processing pipeline. The data is generated based on a corpus
  and a task. The generated data is stored in /processed/<corpus>/<task>, with
  subfolders corresponding to each data split. The remaining parameters are given
  to :class:`torch.utils.data.DataLoader`.
  
  :param corpus: The corpus to generate data from.
  :param vocabulary: Vocabulary to use.
  :param task: Task to generate data for.
  
  :param batch_size: Batch size
  :param num_workers: Number of data loading workers
  :param persisten_worksers: Whether to persist workers
  :param pin_memory: Whether to pin memory
class_docstr_tok: ["Main","life2vec","data","processing","pipeline",".","The","data","is","generated","based","on","a","corpus","and","a","task",".","The","generated","data","is","stored","in","\/processed\/","<","corpus",">","\/","<","task",">",",","with","subfolders","corresponding","to","each","data","split",".","The","remaining","parameters","are","given","to",":","class",":","`","torch.utils.data.DataLoader","`",".",":","param","corpus",":","The","corpus","to","generate","data","from",".",":","param","vocabulary",":","Vocabulary","to","use",".",":","param","task",":","Task","to","generate","data","for",".",":","param","batch_size",":","Batch","size",":","param","num_workers",":","Number","of","data","loading","workers",":","param","persisten_worksers",":","Whether","to","persist","workers",":","param","pin_memory",":","Whether","to","pin","memory"]
docstr: Checks whether the data already exists.
  If not, then prepares the corpus and each data split using
  :meth:`prepare_data_split`
docstr_tok: ["Checks","whether","the","data","already","exists",".","If","not",",","then","prepares","the","corpus","and","each","data","split","using",":","meth",":","`","prepare_data_split","`"]
code: def prepare_data(self) -> None:
      """Checks whether the data already exists.
      If not, then prepares the corpus and each data split using
      :meth:`prepare_data_split`
      """
      arg_path = self.dataset_root / "_arguments"
      try:
          with open(arg_path, "rb") as f:
              arguments = pickle.load(f)
              print(arg_path)
          if arguments == self._arguments():
              return
          else:
              log.warning(
                  "Arguments do not correspond to the recorded ones"
              )
              return
              raise ValidationError
      except (EOFError, FileNotFoundError):
          pass
  
      log.info("Preparing corpus...")
      self.corpus.prepare()
      log.info("Prepared corpus.")
  
      log.info("Preparing vocabulary...")
      self.vocabulary.prepare()
      log.info("Prepared vocabulary.")
      log.info("\tVocabulary size: %s" % self.vocabulary.size())
  
      log.info("Preparing datasets...")
      self.dataset_root.mkdir(exist_ok=True, parents=True)
      dask.compute(
          self.prepare_data_split("train"),
          self.prepare_data_split("val"),
          self.prepare_data_split("test"),
      )
      log.info("Prepared datasets.")
  
      with open(self.dataset_root / "_arguments", "wb") as f:
          pickle.dump(self._arguments(), f)
  
imports: import enum
  import logging
  import pickle
  from dataclasses import dataclass, replace
  from pathlib import Path
  from typing import Any, Dict, List, Optional
  from typing_extensions import dataclass_transform
  import dask
  import dask.dataframe
  import pandas
  import numpy
  import pytorch_lightning
  import torch
  from pandas.tseries.offsets import MonthEnd
  from torch.utils.data import DataLoader, Dataset, WeightedRandomSampler
  from ..tasks.base import Task, collate_encoded_documents
  from .sampler import FixedSampler
  from .dataset import DocumentDataset, ShardedDocumentDataset
  from .decorators import save_parquet, save_pickle
  from .ops import concat_columns_dask, concat_sorted
  from .populations.base import Population
  from .serialize import DATA_ROOT, ValidationError, _jsonify
  from .sources.base import Field, TokenSource
  from .vocabulary import Vocabulary
label_desc: Use image node_id 5 for calling the L2VDataModule obj's underlying member method code with example usage: obj.prepare_data() without return types