code: def test__filter_by_treatment():
      values = [
          [1.0, "treatment_A", 1],
          [4.0, "treatment_C", 1],
          [1.0, "treatment_B", 0],
          [5.0, "treatment_A", 0],
          [3.0, "control", 1],
      ]
  
      df = pd.DataFrame(
          data=values, columns=["feat1", "treatment", "target"]
      )
  
      selected_treatment = "treatment_A"
  
      expected_values = [
          [1.0, "treatment_A", 1],
          [5.0, "treatment_A", 0],
          [3.0, "control", 1],
      ]
  
      expected: DataFrame = pd.DataFrame(
          data=expected_values, columns=["feat1", "treatment", "target"]
      )
  
      results = _filter_by_treatment(
          df,
          treatment_col="treatment",
          treatment_name=selected_treatment,
          control_name="control",
      )
  
      assert_frame_equal(results.reset_index(drop=True), expected)
  
imports: from typing import Callable
  from unittest.mock import MagicMock, call, create_autospec, patch
  import numpy
  import pandas
  import pytest
  from pandas import DataFrame
  from pandas.testing import assert_frame_equal
  from fklearn.causal.cate_learning.meta_learners import TREATMENT_FEATURE, _append_treatment_feature, _create_treatment_flag, _filter_by_treatment, _fit_by_treatment, _get_learners, _get_model_fcn, _get_unique_treatments, _predict_by_treatment_flag, _simulate_t_learner_treatment_effect, _simulate_treatment_effect, causal_s_classification_learner, causal_t_classification_learner
  from fklearn.exceptions.exceptions import MissingControlError, MissingTreatmentError, MultipleTreatmentsError
  from fklearn.training.classification import logistic_classification_learner
  from fklearn.types import LearnerFnType
label_desc: Use image node_id 4 for calling a global function with example usage: test__filter_by_treatment() without return types