code: def make_first_graph(
      rules: Dict[str, Rule]
  ) -> Dict[str, AbstractSet[str]]:
      """Compute the graph of left-invocations.
  
      There's an edge from A to B if A may invoke B at its initial
      position.
  
      Note that this requires the nullable flags to have been computed.
      """
      initial_name_visitor = InitialNamesVisitor(rules)
      graph = {}
      vertices: Set[str] = set()
      for rulename, rhs in rules.items():
          graph[rulename] = names = initial_name_visitor.visit(rhs)
          vertices |= names
      for vertex in vertices:
          graph.setdefault(vertex, set())
      return graph
  
imports: import ast
  import contextlib
  import re
  from abc import abstractmethod
  from typing import IO, AbstractSet, Any, Dict, Iterable, Iterator, List, Optional, Set, Text, Tuple, Union
  from pegen import sccutils
  from pegen.grammar import Alt, Cut, Forced, Gather, Grammar, GrammarError, GrammarVisitor, Group, Lookahead, NamedItem, NameLeaf, Opt, Plain, Repeat0, Repeat1, Rhs, Rule, StringLeaf
label_desc: Use image node_id 3 for calling a global function with example usage: make_first_graph(rules) and returns: graph