docs: def get_object_references(tb, source, max_string_length=1000):
      """
      Find the values of referenced attributes of objects within the traceback scope.
  
      :param tb: traceback
      :return: list of tuples containing (variable name, value)
      """
      global obj_ref_regex
      referenced_attr = set()
      for line in source.split('\n'):
          referenced_attr.update(set(re.findall(obj_ref_regex, line)))
      referenced_attr = sorted(referenced_attr)
      info = []
      for attr in referenced_attr:
          v = string_variable_lookup(tb, attr)
          if v is not ValueError:
              ref_string = format_reference(v, max_string_length=max_string_length)
              info.append((attr, ref_string))
      return info