<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def auto(func, filename, *args, **kwargs):
 """If `filename` is a remote file, then this function calls func on the micropython board, otherwise it calls it locally. """

    dev, dev_filename = get_dev_and_path(filename)
    if dev is None:
        if len(dev_filename) > 0 and dev_filename[0] == '~':
            dev_filename = os.path.expanduser(dev_filename)
        return func(dev_filename, *args, **kwargs)
    return dev.remote_eval(func, dev_filename, *args, **kwargs)