def is_primary(row : dict):
    """
    Determines if a row is in the Primary inbox. 
    These are emails that are in the Inbox, 
    but aren't in Spam, Promotions, or Trash. 
    """
    try:
        if (
           not row.get('Spam') and 
           not row.get('Category Promotions') and
           not row.get('Trash') and
           row['Inbox']
        ):
            return 1
    except Exception as e:
        print(e)
        print(row)
    return 0