nodes: 0, module; 1, function_definition; 2, function_name:power; 3, parameters; 4, block; 5, identifier:set_; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, return_statement; 10, comment:"""Returns all subsets of given set.
  
      :return: Powerset of given set, i.e. iterable containing all its subsets,
               sorted by ascending cardinality.
      """; 11, call; 12, assignment; 13, call; 14, identifier:ensure_countable; 15, argument_list; 16, identifier:result; 17, call; 18, identifier:_harmonize_subset_types; 19, argument_list; 20, identifier:set_; 21, attribute; 22, generator_expression; 23, identifier:set_; 24, identifier:result; 25, identifier:chain; 26, identifier:from_iterable; 27, call; 28, for_in_clause; 29, identifier:combinations; 30, argument_list; 31, identifier:r; 32, call; 33, identifier:set_; 34, identifier:r; 35, identifier:xrange; 36, argument_list; 37, binary_operator:len(set_) + 1; 38, call; 39, integer:1; 40, identifier:len; 41, argument_list; 42, identifier:set_
code: def power(set_):
      """Returns all subsets of given set.
  
      :return: Powerset of given set, i.e. iterable containing all its subsets,
               sorted by ascending cardinality.
      """
      ensure_countable(set_)
  
      result = chain.from_iterable(combinations(set_, r)
                                   for r in xrange(len(set_) + 1))
      return _harmonize_subset_types(set_, result)