def create(self):
        if not self.request.FILES:
            raise NoContentError("No file has been uploaded.")

        submitted_file = self.request.FILES.values()[0]
        name = str(submitted_file.name)
        size = submitted_file.size

        try:
            file_ = tempfile.NamedTemporaryFile(
                mode='wb',
                suffix=name[name.rfind('.'):],
                delete=False
            )
            for chunk in submitted_file.chunks():
                file_.write(chunk)
            file_.close()

            parser = registry.appropriate_handler(
                self.resource,
                language=self.language,
                filename=name
            )
            parser.bind_file(file_.name)
            if parser is None:
                raise BadRequestError("Unknown file type")
            if size == 0:
                raise BadRequestError("Empty file")

            try:
                parser.is_content_valid()
                logger.debug("Uploaded file %s" % file_.name)
            except (FileCheckError, ParseError), e:
                raise BadRequestError("Error uploading file: %s" % e)
            except Exception, e:
                logger.error(unicode(e), exc_info=True)
                raise BadRequestError("A strange error happened.")

            parser.bind_file(file_.name)
            res = self._parse_translation(parser)
        finally:
            os.unlink(file_.name)
        return res
Return the exponentiation of a square matrix.
dataset/ETHPy150Open rvanlaar/easy-transifex/src/transifex/transifex/resources/api.py/FileTranslation.create--crossover with--dataset/ETHPy150Open sympy/sympy/sympy/matrices/matrices.py/MatrixBase.exp