def create_device_spec_from_processor_id(processor_id: str) -> v2.device_pb2.DeviceSpecification:
    """Generates a `v2.device_pb2.DeviceSpecification` for a given processor ID.

    Args:
        processor_id: name of the processor to simulate.
            Use `list_virtual_processors` to obtain available names.

    Raises:
        ValueError: if processor_id is not a supported QCS processor.
    """
    template_name = MOST_RECENT_TEMPLATES.get(processor_id, None)
    if template_name is None:
        raise ValueError(f"Got processor_id={processor_id}, but no such processor is defined.")
    return _create_device_spec_from_template(template_name)
Generates a `v2.device_pb2.DeviceSpecification` for a given processor ID.

    Args:
        processor_id: name of the processor to simulate.
            Use `list_virtual_processors` to obtain available names.

    Raises:
        ValueError: if processor_id is not a supported QCS processor.
    
cirq-google/cirq_google/engine/virtual_engine_factory.py