<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def convert(source, to, format=None, extra_args=(), encoding='utf-8'):
 """Convert given `source` from `format` `to` another. `source` may be either a file path or a string to be converted. It's possible to pass `extra_args` if needed. In case `format` is not provided, it will try to invert the format based on given `source`. Raises OSError if pandoc is not found! Make sure it has been installed and is available at path. """

    return _convert(
        _read_file, _process_file,
        source, to,
        format, extra_args,
        encoding=encoding)