docs: def replace_in_file(args, in_file, regexp, repl):
      """
      Perfoms re.sub(regexp, repl, line) for each line in
      in_file
      """
      in_lines = []
      try:
          with open(in_file, "r") as in_fd:
              in_lines = in_fd.readlines()
      except (OSError, UnicodeDecodeError) as error:
          print("Cant open file:", in_file, error)
          return
  
      out_lines = in_lines[:]
      out_lines = [re.sub(regexp, repl, l) for l in in_lines]
  
      # Exit early if there's no diff:
      if in_lines == out_lines:
          return
  
      if not args.quiet:
          display_diff(in_file, regexp, repl, in_lines, out_lines)
  
      if not args.go:
          return
  
      if args.backup:
          backup(in_file, in_lines)
  
      with open(in_file, "w") as fd:
          fd.writelines(out_lines)