def move_to_pat(pat: str, offset: (float, float)=None, tolerance: int=<NUM_LIT:0>) -> None:
with tempfile.NamedTemporaryFile() as f:<EOL><INDENT>subprocess.call('''<STR_LIT>''' + f.name, shell=True)<EOL>loc = visgrep(f.name, pat, tolerance)<EOL><DEDENT>pat_size = get_png_dim(pat)<EOL>if offset is None:<EOL><INDENT>x, y = [l + ps//<NUM_LIT:2> for l, ps in zip(loc, pat_size)]<EOL><DEDENT>else:<EOL><INDENT>x, y = [l + ps*(off/<NUM_LIT:100>) for off, l, ps in zip(offset, loc, pat_size)]<EOL><DEDENT>mouse_move(x, y)<EOL>
See help for click_on_pat