code: def get_collection(
      self,
      name,
      codec_options=None,
      read_preference=None,
      write_concern=None,
      read_concern=None,
  ):
      try:
          return self._collection_accesses[name].with_options(
              codec_options=codec_options or self._codec_options,
              read_preference=read_preference or self.read_preference,
              read_concern=read_concern,
              write_concern=write_concern,
          )
      except KeyError:
          self._ensure_valid_collection_name(name)
          collection = self._collection_accesses[
              name
          ] = FailingCollection(
              max_calls_before_failure=self._max_calls_before_failure,
              exception_to_raise=self._exception_to_raise,
              database=self,
              name=name,
              write_concern=write_concern,
              read_preference=read_preference or self.read_preference,
              codec_options=codec_options or self._codec_options,
              _db_store=self._store,
          )
          return collection
  
imports: import mongomock
  import pymongo
  import pymongo.errors
label_desc: Use image node_id 2 for calling the FailingDatabase obj's underlying member method code with example usage: obj.get_collection(name, codec_options, read_preference, write_concern, read_concern) and returns: self, collection