class_docstr: A bookkeeping class for wires, which are ordered collections of unique objects.
  
  If the input `wires` can be iterated over, it is interpreted as a sequence of wire labels that have to be
  unique and hashable. Else it is interpreted as a single wire label that has to be hashable. The
  only exception are strings which are interpreted as wire labels.
  
  The hash function of a wire label is considered the source of truth when deciding whether
  two wire labels are the same or not.
  
  Indexing an instance of this class will return a wire label.
  
  .. warning::
  
      In order to support wire labels of any hashable type, integers and 0-d arrays are considered different.
      For example, running ``qml.RX(1.1, qml.numpy.array(0))`` on a device initialized with ``wires=[0]``
      will fail because ``qml.numpy.array(0)`` does not exist in the device's wire map.
  
  Args:
       wires (Any): the wire label(s)
class_docstr_tok: ["A","bookkeeping","class","for","wires",",","which","are","ordered","collections","of","unique","objects",".","If","the","input","`","wires","`","can","be","iterated","over",",","it","is","interpreted","as","a","sequence","of","wire","labels","that","have","to","be","unique","and","hashable",".","Else","it","is","interpreted","as","a","single","wire","label","that","has","to","be","hashable",".","The","only","exception","are","strings","which","are","interpreted","as","wire","labels",".","The","hash","function","of","a","wire","label","is","considered","the","source","of","truth","when","deciding","whether","two","wire","labels","are","the","same","or","not",".","Indexing","an","instance","of","this","class","will","return","a","wire","label",".","..","warning",":",":","In","order","to","support","wire","labels","of","any","hashable","type",",","integers","and","0-d","arrays","are","considered","different",".","For","example",",","running","``","qml.RX","(","1.1",",","qml.numpy.array","(","0",")",")","``","on","a","device","initialized","with","``","wires=","[","0","]","``","will","fail","because","``","qml.numpy.array","(","0",")","``","does","not","exist","in","the","device","'s","wire","map",".","Args",":","wires","(","Any",")",":","the","wire","label","(","s",")"]
docstr: Return the wires that appear in any of the Wires objects in the list.
  
  This is similar to a set combine method, but keeps the order of wires as they appear in the list.
  
  Args:
      list_of_wires (List[Wires]): List of Wires objects
      sort (bool): Toggle for sorting the combined wire labels. The sorting is based on
          value if all keys are int, else labels' str representations are used.
  
  Returns:
      Wires: combined wires
  
  **Example**
  
  >>> wires1 = Wires([4, 0, 1])
  >>> wires2 = Wires([3, 0, 4])
  >>> wires3 = Wires([5, 3])
  >>> list_of_wires = [wires1, wires2, wires3]
  >>> Wires.all_wires(list_of_wires)
  <Wires = [4, 0, 1, 3, 5]>
docstr_tok: ["Return","the","wires","that","appear","in","any","of","the","Wires","objects","in","the","list",".","This","is","similar","to","a","set","combine","method",",","but","keeps","the","order","of","wires","as","they","appear","in","the","list",".","Args",":","list_of_wires","(","List","[","Wires","]",")",":","List","of","Wires","objects","sort","(","bool",")",":","Toggle","for","sorting","the","combined","wire","labels",".","The","sorting","is","based","on","value","if","all","keys","are","int",",","else","labels","'","str","representations","are","used",".","Returns",":","Wires",":","combined","wires","*","*","Example","*","*",">",">",">","wires1","=","Wires","(","[","4",",","0",",","1","]",")",">",">",">","wires2","=","Wires","(","[","3",",","0",",","4","]",")",">",">",">","wires3","=","Wires","(","[","5",",","3","]",")",">",">",">","list_of_wires","=","[","wires1",",","wires2",",","wires3","]",">",">",">","Wires.all_wires","(","list_of_wires",")","<","Wires","=","[","4",",","0",",","1",",","3",",","5","]",">"]
code: def all_wires(list_of_wires, sort=False):
      """Return the wires that appear in any of the Wires objects in the list.
  
      This is similar to a set combine method, but keeps the order of wires as they appear in the list.
  
      Args:
          list_of_wires (List[Wires]): List of Wires objects
          sort (bool): Toggle for sorting the combined wire labels. The sorting is based on
              value if all keys are int, else labels' str representations are used.
  
      Returns:
          Wires: combined wires
  
      **Example**
  
      >>> wires1 = Wires([4, 0, 1])
      >>> wires2 = Wires([3, 0, 4])
      >>> wires3 = Wires([5, 3])
      >>> list_of_wires = [wires1, wires2, wires3]
      >>> Wires.all_wires(list_of_wires)
      <Wires = [4, 0, 1, 3, 5]>
      """
      converted_wires = (
          wires if isinstance(wires, Wires) else Wires(wires)
          for wires in list_of_wires
      )
      all_wires_list = itertools.chain(
          *(w.labels for w in converted_wires)
      )
      combined = list(dict.fromkeys(all_wires_list))
  
      if sort:
          if all(isinstance(w, int) for w in combined):
              combined = sorted(combined)
          else:
              combined = sorted(combined, key=str)
  
      return Wires(tuple(combined), _override=True)
  
imports: import functools
  import itertools
  from collections.abc import Iterable, Sequence
  import numpy
  from pennylane.pytrees import register_pytree
label_desc: Use image node_id 25 for calling the Wires obj's underlying member method code with example usage: obj.all_wires(list_of_wires, sort) and returns: Wires