def is_user_an_admin():
    """ Check user admin """
    import os
    if os.name == 'nt':
        try:
            os.listdir(os.sep.join([os.environ.get('SystemRoot',
                'C:\\windows'), 'temp']))
        except Exception:
            return False
        else:
            return True
    else:
        return 'SUDO_USER' in os.environ and os.geteuid() == 0
