class_docstr: Abstract base class for PennyLane devices.
  
  Args:
      wires (int or Iterable[Number, str]]): Number of subsystems represented by the device,
          or iterable that contains unique labels for the subsystems as numbers (i.e., ``[-1, 0, 2]``)
          or strings (``['ancilla', 'q1', 'q2']``). Default 1 if not specified.
      shots (int): Number of circuit evaluations/random samples used to estimate
          expectation values of observables. Defaults to 1000 if not specified.
class_docstr_tok: ["Abstract","base","class","for","PennyLane","devices",".","Args",":","wires","(","int","or","Iterable","[","Number",",","str","]","]",")",":","Number","of","subsystems","represented","by","the","device",",","or","iterable","that","contains","unique","labels","for","the","subsystems","as","numbers","(","i.e.",",","``","[","-1",",","0",",","2","]","``",")","or","strings","(","``","[","'ancilla","'",",","'q1","'",",","'q2","'","]","``",")",".","Default","1","if","not","specified",".","shots","(","int",")",":","Number","of","circuit","evaluations\/random","samples","used","to","estimate","expectation","values","of","observables",".","Defaults","to","1000","if","not","specified","."]
docstr: Changes the number of shots.
  
  Args:
      shots (int): number of circuit evaluations/random samples used to estimate
          expectation values of observables
  
  Raises:
      DeviceError: if number of shots is less than 1
docstr_tok: ["Changes","the","number","of","shots",".","Args",":","shots","(","int",")",":","number","of","circuit","evaluations\/random","samples","used","to","estimate","expectation","values","of","observables","Raises",":","DeviceError",":","if","number","of","shots","is","less","than","1"]
code: def shots(self, shots):
      """Changes the number of shots.
  
      Args:
          shots (int): number of circuit evaluations/random samples used to estimate
              expectation values of observables
  
      Raises:
          DeviceError: if number of shots is less than 1
      """
      if shots is None:
          # device is in analytic mode
          self._shots = shots
          self._shot_vector = None
          self._raw_shot_sequence = None
  
      elif isinstance(shots, int):
          # device is in sampling mode (unbatched)
          if shots < 1:
              raise DeviceError(
                  f"The specified number of shots needs to be at least 1. Got {shots}."
              )
  
          self._shots = shots
          self._shot_vector = None
  
      elif isinstance(shots, Sequence) and not isinstance(shots, str):
          # device is in batched sampling mode
          shot_obj = qml.measurements.Shots(shots)
          self._shots, self._shot_vector = shot_obj.total_shots, list(
              shot_obj.shot_vector
          )
          self._raw_shot_sequence = shots
  
      else:
          raise DeviceError(
              "Shots must be a single non-negative integer or a sequence of non-negative integers."
          )
  
imports: import abc
  import copy
  import types
  import warnings
  from collections import OrderedDict
  from collections.abc import Iterable, Sequence
  from functools import lru_cache
  import numpy
  import pennylane
  from pennylane.measurements import MeasurementProcess, CountsMP, Expectation, ExpectationMP, MidMeasureMP, Probability, ProbabilityMP, Sample, SampleMP, ShadowExpvalMP, State, Variance
  from pennylane.operation import Observable, Operation, Tensor, Operator, StatePrepBase
  from pennylane.ops import Hamiltonian, Sum
  from pennylane.tape import QuantumScript, QuantumTape, expand_tape_state_prep
  from pennylane.wires import WireError, Wires
  from pennylane.queuing import QueuingManager
label_desc: Use image node_id 16 for calling the Device obj's underlying member method code with example usage: obj.shots(shots) without return types