code: def _validate_sample_weight(self, X, X_val):
      if self.sample_weight is not None:
          if self.sample_weight in [AUTO_WEIGHT, BALANCE_WEIGHT]:
              prefix = f"Using predefined sample weighting strategy: {self.sample_weight}."
              if self.weight_evaluation:
                  prefix += " Warning: We do not recommend weight_evaluation=True with predefined sample weighting."
          else:
              if self.sample_weight not in X.columns:
                  raise KeyError(
                      f"sample_weight column '{self.sample_weight}' is missing from training data. Training data columns: {list(X.columns)}"
                  )
              weight_vals = X[self.sample_weight]
              if weight_vals.isna().sum() > 0:
                  raise ValueError(
                      f"Sample weights in column '{self.sample_weight}' cannot be nan"
                  )
              if weight_vals.dtype.kind not in "biuf":
                  raise ValueError(
                      f"Sample weights in column '{self.sample_weight}' must be numeric values"
                  )
              if weight_vals.min() < 0:
                  raise ValueError(
                      f"Sample weights in column '{self.sample_weight}' must be nonnegative"
                  )
              if (
                  self.weight_evaluation
                  and X_val is not None
                  and self.sample_weight not in X_val.columns
              ):
                  raise KeyError(
                      f"sample_weight column '{self.sample_weight}' cannot be missing from validation data if weight_evaluation=True"
                  )
              prefix = f"Values in column '{self.sample_weight}' used as sample weights instead of predictive features."
          if self.weight_evaluation:
              suffix = " Evaluation will report weighted metrics, so ensure same column exists in test data."
          else:
              suffix = " Evaluation metrics will ignore sample weights, specify weight_evaluation=True to instead report weighted metrics."
          logger.log(20, prefix + suffix)
  
imports: from __future__ import annotations
  import copy
  import json
  import logging
  import time
  from collections.abc import Iterable
  from typing import List, Union
  import numpy
  import pandas
  from pandas import DataFrame, Series
  from sklearn.metrics import classification_report
  from autogluon.core.constants import AUTO_WEIGHT, BALANCE_WEIGHT, BINARY, MULTICLASS, QUANTILE, REGRESSION
  from autogluon.core.data.label_cleaner import LabelCleaner, LabelCleanerMulticlassToBinary
  from autogluon.core.learner import AbstractLearner
  from autogluon.core.metrics import Scorer, confusion_matrix, get_metric
  from autogluon.core.models.greedy_ensemble.ensemble_selection import EnsembleSelection
  from autogluon.core.utils import augment_rare_classes, compute_weighted_metric, extract_column, get_leaderboard_pareto_frontier, get_pred_from_proba, get_pred_from_proba_df, infer_problem_type
  from autogluon.features.generators import PipelineFeatureGenerator
label_desc: Use image node_id 19 for calling the AbstractTabularLearner obj's underlying member method code with example usage: obj._validate_sample_weight(X, X_val) without return types