def put_file(self, key, file, ttl_secs=None):
        """Like :meth:`~simplekv.KeyValueStore.put_file`, but with an
           additional parameter:

           :param ttl_secs: Number of seconds until the key expires. See above
                            for valid values.
           :raises exceptions.ValueError: If ``ttl_secs`` is invalid.
        """
        if ttl_secs is None:
            ttl_secs = self.default_ttl_secs

        self._check_valid_key(key)

        if isinstance(file, str):
            return self._put_filename(key, file, self._valid_ttl(ttl_secs))
        else:
            return self._put_file(key, file, self._valid_ttl(ttl_secs))
Like :meth:`~simplekv.KeyValueStore.put_file`, but with an
           additional parameter:

           :param ttl_secs: Number of seconds until the key expires. See above
                            for valid values.
           :raises exceptions.ValueError: If ``ttl_secs`` is invalid.