def get_mimetype(self):
        if hasattr(self, '_mimetype'):
            if (isinstance(self._mimetype, (tuple, list,)) and
                len(self._mimetype) == 2):
                return self._mimetype
            else:
                raise NodeError('given _mimetype attribute must be an 2 '
                               'element list or tuple')

        mtype, encoding = mimetypes.guess_type(self.name)

        if mtype is None:
            if self.is_binary:
                mtype = 'application/octet-stream'
                encoding = None
            else:
                mtype = 'text/plain'
                encoding = None
        return mtype, encoding
Any useless file that has a name property (for Django).
dataset/ETHPy150Open codeinn/vcs/vcs/nodes.py/FileNode.get_mimetype--crossover with--dataset/ETHPy150Open mozilla/addons-server/src/olympia/devhub/tests/test_views_validation.py/TestUploadCompatCheck.fake_xpi