code: def _swap_node_partition(cut, node):
      return cut - {node} if node in cut else cut.union({node})
  
imports: import networkx
  from networkx.utils.decorators import not_implemented_for, py_random_state
label_desc: Use image node_id 2 for calling a global function with example usage: _swap_node_partition(cut, node) and returns: unknown