class_docstr: Unit tests for classical_shadow measurement
class_docstr_tok: ["Unit","tests","for","classical_shadow","measurement"]
docstr: Test that the format of the returned classical shadow
  measurement is correct
docstr_tok: ["Test","that","the","format","of","the","returned","classical","shadow","measurement","is","correct"]
code: def test_format(self, wires, shots, seed, interface, device):
      """Test that the format of the returned classical shadow
      measurement is correct"""
      import tensorflow as tf
      import torch
  
      circuit = get_circuit(wires, shots, seed, interface, device)
      shadow = circuit()
  
      # test shape is correct
      assert shadow.shape == (2, shots, wires)
  
      # test dtype is correct
      expected_dtype = np.int8
      if interface == "tf":
          expected_dtype = tf.int8
      elif interface == "torch":
          expected_dtype = torch.int8
  
      assert shadow.dtype == expected_dtype
  
      bits, recipes = shadow  # pylint: disable=unpacking-non-sequence
  
      # test allowed values of bits and recipes
      assert qml.math.all(np.logical_or(bits == 0, bits == 1))
      assert qml.math.all(
          np.logical_or(
              recipes == 0, np.logical_or(recipes == 1, recipes == 2)
          )
      )
  
imports: import copy
  import autograd.numpy
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.measurements import ClassicalShadowMP, Shots
  from pennylane.measurements.classical_shadow import ShadowExpvalMP
label_desc: Use image node_id 5 for calling the TestClassicalShadow obj's underlying member method code with example usage: obj.test_format(wires, shots, seed, interface, device) without return types