code: def _descartes_check(vector_a, n):
      """
      Check the vector and choice n from it.
  
      :param list vector_a:
      :param int n: quantity to select
      :return list: list items which we random choice from vector.
      """
  
      assert isinstance(
          vector_a, list
      ), f"Vector_a should be `list`, not `{type(vector_a)}`."
      if not vector_a:
          raise ValueError(
              f"An empty vector cannot compute a Cartesian product"
          )
  
      vector = []
      for v in vector_a:
          if v not in vector:
              vector.append(v)
  
      if len(vector) > n:
          return random.sample(vector, n)
  
      return vector
  
imports: import copy
  import random
  from .logger import logger
label_desc: Use image node_id 18 for calling a global function with example usage: _descartes_check(vector_a, n) and returns: vector, random