<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse(source):
 """Parses source code returns an array of instructions suitable for optimization and execution by a Machine. Args: source: A string or stream containing source code. """

    if isinstance(source, str):
        return parse_stream(six.StringIO(source))
    else:
        return parse_stream(source)