<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _database_from_key(self, key):
 """ gets the database name for the given key. Should ensure a uniform spread of keys over the databases in order to minimize waiting times. Since the database has to be locked for updates and multiple processes want to write, each process has to wait until the lock has been released. By default the LRU databases will be stored in a sub directory "traj_info_usage" lying next to the main database. :param key: hash of the TrajInfo instance :return: str, database path """

        if not self.filename:
            return None

        from pyemma.util.files import mkdir_p
        hash_value_long = int(key, 16)
        # bin hash to one of either 10 different databases
        # TODO: make a configuration parameter out of this number
        db_name = str(hash_value_long)[-1] + '.db'
        directory = os.path.dirname(self.filename) + os.path.sep + 'traj_info_usage'
        mkdir_p(directory)
        return os.path.join(directory, db_name)