<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_protocol(protocol_code: Any = None, protocol_json: Dict[Any, Any] = None, simulate: bool = False, context: ProtocolContext = None):
 """ Create a ProtocolRunner instance from one of a variety of protocol sources. :param protocol_bytes: If the protocol is a Python protocol, pass the file contents here. :param protocol_json: If the protocol is a json file, pass the contents here. :param simulate: True to simulate; False to execute. If this is not an OT2, ``simulate`` will be forced ``True``. :param context: The context to use. If ``None``, create a new ProtocolContext. """

    if not config.IS_ROBOT:
        simulate = True # noqa - will be used later
    if None is context and simulate:
        true_context = ProtocolContext()
        true_context.home()
        MODULE_LOG.info("Generating blank protocol context for simulate")
    elif context:
        true_context = context
    else:
        raise RuntimeError(
            'Will not automatically generate hardware controller')
    if None is not protocol_code:
        _run_python(protocol_code, true_context)
    elif None is not protocol_json:
        protocol_version = get_protocol_schema_version(protocol_json)
        if protocol_version > 3:
            raise RuntimeError(
                f'JSON Protocol version {protocol_version} is not yet ' +
                'supported in this version of the API')

        validate_protocol(protocol_json)

        if protocol_version >= 3:
            ins = execute_v3.load_pipettes_from_json(
                true_context, protocol_json)
            lw = execute_v3.load_labware_from_json_defs(
                true_context, protocol_json)
            execute_v3.dispatch_json(true_context, protocol_json, ins, lw)
        else:
            ins = execute_v1.load_pipettes_from_json(
                true_context, protocol_json)
            lw = execute_v1.load_labware_from_json_loadnames(
                true_context, protocol_json)
            execute_v1.dispatch_json(true_context, protocol_json, ins, lw)
    else:
        raise RuntimeError("run_protocol must have either code or json")