def create_noiseless_virtual_processor_from_proto(
    processor_id: str, device_specification: v2.device_pb2.DeviceSpecification
) -> SimulatedLocalProcessor:
    """Creates a simulated local processor from a device specification proto.

    The device specification protocol buffer specifies qubits and gates on the device
    and can be retrieved from a stored "proto.txt" file or from the QCS API.

    Args:
        processor_id: name of the processor to simulate.
            Use `list_virtual_processors` to obtain available names.
        device_specification:  `v2.device_pb2.DeviceSpecification` proto to create
            a validating device from.
        gate_sets: Iterable of serializers to use in the processor.
    """

    device = grid_device.GridDevice.from_proto(device_specification)
    processor = _create_virtual_processor_from_device(processor_id, device, device_specification)
    return processor
Creates a simulated local processor from a device specification proto.

    The device specification protocol buffer specifies qubits and gates on the device
    and can be retrieved from a stored "proto.txt" file or from the QCS API.

    Args:
        processor_id: name of the processor to simulate.
            Use `list_virtual_processors` to obtain available names.
        device_specification:  `v2.device_pb2.DeviceSpecification` proto to create
            a validating device from.
        gate_sets: Iterable of serializers to use in the processor.
    
cirq-google/cirq_google/engine/virtual_engine_factory.py