Get an instance. The master password file is given by masterPwdLoc.
350049
public static PasswordManager getInstance(Path masterPwdLoc) {
    State state = new State();
    state.setProp(ConfigurationKeys.ENCRYPT_KEY_LOC, masterPwdLoc.toString());
    state.setProp(ConfigurationKeys.ENCRYPT_KEY_FS_URI, masterPwdLoc.toUri());
    try {
      return CACHED_INSTANCES
          .get(new CachedInstanceKey(state));
    } catch (ExecutionException e) {
      throw new RuntimeException("Unable to get an instance of PasswordManager", e);
    }
  }
782793
def __get_password(self, description='',
                       confirm=False, clear=False, username='glances'):
        
        from glances.password import GlancesPassword
        password = GlancesPassword(username=username)
        return password.get_password(description, confirm, clear)
758027
def credentials(login=None):
    
    if not login:
        login = environ.get("PROF_LOGIN")
    password = environ.get("PROF_PASSWORD")
    if not login:
        try:
            login = input("login? ")
            print("\t\tDon't get prompted everytime. Store your login in the ``~/.profrc`` config file")
        except KeyboardInterrupt:
            exit(0)
    if not password:
        try:
            password = getpass.getpass("pass for {0} ? ".format(login))
        except KeyboardInterrupt:
            exit(0)
    return (login, password)
838472
def master_for(self, service):
        """"""
        # TODO: make it coroutine and connect minsize connections
        if service not in self._masters:
            self._masters[service] = ManagedPool(
                self, service, is_master=True,
                db=self._redis_db,
                password=self._redis_password,
                encoding=self._redis_encoding,
                minsize=self._redis_minsize,
                maxsize=self._redis_maxsize,
                ssl=self._redis_ssl,
                parser=self._parser_class,
                loop=self._loop)
        return self._masters[service]
260212
public static function getInstance() {

		if( !isset( self::$instance ) ) {

			self::$instance	= new FileProperties();

			self::$instance->init( self::CONFIG_FILE );
		}

		return self::$instance;
	}
93255
def __get_keys(self, name='master', passphrase=None):
        '''
        
        '''
        path = os.path.join(self.opts['pki_dir'],
                            name + '.pem')
        if not os.path.exists(path):
            log.info('Generating %s keys: %s', name, self.opts['pki_dir'])
            gen_keys(self.opts['pki_dir'],
                     name,
                     self.opts['keysize'],
                     self.opts.get('user'),
                     passphrase)
        if HAS_M2:
            key_error = RSA.RSAError
        else:
            key_error = ValueError
        try:
            key = get_rsa_key(path, passphrase)
        except key_error as e:
            message = 'Unable to read key: {0}; passphrase may be incorrect'.format(path)
            log.error(message)
            raise MasterExit(message)
        log.debug('Loaded %s key: %s', name, path)
        return key
50700
def masterfile?(element_key)
      if Tools.class_type(element_key) == 'DO' # Only DO Types can have a file
        file_list = load(element_key)
        unless file_list.nil?
          file_list.each do |file|
            return true if file.fileStorageType.casecmp('master').zero?
          end
        end
      end
      false
    end
480817
private String getPassword(ISecurityContext baseContext) {
        String password = null;
        IOpaqueCredentials oc = baseContext.getOpaqueCredentials();

        if (oc instanceof NotSoOpaqueCredentials) {
            NotSoOpaqueCredentials nsoc = (NotSoOpaqueCredentials) oc;
            password = nsoc.getCredentials();
        }

        // If still no password, loop through subcontexts to find cached credentials
        Enumeration en = baseContext.getSubContexts();
        while (password == null && en.hasMoreElements()) {
            ISecurityContext subContext = (ISecurityContext) en.nextElement();
            password = this.getPassword(subContext);
        }

        return password;
    }
466408
def __proxy_password(self):
        """"""
        passwd = copy(self._inp_proxy_password.value)
        self._inp_proxy_password.value = ''
        return passwd
1061816
public static FileUtil getInstance() {

    if (instance == null) {
      synchronized (FileUtilImpl.class) {
        if (instance == null) {
          FileUtilImpl util = new FileUtilImpl();
          util.initialize();
          instance = util;
        }
      }
    }
    return instance;
  }
80904
public int getMasterSlave()
    {
    	int iMasterSlave = super.getMasterSlave();
    	if (iMasterSlave == RecordOwner.MASTER)
    		if (this.getClass() == org.jbundle.base.remote.db.TableSession.class)
    			return RecordOwner.SLAVE;       // Auto-created session is the Slave session (Unless it was overridden)
        return iMasterSlave;
    }
575039
def get_master_ip(host=None, port=None, password=None):
    '''
    
    '''
    server = _connect(host, port, password)
    srv_info = server.info()
    ret = (srv_info.get('master_host', ''), srv_info.get('master_port', ''))
    return dict(list(zip(('master_host', 'master_port'), ret)))
880539
public synchronized int getPrimaryMasterIndex(int timeoutMs)
      throws TimeoutException, InterruptedException {
    final FileSystem fs = getFileSystemClient();
    final MasterInquireClient inquireClient = getMasterInquireClient();
    CommonUtils.waitFor("a primary master to be serving", () -> {
      try {
        // Make sure the leader is serving.
        fs.getStatus(new AlluxioURI("/"));
        return true;
      } catch (UnavailableException e) {
        return false;
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }, WaitForOptions.defaults().setTimeoutMs(timeoutMs));
    int primaryRpcPort;
    try {
      primaryRpcPort = inquireClient.getPrimaryRpcAddress().getPort();
    } catch (UnavailableException e) {
      throw new RuntimeException(e);
    }
    // Returns the master whose RPC port matches the primary RPC port.
    for (int i = 0; i < mMasterAddresses.size(); i++) {
      if (mMasterAddresses.get(i).getRpcPort() == primaryRpcPort) {
        return i;
      }
    }
    throw new RuntimeException(
        String.format("No master found with RPC port %d. Master addresses: %s", primaryRpcPort,
            mMasterAddresses));
  }
192833
private static String createMasterWebUrl() {
    InetSocketAddress masterWeb = NetworkAddressUtils.getConnectAddress(
        ServiceType.MASTER_WEB, ServerConfiguration.global());
    return "http://" + masterWeb.getHostString() + ":" + masterWeb.getPort();
  }
206472
def get_password_data(self, instance_id):
        

        params = {'InstanceId' : instance_id}
        rs = self.get_object('GetPasswordData', params, ResultSet, verb='POST')
        return rs.passwordData
674927
def get_password(self):
        
        if self.password is None:
            if os.environ.get(self.username+'password'):
                self.password = os.environ.get(self.username+'password')
            else:
                raise PasswordError(self.username)
581739
def get_instance(key, expire=None):
    """"""
    global _instances
    try:
        instance = _instances[key]
    except KeyError:
        instance = RedisSet(
            key,
            _redis,
            expire=expire
        )
        _instances[key] = instance

    return instance