code: def run(self):
      tokenize.tokenize(self.getline, self.tokeneater)
      # Remove trailing empty lines.
      lines = self.lines
      while lines and lines[-1] == "\n":
          lines.pop()
      # Sentinel.
      stats = self.stats
      stats.append((len(lines), 0))
      # Map count of leading spaces to # we want.
      have2want = {}
      # Program after transformation.
      after = self.after = []
      # Copy over initial empty lines -- there's nothing to do until
      # we see a line with *something* on it.
      i = stats[0][0]
      after.extend(lines[1:i])
      for i in range(len(stats) - 1):
          thisstmt, thislevel = stats[i]
          nextstmt = stats[i + 1][0]
          have = getlspace(lines[thisstmt])
          want = thislevel * 4
          if want < 0:
              # A comment line.
              if have:
                  # An indented comment line.  If we saw the same
                  # indentation before, reuse what it most recently
                  # mapped to.
                  want = have2want.get(have, -1)
                  if want < 0:
                      # Then it probably belongs to the next real stmt.
                      for j in xrange(i + 1, len(stats) - 1):
                          jline, jlevel = stats[j]
                          if jlevel >= 0:
                              if have == getlspace(lines[jline]):
                                  want = jlevel * 4
                              break
                  if want < 0:  # Maybe it's a hanging
                      # comment like this one,
                      # in which case we should shift it like its base
                      # line got shifted.
                      for j in xrange(i - 1, -1, -1):
                          jline, jlevel = stats[j]
                          if jlevel >= 0:
                              want = (
                                  have
                                  + getlspace(after[jline - 1])
                                  - getlspace(lines[jline])
                              )
                              break
                  if want < 0:
                      # Still no luck -- leave it alone.
                      want = have
              else:
                  want = 0
          assert want >= 0
          have2want[have] = want
          diff = want - have
          if diff == 0 or have == 0:
              after.extend(lines[thisstmt:nextstmt])
          else:
              for line in lines[thisstmt:nextstmt]:
                  if diff > 0:
                      if line == "\n":
                          after.append(line)
                      else:
                          after.append(" " * diff + line)
                  else:
                      remove = min(getlspace(line), -diff)
                      after.append(line[remove:])
      return self.raw != self.after
  
file_path: Theano/theano/misc/hooks/reindent.py
imports: from __future__ import absolute_import, print_function, division
  import tokenize
  import os, shutil
  import sys
  from six.moves import xrange
label_desc: Use image node_id 2 for calling the Reindenter obj's underlying member method code with example usage: obj.run() and returns: unknown