def _write_func_code(self, filename, func_code, first_line):
        """ Write the function code and the filename to a file.
        """
        # We store the first line because the filename and the function
        # name is not always enough to identify a function: people
        # sometimes have several functions named the same way in a
        # file. This is bad practice, but joblib should be robust to bad
        # practice.
        func_code = u'%s %i\n%s' % (FIRST_LINE_TEXT, first_line, func_code)
        with io.open(filename, 'w', encoding="UTF-8") as out:
            out.write(func_code)
        # Also store in the in-memory store of function hashes
        is_named_callable = False
        if PY3_OR_LATER:
            is_named_callable = (hasattr(self.func, '__name__')
                                 and self.func.__name__ != '<lambda>')
        else:
            is_named_callable = (hasattr(self.func, 'func_name')
                                 and self.func.func_name != '<lambda>')
        if is_named_callable:
            # Don't do this for lambda functions or strange callable
            # objects, as it ends up being too fragile
            func_hash = self._hash_func()
            try:
                _FUNCTION_HASHES[self.func] = func_hash
            except __HOLE__:
                # Some callable are not hashable
                pass
dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/externals/joblib/memory.py/MemorizedFunc._write_func_code