code: def _galois_group_degree_5_lookup_ext_factor(
      T, max_tries=30, randomize=False
  ):
      r"""
      Compute the Galois group of a polynomial of degree 5.
  
      Explanation
      ===========
  
      Based on Alg 6.3.9 of [1], but uses resolvent coeff lookup, plus
      factorization over an algebraic extension.
  
      """
      from sympy.combinatorics.galois import S5TransitiveSubgroups
  
      _T = T
  
      history = set()
      for i in range(max_tries):
          R_dup = get_resolvent_by_lookup(T, 1)
          if dup_sqf_p(R_dup, ZZ):
              break
          _, T = tschirnhausen_transformation(
              T,
              max_tries=max_tries,
              history=history,
              fixed_order=not randomize,
          )
      else:
          raise MaxTriesException
  
      sq_disc = has_square_disc(T)
  
      if dup_irreducible_p(R_dup, ZZ):
          return (
              (S5TransitiveSubgroups.A5, True)
              if sq_disc
              else (S5TransitiveSubgroups.S5, False)
          )
  
      if not sq_disc:
          return (S5TransitiveSubgroups.M20, False)
  
      # If we get this far, Gal(T) can only be D5 or C5.
      # But for Gal(T) to have order 5, T must already split completely in
      # the extension field obtained by adjoining a single one of its roots.
      fl = Poly(_T, domain=ZZ.alg_field_from_poly(_T)).factor_list()[1]
      if len(fl) == 5:
          return (S5TransitiveSubgroups.C5, True)
      else:
          return (S5TransitiveSubgroups.D5, True)
  
imports: from collections import defaultdict
  import random
  from sympy.core.symbol import Dummy, symbols
  from sympy.ntheory.primetest import is_square
  from sympy.polys.domains import ZZ
  from sympy.polys.densebasic import dup_random
  from sympy.polys.densetools import dup_eval
  from sympy.polys.euclidtools import dup_discriminant
  from sympy.polys.factortools import dup_factor_list, dup_irreducible_p
  from sympy.polys.numberfields.galois_resolvents import GaloisGroupException, get_resolvent_by_lookup, define_resolvents, Resolvent
  from sympy.polys.numberfields.utilities import coeff_search
  from sympy.polys.polytools import Poly, poly_from_expr, PolificationFailed, ComputationFailed
  from sympy.polys.sqfreetools import dup_sqf_p
  from sympy.utilities import public
label_desc: Use image node_id 7 for calling a global function with example usage: _galois_group_degree_5_lookup_ext_factor(T, max_tries, randomize) and returns: unknown, S5TransitiveSubgroups,  False, S5TransitiveSubgroups,  True, S5TransitiveSubgroups,  True