docs: def close(self, filehandle):
          """Close openend file if no longer used."""
          with self.lock:
              if filehandle in self.files:
                  self.files[filehandle] -= 1
                  # trim the file cache
                  index = 0
                  size = len(self.past)
                  while size > self.size and index < size:
                      filehandle = self.past[index]
                      if self.files[filehandle] == 0:
                          filehandle.close()
                          del self.files[filehandle]
                          del self.past[index]
                          size -= 1
                      else:
                          index += 1