'Replace the string which match the pattern
to the value contained in pattern2repl_dict.'

def sub(self, pattern2repl_dict):

    lines = self._read_local()
    for (pattern, repl) in pattern2repl_dict.items():
        for index in range(len(lines)):
            line = lines[index]
            lines[index] = re.sub(pattern, repl, line)
    self._write_local(lines)
    self._push_file()
