def METHOD_NAME(self, cognite_client_beta):
    entities = [
        {"sample": "[PH]-ME-P-0156-001", "resourceType": "file_reference"},
        {"sample": "23-TI-92101-01", "resourceType": "instrument"},
    ]
    detected = cognite_client_beta.diagrams.detect(
        file_references=[
            FileReference(file_external_id=ELEVEN_PAGE_PNID_EXTERNAL_ID, first_page=11, last_page=11),
        ],
        entities=entities,
        pattern_mode=True,
    )
    result = detected.result
    detected_by_resource_type = defaultdict(list)
    for annotation in result["items"][0]["annotations"]:
        detected_by_resource_type[annotation["entities"][0]["resourceType"]].append(annotation)
    assert len(detected_by_resource_type["file_reference"]) >= 10  # 14 seen when making the test
    assert len(detected_by_resource_type["instrument"]) >= 60  # 72 seen when making the test