code: def resolve_all(x, default=None):
      
      while isinstance(x, PDFObjRef):
          x = x.resolve(default=default)
      if isinstance(x, list):
          x = [resolve_all(v, default=default) for v in x]
      elif isinstance(x, dict):
          for (k, v) in x.iteritems():
              x[k] = resolve_all(v, default=default)
      return x
docs: Recursively resolves the given object and all the internals.
  
      Make sure there is no indirect reference within the nested object.
      This procedure might be slow.