code: def test_build_candidate_sampler_config_success(self):
      self.assertProtoEquals(
          """
          extension {
            [type.googleapis.com/carls.candidate_sampling.BruteForceTopkSamplerConfig] {
              similarity_type: COSINE
            }
          }
      """,
          cs_config_builder.build_candidate_sampler_config(
              cs_config_builder.brute_force_topk_sampler("COSINE")
          ),
      )
  
      self.assertProtoEquals(
          """
          extension {
            [type.googleapis.com/carls.candidate_sampling.NegativeSamplerConfig] {
              unique: true
              sampler: UNIFORM
            }
          }
      """,
          cs_config_builder.build_candidate_sampler_config(
              cs_config_builder.negative_sampler(True, "UNIFORM")
          ),
      )
  
file_path: neural-structured-learning/research/carls/candidate_sampling/candidate_sampler_config_builder_test.py
imports: from research.carls.candidate_sampling import candidate_sampler_config_builder
  from research.carls.candidate_sampling import candidate_sampler_config_pb2
  import tensorflow
label_desc: Use image node_id 4 for calling the CandidateSamplerConfigBuilderTest obj's underlying member method code with example usage: obj.test_build_candidate_sampler_config_success() without return types