<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run(path, code=None, params=None, **meta):
 """Check code with mypy. :return list: List of errors. """

        args = [path, '--follow-imports=skip', '--show-column-numbers']
        stdout, stderr, status = api.run(args)
        messages = []
        for line in stdout.split('\n'):
            line.strip()
            if not line:
                continue
            message = _MyPyMessage(line)
            if message.valid:
                if message.message_type == 'note':
                    if messages[-1].line_num == message.line_num:
                        messages[-1].add_note(message.text)
                else:
                    messages.append(message)

        return [m.to_result() for m in messages]