code: def samples_to_probs(samples, num_wires):
      """Converts samples to probs"""
      samples_decimal = [
          np.ravel_multi_index(sample, [2] * num_wires)
          for sample in samples
      ]
      counts = [0] * (2**num_wires)
  
      for sample in samples_decimal:
          counts[sample] += 1
  
      return np.array(counts, dtype=np.float64) / len(samples)
  
imports: from random import shuffle
  import pytest
  import numpy
  import pennylane
  from pennylane.devices.qubit import simulate
  from pennylane.devices.qubit.simulate import _FlexShots
  from pennylane.devices.qubit import sample_state, measure_with_samples
  from pennylane.devices.qubit.sampling import _sample_state_jax
  from pennylane.measurements import Shots
label_desc: Use image node_id 4 for calling a global function with example usage: samples_to_probs(samples, num_wires) and returns: unknown