nodes: 0, module; 1, function_definition; 2, function_name:uniq; 3, parameters; 4, block; 5, identifier:container; 6, expression_statement; 7, try_statement; 8, return_statement; 9, comment:"""
      Check if all of a container's elements are unique.
  
      Successively tries first to rely that the elements are hashable, then
      falls back on them being sortable, and finally falls back on brute
      force.
  
      """; 10, block; 11, except_clause; 12, True; 13, return_statement; 14, identifier:TypeError; 15, block; 16, comparison_operator:len(set(unbool(i) for i in container)) == len(container); 17, try_statement; 18, call; 19, call; 20, block; 21, except_clause; 22, identifier:len; 23, argument_list; 24, identifier:len; 25, argument_list; 26, expression_statement; 27, expression_statement; 28, for_statement; 29, tuple; 30, block; 31, call; 32, identifier:container; 33, assignment; 34, assignment; 35, pattern_list; 36, call; 37, block; 38, identifier:NotImplementedError; 39, identifier:TypeError; 40, expression_statement; 41, for_statement; 42, identifier:set; 43, generator_expression; 44, identifier:sort; 45, call; 46, identifier:sliced; 47, call; 48, identifier:i; 49, identifier:j; 50, identifier:zip; 51, argument_list; 52, if_statement; 53, assignment; 54, identifier:e; 55, identifier:container; 56, block; 57, call; 58, for_in_clause; 59, identifier:sorted; 60, generator_expression; 61, attribute; 62, argument_list; 63, identifier:sort; 64, identifier:sliced; 65, comparison_operator:i == j; 66, block; 67, identifier:seen; 68, list; 69, expression_statement; 70, if_statement; 71, expression_statement; 72, identifier:unbool; 73, argument_list; 74, identifier:i; 75, identifier:container; 76, call; 77, for_in_clause; 78, identifier:itertools; 79, identifier:islice; 80, identifier:sort; 81, integer:1; 82, None; 83, identifier:i; 84, identifier:j; 85, return_statement; 86, assignment; 87, comparison_operator:e in seen; 88, block; 89, call; 90, identifier:i; 91, identifier:unbool; 92, argument_list; 93, identifier:i; 94, identifier:container; 95, False; 96, identifier:e; 97, call; 98, identifier:e; 99, identifier:seen; 100, return_statement; 101, attribute; 102, argument_list; 103, identifier:i; 104, identifier:unbool; 105, argument_list; 106, False; 107, identifier:seen; 108, identifier:append; 109, identifier:e; 110, identifier:e
code: def uniq(container):
      """
      Check if all of a container's elements are unique.
  
      Successively tries first to rely that the elements are hashable, then
      falls back on them being sortable, and finally falls back on brute
      force.
  
      """
  
      try:
          return len(set(unbool(i) for i in container)) == len(container)
      except TypeError:
          try:
              sort = sorted(unbool(i) for i in container)
              sliced = itertools.islice(sort, 1, None)
              for i, j in zip(sort, sliced):
                  if i == j:
                      return False
          except (NotImplementedError, TypeError):
              seen = []
              for e in container:
                  e = unbool(e)
                  if e in seen:
                      return False
                  seen.append(e)
      return True