def __init__(self, suppress_warning=False):
        """
        :param suppress_warning:
            Whether to suppress the warning message for any mismatch found in the environment variables and the dx
            configuration file
        :type suppress_warning: boolean
        """
        try:
            dxpy._DEBUG = int(environ.get("_DX_DEBUG", 0))
        except ValueError as e:
            warn("WARNING: Expected _DX_DEBUG to be an integer, but got", environ["_DX_DEBUG"])
            dxpy._DEBUG = 0

        try:
            dxpy._INJECT_ERROR = bool(environ.get("_DX_INJECT_ERROR", 0))
        except:
            dxpy._INJECT_ERROR = False

        self._user_conf_dir = expanduser(environ.get("DX_USER_CONF_DIR", "~/.dnanexus_config"))

        dxpy._UPGRADE_NOTIFY = os.path.join(self._user_conf_dir, ".upgrade_notify")
        # If last upgrade notification was less than 24 hours ago, disable it
        if os.path.exists(dxpy._UPGRADE_NOTIFY) and os.path.getmtime(dxpy._UPGRADE_NOTIFY) > time.time() - 86400:
            dxpy._UPGRADE_NOTIFY = False

        env_vars = self._read_conf_dir(self.get_global_conf_dir())
        env_vars.update(self._read_conf_dir(self.get_user_conf_dir()))
        env_vars.update(self._read_conf_dir(self.get_session_conf_dir(cleanup=True)))
        env_overrides = []
        for var in self.VAR_NAMES:
            if var in environ:
                if var in env_vars and env_vars.get(var) != environ[var]:
                    env_overrides.append(var)
                env_vars[var] = environ[var]

        for var in env_vars:
            if env_vars[var] is not None:
                environ[var] = env_vars[var]

        if sys.stdout.isatty():
            if not suppress_warning and len(env_overrides) > 0:
                msg = "WARNING: The following environment variables were found to be different than the values " + \
                      "last stored by dx: "
                warn(fill(msg + ", ".join(env_overrides), width=80))
                msg = "To use the values stored by dx, unset the environment variables in your shell by running " + \
                      '"source ~/.dnanexus_config/unsetenv".  To clear the dx-stored values, run "dx clearenv".'
                warn(fill(msg, width=80))

        self._sync_dxpy_state()
def __init__ ( self , suppress_warning = False ) : try : dxpy . _DEBUG = int ( environ . get ( "_DX_DEBUG" , 0 ) ) except ValueError as e : warn ( "WARNING: Expected _DX_DEBUG to be an integer, but got" , environ [ "_DX_DEBUG" ] ) dxpy . _DEBUG = 0 try : dxpy . _INJECT_ERROR = bool ( environ . get ( "_DX_INJECT_ERROR" , 0 ) ) except : dxpy . _INJECT_ERROR = False self . _user_conf_dir = expanduser ( environ . get ( "DX_USER_CONF_DIR" , "~/.dnanexus_config" ) ) dxpy . _UPGRADE_NOTIFY = os . path . join ( self . _user_conf_dir , ".upgrade_notify" ) if os . path . exists ( dxpy . _UPGRADE_NOTIFY ) and os . path . getmtime ( dxpy . _UPGRADE_NOTIFY ) > time . time ( ) - 86400 : dxpy . _UPGRADE_NOTIFY = False env_vars = self . _read_conf_dir ( self . get_global_conf_dir ( ) ) env_vars . update ( self . _read_conf_dir ( self . get_user_conf_dir ( ) ) ) env_vars . update ( self . _read_conf_dir ( self . get_session_conf_dir ( cleanup = True ) ) ) env_overrides = [ ] for var in self . VAR_NAMES : if var in environ : if var in env_vars and env_vars . get ( var ) != environ [ var ] : env_overrides . append ( var ) env_vars [ var ] = environ [ var ] for var in env_vars : if env_vars [ var ] is not None : environ [ var ] = env_vars [ var ] if sys . stdout . isatty ( ) : if not suppress_warning and len ( env_overrides ) > 0 : msg = "WARNING: The following environment variables were found to be different than the values " + "last stored by dx: " warn ( fill ( msg + ", " . join ( env_overrides ) , width = 80 ) ) msg = "To use the values stored by dx, unset the environment variables in your shell by running " + '"source ~/.dnanexus_config/unsetenv".  To clear the dx-stored values, run "dx clearenv".' warn ( fill ( msg , width = 80 ) ) self . _sync_dxpy_state ( )
:param suppress_warning:
            Whether to suppress the warning message for any mismatch found in the environment variables and the dx
            configuration file
        :type suppress_warning: boolean