def METHOD_NAME(self, filename, key):
    if filename in self._loaded:
        # Data already exists in the cache.
        return self._loaded[filename].get(key)
    # TODO use the file lock like Juju does.
    filepath = os.path.join(self.path, filename)
    with io.open(filepath, 'rt') as f:
        data = yaml.safe_load(f)
        self._loaded[filename] = data
        return data.get(key)