code: def get_correct_indentation_diff(code, filename):
      """
      Generate a diff to make code correctly indented.
  
      :param code: a string containing a file's worth of Python code
      :param filename: the filename being considered (used in diff generation only)
      :returns: a unified diff to make code correctly indented, or
                None if code is already correctedly indented
      """
      code_buffer = StringIO(code)
      output_buffer = StringIO()
      reindenter = reindent.Reindenter(code_buffer)
      reindenter.run()
      reindenter.write(output_buffer)
      reindent_output = output_buffer.getvalue()
      output_buffer.close()
      if code != reindent_output:
          diff_generator = difflib.unified_diff(
              code.splitlines(True),
              reindent_output.splitlines(True),
              fromfile=filename,
              tofile=filename + " (reindented)",
          )
          # work around http://bugs.python.org/issue2142
          diff_tuple = map(
              clean_diff_line_for_python_bug_2142, diff_generator
          )
          diff = "".join(diff_tuple)
          return diff
      else:
          return None
  
imports: from __future__ import absolute_import, print_function, division
  import difflib
  import operator
  import os
  import string
  from subprocess import Popen, PIPE
  import sys
  import tabnanny
  import tokenize
  import reindent
  from six import StringIO
label_desc: Use image node_id 3 for calling a global function with example usage: get_correct_indentation_diff(code, filename) and returns: diff, None