<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def prepare_data(data: Data) -> Tuple[int, bytes]: """ Convert a string or byte-like object to an opcode and a bytes-like object. This function is designed for data frames. If ``data`` is a :class:`str`, return ``OP_TEXT`` and a :class:`bytes` object encoding ``data`` in UTF-8. If ``data`` is a bytes-like object, return ``OP_BINARY`` and a bytes-like object. Raise :exc:`TypeError` for other inputs. """

    if isinstance(data, str):
        return OP_TEXT, data.encode("utf-8")
    elif isinstance(data, (bytes, bytearray)):
        return OP_BINARY, data
    elif isinstance(data, memoryview):
        if data.c_contiguous:
            return OP_BINARY, data
        else:
            return OP_BINARY, data.tobytes()
    else:
        raise TypeError("data must be bytes-like or str")