nodes: 0, module; 1, function_definition; 2, function_name:to_list; 3, parameters; 4, block; 5, identifier:thing; 6, expression_statement; 7, if_statement; 8, if_statement; 9, if_statement; 10, if_statement; 11, return_statement; 12, comment:""" converts an object to a list
  
          >>> to_list(1)
          [1]
          >>> to_list([1,2,3])
          [1, 2, 3]
          >>> to_list(("a", "b", "c"))
          ['a', 'b', 'c']
          >>> to_list(dict(a=1, b=2))
          [{'a': 1, 'b': 2}]
          >>> to_list(None)
          []
          >>> to_list("['a', 'b', 'c']")
          ['a', 'b', 'c']
          >>> to_list("")
          ['']
          >>> to_list([])
          []
          >>> to_list("['[]']")
          ['[]']
          >>> sorted(to_list(set(["a", "b", "c"])))
          ['a', 'b', 'c']
      """; 13, comparison_operator:thing is None; 14, block; 15, call; 16, block; 17, call; 18, block; 19, not_operator; 20, block; 21, call; 22, identifier:thing; 23, None; 24, return_statement; 25, identifier:isinstance; 26, argument_list; 27, return_statement; 28, identifier:isinstance; 29, argument_list; 30, if_statement; 31, parenthesized_expression; 32, return_statement; 33, identifier:list; 34, argument_list; 35, list; 36, identifier:thing; 37, identifier:set; 38, call; 39, identifier:thing; 40, attribute; 41, call; 42, comment:# handle a list inside a string coming from the batch navigation; 43, block; 44, boolean_operator; 45, list; 46, identifier:thing; 47, identifier:list; 48, argument_list; 49, identifier:types; 50, identifier:StringTypes; 51, attribute; 52, argument_list; 53, return_statement; 54, call; 55, call; 56, identifier:thing; 57, identifier:thing; 58, identifier:thing; 59, identifier:startswith; 60, string:"["; 61, call; 62, identifier:is_list; 63, argument_list; 64, identifier:is_tuple; 65, argument_list; 66, attribute; 67, argument_list; 68, identifier:thing; 69, identifier:thing; 70, identifier:ast; 71, identifier:literal_eval; 72, identifier:thing
code: def to_list(thing):
      """ converts an object to a list
  
          >>> to_list(1)
          [1]
          >>> to_list([1,2,3])
          [1, 2, 3]
          >>> to_list(("a", "b", "c"))
          ['a', 'b', 'c']
          >>> to_list(dict(a=1, b=2))
          [{'a': 1, 'b': 2}]
          >>> to_list(None)
          []
          >>> to_list("['a', 'b', 'c']")
          ['a', 'b', 'c']
          >>> to_list("")
          ['']
          >>> to_list([])
          []
          >>> to_list("['[]']")
          ['[]']
          >>> sorted(to_list(set(["a", "b", "c"])))
          ['a', 'b', 'c']
      """
      if thing is None:
          return []
      if isinstance(thing, set):
          return list(thing)
      if isinstance(thing, types.StringTypes):
          if thing.startswith("["):
              # handle a list inside a string coming from the batch navigation
              return ast.literal_eval(thing)
      if not (is_list(thing) or is_tuple(thing)):
          return [thing]
      return list(thing)