class_docstr: Provides a corpus for the specified population with tokens for the specified
  sources. Splits the data into training, validation and testing partition according
  to the population splits.
  
  .. todo::
      consider renaming the reference_date and threshold parameters to something more
      meaningful
  
  :param sources: List of token sources from which to generate sentences
  :param population: Cohort to generate sentences for.
  
  :param reference_date:
  :param threshold:
class_docstr_tok: ["Provides","a","corpus","for","the","specified","population","with","tokens","for","the","specified","sources",".","Splits","the","data","into","training",",","validation","and","testing","partition","according","to","the","population","splits",".","..","todo",":",":","consider","renaming","the","reference_date","and","threshold","parameters","to","something","more","meaningful",":","param","sources",":","List","of","token","sources","from","which","to","generate","sentences",":","param","population",":","Cohort","to","generate","sentences","for",".",":","param","reference_date",":",":","param","threshold",":"]
code: def __post_init__(self) -> None:
      self._reference_date = pd.to_datetime(self.reference_date)
      self._threshold = pd.to_datetime(self.threshold)
  
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 1 for calling the Corpus obj's underlying member method code with example usage: obj.__post_init__() without return types