def _extract_tree_entry(self, path, tree_response):
        """extract a single tree entry from a file list
        
        For use as a callback in get_tree_entry
        raises 404 if not found
        """
        tree_response.rethrow()
        jsondata = response_text(tree_response)
        data = json.loads(jsondata)
        for entry in data['tree']:
            if entry['path'] == path:
                return entry
        
        raise HTTPError(404, "%s not found among %i files" % (path, len(data['tree'])))
dataset/ETHPy150Open jupyter/nbviewer/nbviewer/providers/github/client.py/AsyncGitHubClient._extract_tree_entry/original