code: def scanvars(reader, frame, locals):
      """Scan one logical line of Python and look up values of variables used."""
      vars, lasttoken, parent, prefix, value = (
          [],
          None,
          None,
          "",
          __UNDEF__,
      )
      for ttype, token, start, end, line in tokenize.generate_tokens(
          reader
      ):
          if ttype == tokenize.NEWLINE:
              break
          if ttype == tokenize.NAME and token not in keyword.kwlist:
              if lasttoken == ".":
                  if parent is not __UNDEF__:
                      value = getattr(parent, token, __UNDEF__)
                      vars.append((prefix + token, prefix, value))
              else:
                  where, value = lookup(token, frame, locals)
                  vars.append((token, where, value))
          elif token == ".":
              prefix += lasttoken + "."
              parent = value
          else:
              parent, prefix = None, ""
          lasttoken = token
      return vars
  
imports: import inspect
  import keyword
  import linecache
  import os
  import pydoc
  import sys
  import tempfile
  import time
  import tokenize
  import traceback
  import warnings
  from html import escape
label_desc: Use image node_id 6 for calling a global function with example usage: scanvars(reader, frame, locals) and returns: vars