code: def choose_from_list_without_replacement(a: list, size: int) -> list:
      if len(a) <= size:
          return a
      # np.random.choice makes casting of elements to numpy types
      # which is undesirable by 2 reasons:
      # 1. Apache Beam can not serialize numpy types.
      # 2. It might lead for losing precision (e.g. arbitrary
      # precision int is converted to int64).
      sampled_indices = np.random.choice(
          np.arange(len(a)), size, replace=False
      )
  
      return [a[i] for i in sampled_indices]
  
imports: import numpy
  import hashlib
label_desc: Use image node_id 1 for calling a global function with example usage: choose_from_list_without_replacement(a, size) and returns: unknown, a