code: def pop_random(random: Random, seq: LazySequenceCopy) -> int:
      """Remove and return a random element of seq. This runs in O(1) but leaves
      the sequence in an arbitrary order."""
      i = random.randrange(0, len(seq))
      swap(seq, i, len(seq) - 1)
      return seq.pop()
  
imports: import array
  import sys
  import warnings
  from random import Random
  from typing import Callable, Dict, Generic, Iterable, Iterator, List, Optional, Sequence, Tuple, TypeVar, Union, overload
  from hypothesis.errors import HypothesisWarning
label_desc: Use image node_id 9 for calling a global function with example usage: pop_random(random, seq) and returns: seq