code: def fix_header_comment(filename, timestamp):
      
      # Fix input file.
      name = os.path.basename( filename )
      for line in fileinput.input( filename, inplace=1, mode="rU" ):
          # If header-comment already contains anything for '$Id$', remove it.
          line = re.sub(r'\$Id:[^$]+\$', r'$Id$', line.rstrip())
          # Replace '$Id$' by a string containing the file's name (and a timestamp)!
          line = re.sub(re.escape(r'$Id$'), r'$Id: ' + name + r' ' + timestamp.isoformat() + r' $', line.rstrip())
          print(line)
docs: Fixes the header-comment of the given file.