code: def assert_valid_inputs(
      labels: List[Dict[str, Any]],
      predictions,
      method: Optional[str] = None,
      threshold: Optional[float] = None,
  ):
      """Asserts proper input format."""
      if len(labels) != len(predictions):
          raise ValueError(
              f"labels and predictions length needs to match. len(labels) == {len(labels)} while len(predictions) == {len(predictions)}."
          )
      # Typecheck labels and predictions
      if not isinstance(labels[0], dict):
          raise ValueError(
              f"Labels has to be a list of dicts. Instead it is list of {type(labels[0])}."
          )
      # check last column of predictions is probabilities ( < 1.)?
      if not isinstance(predictions[0], (list, np.ndarray)):
          raise ValueError(
              f"Prediction has to be a list or np.ndarray. Instead it is type {type(predictions[0])}."
          )
      if not predictions[0][0].shape[1] == 5:
          raise ValueError(
              f"Prediction values have to be of format [x1,y1,x2,y2,pred_prob]. Please refer to the documentation for predicted probabilities under object_detection.rank.get_label_quality_scores for details"
          )
  
      valid_methods = ["objectlab"]
      if method is not None and method not in valid_methods:
          raise ValueError(
              f"""
              {method} is not a valid object detection scoring method!
              Please choose a valid scoring_method: {valid_methods}
              """
          )
  
      if threshold is not None and threshold > 1.0:
          raise ValueError(
              f"""
              Threshold is a cutoff of predicted probabilities and therefore should be <= 1.
              """
          )
  
imports: from typing import Any, Dict, List, Optional
  import numpy
  from cleanlab.internal.numerics import softmax
label_desc: Use image node_id 4 for calling a global function with example usage: assert_valid_inputs(labels, predictions, method, threshold) without return types