<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def reference_links(doc):
 """Get reference links"""

    if doc.get('type') == 'organisation' and doc.get('state') != 'deactivated':
        for asset_id_type, link in doc.get('reference_links', {}).get('links', {}).items():
            value = {
                'organisation_id': doc['_id'],
                'link': link
            }
            yield asset_id_type, value