Return a storage manager which can process this resource.
514630
def _get_storage_manager(resource):
    """"""
    for manager in (AmazonS3, ArvadosKeep, SevenBridges, DNAnexus, AzureBlob, GoogleCloud, RegularServer):
        if manager.check_resource(resource):
            return manager()

    raise ValueError("Unexpected object store  %(resource)s" %
                     {"resource": resource})
1147451
def get_storage(key, username):
    """"""
    if IS_APPENGINE and appengine:
        return appengine.StorageByKeyName(
            appengine.CredentialsModel, username, 'credentials')
    file_name = os.path.expanduser('~/.config/webreview/{}_{}'.format(key, username))
    dir_name = os.path.dirname(file_name)
    if not os.path.exists(dir_name):
        os.makedirs(dir_name)
    return oauth_file.Storage(file_name)
959197
def open(self, name, mode='rb'):
        
        return self.get_storage(name).open(name, mode)
1317818
def get_files_from_storage(paths):
        """"""
        for path in paths:
            f = default_storage.open(path)
            f.name = os.path.basename(path)
            try:
                yield f
            except ClientError:
                logger.exception("File not found: %s", path)
508120
def simple_storages(self):
        
        return simple_storage.SimpleStorageCollection(
            self._conn, utils.get_subresource_path_by(self, 'SimpleStorage'),
            redfish_version=self.redfish_version)
1264026
def from_api_repr(cls, resource):
        
        action = resource["action"]
        instance = cls(action["storageClass"], _factory=True)
        instance.update(resource)
        return instance
1187616
def get_storage(self, id_or_uri):
        
        uri = self.URI + "/{}/storage".format(extract_id_from_uri(id_or_uri))
        return self._client.get(uri)
687151
def from_storage(cls, storage):
        
        args = dict(storage.settings.get('markov', {}))
        args['storage'] = storage
        return cls(**args)
792519
private LogBufferManager<D,T> getOrCreateManager() {
        if (null == manager.get()) {
            installManager();
        }
        return manager.get();
    }
1019442
protected Object getCacheManager() {
        CacheManager cacheManager = CacheManager.getInstance();
        if (cacheManager != null)
            return cacheManager;
        return CacheManager.newInstance();
    }
748132
public static FileSystemManager getFileSystemManager() {
        try {
            final FileSystemManager manager = VFS.getManager();
            if (manager.getBaseFile() == null) {
                // if no base file exists, set the working directory to base
                // dir.
                ((DefaultFileSystemManager) manager).setBaseFile(new File("."));
            }
            return manager;
        } catch (final FileSystemException e) {
            throw new IllegalStateException(e);
        }
    }
161142
function _new_manager(){
    var engine = new jquery_engine(golr_response);
    engine.method('GET');
    engine.use_jsonp(true);
    var manager = new golr_manager(gserv_bulk, gconf, engine, 'async');
    return manager;
}
944981
async def get_storage_list(self) -> List[Storage]:
        """"""
        return [
            Storage.make(**x)
            for x in await self.services["system"]["getStorageList"]({})
        ]
1056061
def get_or_create(name,  value):

    

    if name not in storage:
        storage[name] = value
    return storage[name]
751067
def manager(self):
        """"""
        from flask_script import Manager, Command

        manager = Manager(usage="Migrate database.")
        manager.add_command('create', Command(self.cmd_create))
        manager.add_command('migrate', Command(self.cmd_migrate))
        manager.add_command('rollback', Command(self.cmd_rollback))
        manager.add_command('list', Command(self.cmd_list))
        manager.add_command('merge', Command(self.cmd_merge))

        return manager
634844
def get(self, item):
        
        if isinstance(item, six.string_types):
            item = super(StorageClient, self).get(item)
        return item
1042288
def ProcessStorage(self):
    
    self._CheckStorageFile(self._storage_file_path)

    self._status_view.SetMode(self._status_view_mode)
    self._status_view.SetStorageFileInformation(self._storage_file_path)

    status_update_callback = (
        self._status_view.GetAnalysisStatusUpdateCallback())

    session = engine.BaseEngine.CreateSession(
        command_line_arguments=self._command_line_arguments,
        preferred_encoding=self.preferred_encoding)

    storage_reader = storage_factory.StorageFactory.CreateStorageReaderForFile(
        self._storage_file_path)
    if not storage_reader:
      logger.error('Format of storage file: {0:s} not supported'.format(
          self._storage_file_path))
      return

    self._number_of_analysis_reports = (
        storage_reader.GetNumberOfAnalysisReports())
    storage_reader.Close()

    configuration = configurations.ProcessingConfiguration()
    configuration.data_location = self._data_location
    configuration.profiling.directory = self._profiling_directory
    configuration.profiling.sample_rate = self._profiling_sample_rate
    configuration.profiling.profilers = self._profilers

    analysis_counter = None
    if self._analysis_plugins:
      storage_writer = (
          storage_factory.StorageFactory.CreateStorageWriterForFile(
              session, self._storage_file_path))

      # TODO: add single processing support.
      analysis_engine = psort.PsortMultiProcessEngine(
          use_zeromq=self._use_zeromq)

      analysis_engine.AnalyzeEvents(
          self._knowledge_base, storage_writer, self._data_location,
          self._analysis_plugins, configuration,
          event_filter=self._event_filter,
          event_filter_expression=self._event_filter_expression,
          status_update_callback=status_update_callback,
          worker_memory_limit=self._worker_memory_limit)

      analysis_counter = collections.Counter()
      for item, value in iter(session.analysis_reports_counter.items()):
        analysis_counter[item] = value

    if self._output_format != 'null':
      storage_reader = (
          storage_factory.StorageFactory.CreateStorageReaderForFile(
              self._storage_file_path))

      # TODO: add single processing support.
      analysis_engine = psort.PsortMultiProcessEngine(
          use_zeromq=self._use_zeromq)

      analysis_engine.ExportEvents(
          self._knowledge_base, storage_reader, self._output_module,
          configuration, deduplicate_events=self._deduplicate_events,
          event_filter=self._event_filter,
          status_update_callback=status_update_callback,
          time_slice=self._time_slice, use_time_slicer=self._use_time_slicer)

    if self._quiet_mode:
      return

    self._output_writer.Write('Processing completed.\n')

    if analysis_counter:
      table_view = views.ViewsFactory.GetTableView(
          self._views_format_type, title='Analysis reports generated')
      for element, count in analysis_counter.most_common():
        if element != 'total':
          table_view.AddRow([element, count])

      table_view.AddRow(['Total', analysis_counter['total']])
      table_view.Write(self._output_writer)

    storage_reader = storage_factory.StorageFactory.CreateStorageReaderForFile(
        self._storage_file_path)
    self._PrintAnalysisReportsDetails(storage_reader)