nodes: 0, module; 1, function_definition; 2, function_name:findunique; 3, parameters; 4, block; 5, identifier:lst; 6, identifier:key; 7, expression_statement; 8, return_statement; 9, comment:"""
      Find all unique key values for items in lst.
  
      Parameters
      ----------
  
      lst: list
           A list of composite dictionaries e.g. ``layers``, ``classes``
      key: string
          The key name to search each dictionary in the list
  
      Returns
      -------
  
      list
          A sorted Python list of unique keys in the list
  
      Example
      -------
  
      To find all ``GROUP`` values for ``CLASS`` in a ``LAYER``::
  
          s = '''
          LAYER
              CLASS
                  GROUP "group1"
                  NAME "Class1"
                  COLOR 0 0 0
              END
              CLASS
                  GROUP "group2"
                  NAME "Class2"
                  COLOR 0 0 0
              END
              CLASS
                  GROUP "group1"
                  NAME "Class3"
                  COLOR 0 0 0
              END
          END
          '''
  
          d = mappyfile.loads(s)
          groups = mappyfile.findunique(d["classes"], "group")
          assert groups == ["group1", "group2"]
      """; 10, call; 11, identifier:sorted; 12, argument_list; 13, call; 14, identifier:set; 15, argument_list; 16, list_comprehension; 17, subscript; 18, for_in_clause; 19, identifier:item; 20, call; 21, identifier:item; 22, identifier:lst; 23, attribute; 24, argument_list; 25, identifier:key; 26, identifier:lower
code: def findunique(lst, key):
      """
      Find all unique key values for items in lst.
  
      Parameters
      ----------
  
      lst: list
           A list of composite dictionaries e.g. ``layers``, ``classes``
      key: string
          The key name to search each dictionary in the list
  
      Returns
      -------
  
      list
          A sorted Python list of unique keys in the list
  
      Example
      -------
  
      To find all ``GROUP`` values for ``CLASS`` in a ``LAYER``::
  
          s = '''
          LAYER
              CLASS
                  GROUP "group1"
                  NAME "Class1"
                  COLOR 0 0 0
              END
              CLASS
                  GROUP "group2"
                  NAME "Class2"
                  COLOR 0 0 0
              END
              CLASS
                  GROUP "group1"
                  NAME "Class3"
                  COLOR 0 0 0
              END
          END
          '''
  
          d = mappyfile.loads(s)
          groups = mappyfile.findunique(d["classes"], "group")
          assert groups == ["group1", "group2"]
      """
      return sorted(set([item[key.lower()] for item in lst]))