class_docstr: Takes care of preprocessing for static_features and past/known covariates.
  
  Covariates are all converted to float dtype. Static features, if present, are all converted to categorical & float
  dtypes.
class_docstr_tok: ["Takes","care","of","preprocessing","for","static_features","and","past\/known","covariates",".","Covariates","are","all","converted","to","float","dtype",".","Static","features",",","if","present",",","are","all","converted","to","categorical","&","float","dtypes","."]
docstr: Select the required dataframe columns and convert them to float64 dtype.
docstr_tok: ["Select","the","required","dataframe","columns","and","convert","them","to","float64","dtype","."]
code: def _check_and_prepare_covariates(
      data: TimeSeriesDataFrame,
      required_column_names: List[str],
      data_frame_name: str,
  ) -> TimeSeriesDataFrame:
      """Select the required dataframe columns and convert them to float64 dtype."""
      missing_columns = pd.Index(required_column_names).difference(
          data.columns
      )
      if len(missing_columns) > 0:
          raise ValueError(
              f"{len(missing_columns)} columns are missing from {data_frame_name}: {reprlib.repr(missing_columns.to_list())}"
          )
      data = data[required_column_names]
      try:
          data = data.astype(np.float64)
      except ValueError:
          raise ValueError(
              f"Columns in {data_frame_name} must all have numeric (float or int) dtypes, "
              f"but in provided data they have dtypes {data.dtypes}"
          )
      return data
  
imports: import logging
  import reprlib
  from dataclasses import dataclass, field
  from typing import List, Optional
  import numpy
  import pandas
  from autogluon.common.features.types import R_FLOAT, R_INT
  from autogluon.features.generators import AsTypeFeatureGenerator, CategoryFeatureGenerator, IdentityFeatureGenerator, PipelineFeatureGenerator
  from autogluon.timeseries import TimeSeriesDataFrame
label_desc: Use image node_id 5 for calling the TimeSeriesFeatureGenerator obj's underlying member method code with example usage: obj._check_and_prepare_covariates(data, required_column_names, data_frame_name) and returns: data