nodes: 0, module; 1, function_definition; 2, function_name:ungrounded_texts; 3, parameters; 4, block; 5, identifier:stmts; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, return_statement; 12, comment:"""Return a list of all ungrounded entities ordered by number of mentions
  
      Parameters
      ----------
      stmts : list of :py:class:`indra.statements.Statement`
  
      Returns
      -------
      ungroundc : list of tuple
         list of tuples of the form (text: str, count: int) sorted in descending
         order by count.
      """; 13, assignment; 14, assignment; 15, assignment; 16, assignment; 17, identifier:ungroundc; 18, identifier:ungrounded; 19, list_comprehension; 20, identifier:ungroundc; 21, call; 22, identifier:ungroundc; 23, call; 24, identifier:ungroundc; 25, call; 26, subscript; 27, for_in_clause; 28, for_in_clause; 29, if_clause; 30, identifier:Counter; 31, argument_list; 32, attribute; 33, argument_list; 34, identifier:sorted; 35, argument_list; 36, attribute; 37, string; 38, identifier:s; 39, identifier:stmts; 40, identifier:ag; 41, call; 42, boolean_operator; 43, identifier:ungrounded; 44, identifier:ungroundc; 45, identifier:items; 46, identifier:ungroundc; 47, keyword_argument; 48, keyword_argument; 49, identifier:ag; 50, identifier:db_refs; 51, string_content:TEXT; 52, attribute; 53, argument_list; 54, comparison_operator:ag is not None; 55, comparison_operator:list(ag.db_refs.keys()) == ['TEXT']; 56, identifier:key; 57, lambda; 58, identifier:reverse; 59, True; 60, identifier:s; 61, identifier:agent_list; 62, identifier:ag; 63, None; 64, call; 65, list; 66, lambda_parameters; 67, subscript; 68, identifier:list; 69, argument_list; 70, string; 71, identifier:x; 72, identifier:x; 73, integer:1; 74, call; 75, string_content:TEXT; 76, attribute; 77, argument_list; 78, attribute; 79, identifier:keys; 80, identifier:ag; 81, identifier:db_refs
code: def ungrounded_texts(stmts):
      """Return a list of all ungrounded entities ordered by number of mentions
  
      Parameters
      ----------
      stmts : list of :py:class:`indra.statements.Statement`
  
      Returns
      -------
      ungroundc : list of tuple
         list of tuples of the form (text: str, count: int) sorted in descending
         order by count.
      """
      ungrounded = [ag.db_refs['TEXT']
                    for s in stmts
                    for ag in s.agent_list()
                    if ag is not None and list(ag.db_refs.keys()) == ['TEXT']]
      ungroundc = Counter(ungrounded)
      ungroundc = ungroundc.items()
      ungroundc = sorted(ungroundc, key=lambda x: x[1], reverse=True)
      return ungroundc