class_docstr: Represents a node in a trie managing unordered constraints.
class_docstr_tok: ["Represents","a","node","in","a","trie","managing","unordered","constraints","."]
docstr: Returns a counter of the number of times each token is used
  in a constraint.
docstr_tok: ["Returns","a","counter","of","the","number","of","times","each","token","is","used","in","a","constraint","."]
code: def token_counts(self) -> Counter:
      """Returns a counter of the number of times each token is used
      in a constraint.
      """
      token_counts = Counter()
      kids = list(self.children.values())
      while len(kids) > 0:
          kid = kids.pop()
          token_counts[kid.id] += kid.num_constraints
          kids += list(kid.children.values())
  
      return token_counts
  
imports: from collections import Counter
  from typing import List, Optional, Set, Tuple
  import torch
label_desc: Use image node_id 8 for calling the ConstraintNode obj's underlying member method code with example usage: obj.token_counts() and returns: token_counts