code: def get_instance(
      model, method="file",
      img_dir=None, data_dir=None,
      bucket=None
  ):
      
      global _instances
      if not isinstance(model, ConsumeModel):
          raise TypeError(
              "get_instance() expects a parker.ConsumeModel derivative."
          )
  
      if method == "file":
          my_store = store.get_filestore_instance(
              img_dir=img_dir,
              data_dir=data_dir
          )
      elif method == "s3":
          my_store = store.get_s3store_instance(
              bucket=bucket
          )
      else:
          raise ValueError("Unexpected method value, '%s'." % method)
  
      key = "%s:%s" % (repr(model), repr(my_store))
  
      try:
          instance = _instances[key]
      except KeyError:
          instance = ConsumeStore(model, my_store)
          _instances[key] = instance
  
      return instance
docs: Return an instance of ConsumeStore.