code: def set_bit(v, index, x):
      """Set the index:th bit of v to 1 if x is truthy, else to 0, and return the new value."""
      mask = (
          1 << index
      )  # Compute mask, an integer with just bit 'index' set.
      v &= ~mask  # Clear the bit indicated by the mask (if x is False)
      if x:
          v |= mask  # If x was True, set the bit indicated by the mask.
      return v
  
file_path: ludwig/ludwig/utils/h3_util.py
imports: from typing import List, NamedTuple
label_desc: Use image node_id 1 for calling a global function with example usage: set_bit(v, index, x) and returns: v