nodes: 0, module; 1, function_definition; 2, function_name:JSONList; 3, parameters; 4, block; 5, list_splat_pattern; 6, dictionary_splat_pattern; 7, expression_statement; 8, expression_statement; 9, try_statement; 10, return_statement; 11, identifier:args; 12, identifier:kwargs; 13, comment:"""Stores a list as JSON on database, with mutability support.
  
      If kwargs has a param `unique_sorted` (which evaluated to True),
      list values are made unique and sorted.
      """; 14, assignment; 15, block; 16, except_clause; 17, call; 18, identifier:type_; 19, identifier:JSON; 20, if_statement; 21, identifier:KeyError; 22, block; 23, attribute; 24, argument_list; 25, call; 26, block; 27, pass_statement; 28, identifier:MutationList; 29, identifier:as_mutable; 30, call; 31, attribute; 32, argument_list; 33, expression_statement; 34, identifier:type_; 35, argument_list; 36, identifier:kwargs; 37, identifier:pop; 38, string:"unique_sorted"; 39, assignment; 40, list_splat; 41, dictionary_splat; 42, identifier:type_; 43, identifier:JSONUniqueListType; 44, identifier:args; 45, identifier:kwargs
code: def JSONList(*args, **kwargs):
      """Stores a list as JSON on database, with mutability support.
  
      If kwargs has a param `unique_sorted` (which evaluated to True),
      list values are made unique and sorted.
      """
      type_ = JSON
      try:
          if kwargs.pop("unique_sorted"):
              type_ = JSONUniqueListType
      except KeyError:
          pass
  
      return MutationList.as_mutable(type_(*args, **kwargs))