code: def fix_empty_methods(source):
      
      def_indentation_level = 0
      output = ""
      just_matched = False
      previous_line = None
      method = re.compile(r'^\s*def\s*.*\(.*\):.*$')
      for line in source.split('\n'):
          if len(line.strip()) > 0: # Don't look at blank lines
              if just_matched == True:
                  this_indentation_level = len(line.rstrip()) - len(line.strip())
                  if def_indentation_level == this_indentation_level:
                      # This method is empty, insert a 'pass' statement
                      indent = " " * (def_indentation_level + 1)
                      output += "%s\n%spass\n%s\n" % (previous_line, indent, line)
                  else:
                      output += "%s\n%s\n" % (previous_line, line)
                  just_matched = False
              elif method.match(line):
                  def_indentation_level = len(line) - len(line.strip())
                  just_matched = True
                  previous_line = line
              else:
                  output += "%s\n" % line # Another self-test
          else:
              output += "\n"
      return output
docs: Appends 'pass' to empty methods/functions (i.e. where there was nothing but
      a docstring before we removed it =).
  
      Example::
  
          # Note: This triple-single-quote inside a triple-double-quote is also a
          # pyminifier self-test
          def myfunc():
              '''This is just a placeholder function.'''
  
      Will become::
  
          def myfunc(): pass