code: def get_terminal_names(terminals, rules, ignore_names):
      """Get names of all terminals in the grammar.
  
      The arguments are the results of calling ``Lark.grammar.compile()``,
      so you would think that the ``terminals`` and ``ignore_names`` would
      have it all... but they omit terminals created with ``@declare``,
      which appear only in the expansion(s) of nonterminals.
      """
      names = {t.name for t in terminals} | set(ignore_names)
      for rule in rules:
          names |= {
              t.name for t in rule.expansion if isinstance(t, Terminal)
          }
      return names
  
imports: from __future__ import absolute_import, division, print_function
  import attr
  import lark
  from lark.grammar import NonTerminal, Terminal
  import hypothesis.strategies._internal.core
  from hypothesis.errors import InvalidArgument
  from hypothesis.internal.compat import getfullargspec, string_types
  from hypothesis.internal.conjecture.utils import calc_label_from_name
  from hypothesis.internal.validation import check_type
  from hypothesis.strategies._internal import SearchStrategy
label_desc: Use image node_id 1 for calling a global function with example usage: get_terminal_names(terminals, rules, ignore_names) and returns: names