def METHOD_NAME(file, pat, replace):
    with open(file, 'r') as f:
        content = f.read()
        if isinstance(pat, list):
            for p, r in zip(pat,replace):
                content_new = re.sub(p, r, content)
                content = content_new
        else:
            content_new = re.sub(pat, replace, content)
    with open(file, 'w') as f:
        f.write(content_new)