code: def _gen_batch_initial_conditions_local_search(
      discrete_choices: List[Tensor],
      raw_samples: int,
      X_avoid: Tensor,
      inequality_constraints: List[Tuple[Tensor, Tensor, float]],
      min_points: int,
      max_tries: int = 100,
  ):
      """Generate initial conditions for local search."""
      device = discrete_choices[0].device
      dtype = discrete_choices[0].dtype
      dim = len(discrete_choices)
      X = torch.zeros(0, dim, device=device, dtype=dtype)
      for _ in range(max_tries):
          X_new = torch.zeros(
              raw_samples, dim, device=device, dtype=dtype
          )
          for i, c in enumerate(discrete_choices):
              X_new[:, i] = c[
                  torch.randint(
                      low=0,
                      high=len(c),
                      size=(raw_samples,),
                      device=c.device,
                  )
              ]
          X = torch.unique(torch.cat((X, X_new)), dim=0)
          X = _filter_invalid(X=X, X_avoid=X_avoid)
          X = _filter_infeasible(
              X=X, inequality_constraints=inequality_constraints
          )
          if len(X) >= min_points:
              return X
      raise RuntimeError(
          f"Failed to generate at least {min_points} initial conditions"
      )
  
imports: from __future__ import annotations
  import dataclasses
  import warnings
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import torch
  from botorch.acquisition.acquisition import AcquisitionFunction, OneShotAcquisitionFunction
  from botorch.acquisition.knowledge_gradient import qKnowledgeGradient
  from botorch.acquisition.multi_objective.hypervolume_knowledge_gradient import qHypervolumeKnowledgeGradient
  from botorch.exceptions import InputDataError, UnsupportedError
  from botorch.exceptions.warnings import OptimizationWarning
  from botorch.generation.gen import gen_candidates_scipy, TGenCandidates
  from botorch.logging import logger
  from botorch.optim.initializers import gen_batch_initial_conditions, gen_one_shot_hvkg_initial_conditions, gen_one_shot_kg_initial_conditions, TGenInitialConditions
  from botorch.optim.stopping import ExpMAStoppingCriterion
  from botorch.optim.utils import _filter_kwargs
  from torch import Tensor
label_desc: Use image node_id 16 for calling a global function with example usage: _gen_batch_initial_conditions_local_search(discrete_choices, raw_samples, X_avoid, inequality_constraints, min_points, max_tries) and returns: X