parameters: (list_of_list)
return_statement: return result
docstring: Be carefull : one mathematical property of cartesian product is that
      when you do a cartesian products of a set and an empty set, the result
      is an empty set.
docstring_summary: Be carefull : one mathematical property of cartesian product is that
      when you do a cartesian products of a set and an empty set, the result
      is an empty set.
docstring_tokens: Be carefull : one mathematical property of cartesian product is that when you do a cartesian products of a set and an empty set the result is an empty set .
function: def cartesianProduct(list_of_list):
    """
      Be carefull : one mathematical property of cartesian product is that
      when you do a cartesian products of a set and an empty set, the result
      is an empty set.
    """
    if len(list_of_list) == 0:
      return [[]]
    result = []
    append = result.append
    head = list_of_list[0]
    tail = list_of_list[1:]
    product = cartesianProduct(tail)
    for v in head:
      for p in product:
        append([v] + p)
    return result
function_tokens: def cartesianProduct ( list_of_list ) : if len ( list_of_list ) == 0 : return [ [ ] ] result = [ ] append = result . append head = list_of_list [ 0 ] tail = list_of_list [ 1 : ] product = cartesianProduct ( tail ) for v in head : for p in product : append ( [ v ] + p ) return result