code: def _is_parameter_valid(param: Dict[Text, Any]):
      """Checks if study_config parameter is valid."""
      if not param.get("parameter"):
          raise ValueError('"parameter" (name) is not specified.')
      if not param.get("type"):
          raise ValueError(
              "Parameter {} type is not specified.".format(param)
          )
      if param["type"] == _DISCRETE:
          if not param.get("discrete_value_spec"):
              raise ValueError(
                  "Parameter {} is missing discrete_value_spec.".format(
                      param
                  )
              )
          if not isinstance(
              param["discrete_value_spec"].get("values"), list
          ):
              raise ValueError(
                  'Parameter spec {} is missing "values".'.format(
                      param["discrete_value_spec"]
                  )
              )
      elif param["type"] == _CATEGORICAL:
          if not param.get("categorical_value_spec"):
              raise ValueError(
                  "Parameter {} is missing categorical_value_spec.".format(
                      param
                  )
              )
          if not isinstance(
              param["categorical_value_spec"].get("values"), list
          ):
              raise ValueError(
                  'Parameter spec {} is missing "values".'.format(
                      param["categorical_value_spec"]
                  )
              )
      elif param["type"] == _DOUBLE:
          if not param.get("double_value_spec"):
              raise ValueError(
                  "Parameter {} is missing double_value_spec.".format(
                      param
                  )
              )
          spec = param["double_value_spec"]
          if not (
              isinstance(spec.get("min_value"), float)
              and isinstance(spec.get("max_value"), float)
          ):
              raise ValueError(
                  'Parameter spec {} requires both "min_value" and '
                  '"max_value".'.format(spec)
              )
      elif param["type"] == _INTEGER:
          if not param.get("integer_value_spec"):
              raise ValueError(
                  "Parameter {} is missing integer_value_spec.".format(
                      param
                  )
              )
          spec = param["integer_value_spec"]
          if not (
              isinstance(spec.get("min_value"), int)
              and isinstance(spec.get("max_value"), int)
          ):
              raise ValueError(
                  'Parameter spec {} requires both "min_value" and '
                  '"max_value".'.format(spec)
              )
      else:
          raise ValueError(
              "Unknown parameter type: {}.".format(param["type"])
          )
  
imports: from typing import Any, Dict, List, Optional, Text, Union
  from keras_tuner.engine import hyperparameters
  from keras_tuner.engine import metrics_tracking
  from keras_tuner.engine import oracle
  from keras_tuner.engine import trial
  import numpy
  from tensorboard.plugins.hparams import api
label_desc: Use image node_id 4 for calling a global function with example usage: _is_parameter_valid(param) without return types