(stix_object, source_name)
Grab external id from STIX2 object
Grab external id from STIX2 object
Grab external id from STIX2 object
def grab_external_id(stix_object, source_name):
    """Grab external id from STIX2 object"""
    for external_reference in stix_object.get("external_references", []):
        if external_reference.get("source_name") == source_name:
            return external_reference["external_id"]
def grab_external_id ( stix_object , source_name ) : for external_reference in stix_object . get ( "external_references" , [ ] ) : if external_reference . get ( "source_name" ) == source_name : return external_reference [ "external_id" ]