code: def get_f77flags(src):
      """
      Search the first 20 lines of fortran 77 code for line pattern
        `CF77FLAGS(<fcompiler type>)=<f77 flags>`
      Return a dictionary {<fcompiler type>:<f77 flags>}.
      """
      flags = {}
      f = open_latin1(src, "r")
      i = 0
      for line in f:
          i += 1
          if i > 20:
              break
          m = _f77flags_re.match(line)
          if not m:
              continue
          fcname = m.group("fcname").strip()
          fflags = m.group("fflags").strip()
          flags[fcname] = split_quoted(fflags)
      f.close()
      return flags
  
imports: from __future__ import division, absolute_import, print_function
  import os
  import sys
  import re
  import types
  from numpy.compat import open_latin1
  from distutils.sysconfig import get_python_lib
  from distutils.fancy_getopt import FancyGetopt
  from distutils.errors import DistutilsModuleError, DistutilsExecError, CompileError, LinkError, DistutilsPlatformError
  from distutils.util import split_quoted, strtobool
  from numpy.distutils.ccompiler import CCompiler, gen_lib_options
  from numpy.distutils import log
  from numpy.distutils.misc_util import is_string, all_strings, is_sequence, make_temp_file, get_shared_lib_extension
  from numpy.distutils.exec_command import find_executable
  from numpy.distutils.compat import get_exception
  from numpy.distutils import _shell_utils
  from .environment import EnvironmentConfig
label_desc: Use image node_id 13 for calling a global function with example usage: get_f77flags(src) and returns: flags