def post(self):
        if not may(CREATE):
            raise Forbidden()
        f = request.files.get('file')
        t = request.form.get('text')
        # note: "and f.filename" is needed due to missing __bool__ method in
        # werkzeug.datastructures.FileStorage, to work around it crashing
        # on Python 3.x.
        if f and f.filename:
            # Check Content-Range, disallow its usage
            if ContentRange.from_request():
                abort(416)

            # Check Content-Type, default to application/octet-stream
            content_type = (
                f.headers.get('Content-Type') or
                request.headers.get('Content-Type'))
            content_type_hint = 'application/octet-stream'
            filename = f.filename

            # Get size of temporary file
            f.seek(0, os.SEEK_END)
            size = f.tell()
            f.seek(0)
        elif t != None:
            # t is already unicode, but we want utf-8 for storage
            t = t.encode('utf-8')
            content_type = request.form.get('contenttype')  # TODO: add coding
            content_type_hint = 'text/plain'
            size = len(t)
            f = BytesIO(t)
            filename = request.form.get('filename')
        else:
            raise NotImplementedError
        # set max lifetime
        maxlife_unit = request.form.get('maxlife-unit', 'forever').upper()
        maxlife_value = int(request.form.get('maxlife-value', 1))
        maxtime = time_unit_to_sec(maxlife_value, maxlife_unit)
        maxlife_timestamp = int(time.time()) + maxtime if maxtime > 0 else maxtime
        name = create_item(f, filename, size, content_type, content_type_hint, maxlife_stamp=maxlife_timestamp)
        return redirect_next('bepasty.display', name=name, _anchor=url_quote(filename))
dataset/ETHPy150Open bepasty/bepasty-server/bepasty/views/upload.py/UploadView.post/operator `is not` -> `!=`