code: def _validate_args(search_kwargs, target_metric, legal_keys):
      _check_search_args(
          search_args=search_kwargs, legal_keys=legal_keys
      )
  
      direction = search_kwargs.get("direction", None)
      directions = search_kwargs.get("directions", None)
      _check_optimize_direction(
          direction=direction,
          directions=directions,
          metric=target_metric,
      )
  
file_path: BigDL/python/nano/src/bigdl/nano/automl/hpo/search.py
imports: import optuna
  from bigdl.nano.utils.common import invalidInputError
label_desc: Use image node_id 7 for calling a global function with example usage: _validate_args(search_kwargs, target_metric, legal_keys) without return types