def post(self, request, format=None):
serializer = self.serializer_class(data=request.data)<EOL>if serializer.is_valid():<EOL><INDENT>login(request, serializer.instance)<EOL>if request.data.get('<STR_LIT>'):<EOL><INDENT>request.session.set_expiry(<NUM_LIT> * <NUM_LIT> * <NUM_LIT> * <NUM_LIT:7> * <NUM_LIT:3>)<EOL><DEDENT>else:<EOL><INDENT>request.session.set_expiry(<NUM_LIT:0>)<EOL><DEDENT>return Response({<EOL>'<STR_LIT>': _(u'<STR_LIT>'),<EOL>'<STR_LIT:user>': ProfileOwnSerializer(serializer.instance,<EOL>context={'<STR_LIT>': request}).data<EOL>})<EOL><DEDENT>return Response(serializer.errors, status=<NUM_LIT>)<EOL>
authenticate