code: def descartes(calculation_items, n):
      """
      :param list calculation_items:
      :param int n: quantity to select
      :return list: list items which we random choice from Cartesian product.
      """
  
      assert isinstance(
          calculation_items, list
      ), f"Calculation_items should be list, not `{type(calculation_items)}`."
      assert (
          isinstance(n, int) and n > 0
      ), f"n should be int and n should be greater than 0."
      if not calculation_items:
          raise ValueError(
              f"An empty vector cannot participate in operation"
          )
      if len(calculation_items) == 1:
          res = _descartes_check(calculation_items[0], n)
          return [[k] for k in res]
      choice_descartes = [[item] for item in calculation_items[0]]
      for i in range(1, len(calculation_items)):
          choice_descartes = _get_descartes(
              choice_descartes, calculation_items[i], n
          )
      return choice_descartes
  
imports: import copy
  import random
  from .logger import logger
label_desc: Use image node_id 16 for calling a global function with example usage: descartes(calculation_items, n) and returns: choice_descartes, unknown