code: def retain_identities(retention_time, es_enrichment_url, sortinghat_db, data_source, active_data_sources):
      before_date = get_diff_current_date(minutes=retention_time)
      before_date_str = before_date.isoformat()
      es = Elasticsearch([es_enrichment_url], timeout=120, max_retries=20, retry_on_timeout=True, verify_certs=False)
      delete_inactive_unique_identities(es, sortinghat_db, before_date_str)
      delete_orphan_unique_identities(es, sortinghat_db, data_source, active_data_sources)