How to programmatically determine whether a node is a og group type node? Drupal 7, OG

How to programmatically determine whether a node is an og group type node?
I found a way to do this using og_get_group_ids() :

og_get_group_ids('node', array($nid));


If the result is not empty then the node is an og group type node.