def save_hash(self, location, basedir, ext=None):

        if isinstance(location, six.text_type):
            location = location.encode('utf-8')
        rel_path = hashed_path(location, ext=ext)
        path = os.path.join(basedir, rel_path)
        if not os.path.exists(path):
            path_dir, path_fname = os.path.split(path)
            try:
                os.makedirs(path_dir)
            except OSError:
                pass
            with open(path, 'wb') as out:
                out.write(self._bytes_body)
        return rel_path
Default command
dataset/ETHPy150Open lorien/grab/grab/document.py/Document.save_hash--crossover with--dataset/ETHPy150Open uwdata/termite-data-server/web2py/gluon/contrib/qdb.py/Cli.default