'Check whether the current session has privileges to change the hosts
file of current operating system.
.. note:: This is a `classmethod`.
:return: username, flag
* username(`str`): Username of the user running current session.
* flag(`bool`): A flag indicating whether the current session has
write privileges to the hosts file or not.
:rtype: str, bool'

@classmethod
def check_privileges(cls):

    if (os.name == 'nt'):
        try:
            os.listdir(os.sep.join([os.environ.get('SystemRoot', 'C:\\windows'), 'temp']))
        except:
            return (os.environ['USERNAME'], False)
        else:
            return (os.environ['USERNAME'], True)
    else:
        w_flag = os.access('/etc/hosts', os.W_OK)
        try:
            return (os.environ['USERNAME'], w_flag)
        except KeyError:
            return (os.environ['USER'], w_flag)
