Open the store from disk
769812
def from_file(self, filename):
        
        with gzip.open(filename, 'rb') as f:
            self.parse(f.read())
1084010
def BDEVolumeOpen(bde_volume, path_spec, file_object, key_chain):
  
  password = key_chain.GetCredential(path_spec, 'password')
  if password:
    bde_volume.set_password(password)

  recovery_password = key_chain.GetCredential(path_spec, 'recovery_password')
  if recovery_password:
    bde_volume.set_recovery_password(recovery_password)

  startup_key = key_chain.GetCredential(path_spec, 'startup_key')
  if startup_key:
    bde_volume.read_startup_key(startup_key)

  bde_volume.open_file_object(file_object)
403813
def load(cls, webfinger, pypump):
        
        filename = cls.get_filename()

        if os.path.isfile(filename):
            data = open(filename).read()
            data = json.loads(data)
            store = cls(data, filename=filename)
        else:
            store = cls(filename=filename)

        store.prefix = webfinger
        return store
228639
def Open(self):
        """"""
        # Make sure we close any previous handle open to this usb device.
        port_path = tuple(self.port_path)
        with self._HANDLE_CACHE_LOCK:
            old_handle = self._HANDLE_CACHE.get(port_path)
            if old_handle is not None:
                old_handle.Close()

        self._read_endpoint = None
        self._write_endpoint = None

        for endpoint in self._setting.iterEndpoints():
            address = endpoint.getAddress()
            if address & libusb1.USB_ENDPOINT_DIR_MASK:
                self._read_endpoint = address
                self._max_read_packet_len = endpoint.getMaxPacketSize()
            else:
                self._write_endpoint = address

        assert self._read_endpoint is not None
        assert self._write_endpoint is not None

        handle = self._device.open()
        iface_number = self._setting.getNumber()
        try:
            if (platform.system() != 'Windows'
                    and handle.kernelDriverActive(iface_number)):
                handle.detachKernelDriver(iface_number)
        except libusb1.USBError as e:
            if e.value == libusb1.LIBUSB_ERROR_NOT_FOUND:
                _LOG.warning('Kernel driver not found for interface: %s.', iface_number)
            else:
                raise
        handle.claimInterface(iface_number)
        self._handle = handle
        self._interface_number = iface_number

        with self._HANDLE_CACHE_LOCK:
            self._HANDLE_CACHE[port_path] = self
        # When this object is deleted, make sure it's closed.
        weakref.ref(self, self.Close)
47655
def load_from_store(self):
        
        if not self._store:
            raise AttributeError('No datastore defined!')
        if self._store.has_blob('all_keys'):
            data = Serializer.deserialize(self._store.get_blob('all_keys'))
            self.load_from_data(data)
            return True
        elif self._store.has_blob('all_keys_with_undefined'):
            blob = self._store.get_blob('all_keys_with_undefined')
            data = Serializer.deserialize(blob)
            self.load_from_data(data, with_undefined=True)
            return True
        else:
            return False
182963
def load_store(cls, store, decoder=None):
        
        variables, attributes = store.load()
        if decoder:
            variables, attributes = decoder(variables, attributes)
        obj = cls(variables, attrs=attributes)
        obj._file_obj = store
        return obj
336928
def open(self):
        
        self.clearException()
        try:
            if self._isOpen:
                logger.warn("Resources already open. Closing them first before opening.")
                self._closeResources()
                self._isOpen = False

            assert not self._isOpen, "Sanity check failed: _isOpen should be false"
            logger.debug("Opening {}".format(self))
            self._openResources()
            self._isOpen = True

            if self.model:
                self.model.sigItemChanged.emit(self)
            else:
                logger.warning("Model not set yet: {}".format(self))

        except Exception as ex:
            if DEBUGGING:
                raise
            logger.exception("Error during tree item open: {}".format(ex))
            self.setException(ex)
1090228
def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        
        if self._closed:
            self._raise_closed()
        return FakeFileOpen(self.filesystem, use_io=True)(
            self._path(), mode, buffering, encoding, errors, newline)
998575
def load(self):
        """"""

        with open(self.store_file_path, 'r') as fh:
            self.store = json.loads(fh.read())
907359
def open(store_name)
      certstore_handler = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, nil, CERT_SYSTEM_STORE_LOCAL_MACHINE, wstring(store_name))
      unless certstore_handler
        last_error = FFI::LastError.error
        raise SystemCallError.new("Unable to open the Certificate Store `#{store_name}`.", last_error)
      end
      add_finalizer(certstore_handler)
      certstore_handler
    end
309421
def create_store(self):
        
        if self.store_class is not None:
            return self.store_class.load(self.client.webfinger, self)

        raise NotImplementedError("You need to specify PyPump.store_class or override PyPump.create_store method.")
191396
def open( self ):
        """"""
        if self._connection is None:
            self._connection = sqlite3.connect(self._dbfile)
920513
public void open() {
        try {
            switch(this.documentSettings.getDataCacheStyle()) {
            	case RtfDataCache.CACHE_MEMORY_EFFICIENT:  
            		this.data = new RtfEfficientMemoryCache(); 
            		break;
                case RtfDataCache.CACHE_MEMORY:
                	this.data = new RtfMemoryCache();
                	break;
                case RtfDataCache.CACHE_DISK:
                	this.data = new RtfDiskCache();
                	break;
                default:
                	throw new RuntimeException("unknown");
            }
    		
        } catch(IOException ioe) {
            System.err.println("Could not initialize disk cache. Using memory cache.");
            ioe.printStackTrace();
            this.data = new RtfMemoryCache();
        }
    }
1143648
function createStore(storeObj) {
    switch(storeObj.type) {
      case 'redis':
        return RedisStore(thorin, storeObj, opt);
      case 'sql':
        return SqlStore(thorin, storeObj, opt);
      case 'file':
        return FileStore(thorin, storeObj.path, opt);
      case 'memory':
        return MemStore(thorin, opt);
      default:
        throw thorin.error('PLUGIN_SESSION', `Invalid session store ${storeObj.type} for the session plugin.`);
    }
  }
179299
def open(self):
        """"""
        try:
            connection = self.transport_class(
                host=self.hostname,
                username=self.username,
                password=self.password,
                timeout=self.timeout,
                **self.eapi_kwargs
            )

            if self.device is None:
                self.device = pyeapi.client.Node(connection, enablepwd=self.enablepwd)
            # does not raise an Exception if unusable

            # let's try to run a very simple command
            self.device.run_commands(["show clock"], encoding="text")
        except ConnectionError as ce:
            # and this is raised either if device not avaiable
            # either if HTTP(S) agent is not enabled
            # show management api http-commands
            raise ConnectionException(py23_compat.text_type(ce))
306224
def get_store(logger: Logger=None) -> 'Store':
    """"""
    from trading_bots.conf import settings
    store_settings = settings.storage
    store = store_settings.get('name', 'json')
    if store == 'json':
        store = 'trading_bots.core.storage.JSONStore'
    elif store == 'redis':
        store = 'trading_bots.core.storage.RedisStore'
    store_cls = load_class_by_name(store)
    kwargs = store_cls.configure(store_settings)
    return store_cls(logger=logger, **kwargs)
958436
def open(self, mode='r', **kwargs):
        """"""
        _fs, filename = opener.parse(self.uri)
        return _fs.open(filename, mode=mode, **kwargs)