Comments (1)
def req_assert(*expressions, message: str = 'invalid', status_code: int = 200):
"""
Call this at any point to check if an expression is True. If any
of the expressions provided are False, then an anubis.utils.exceptions.AssertError
will be raised. The global handler will then use the message and status
code in a error_response.
>>> thing = None
>>> req_assert(thing is not None, message='thing was None')
>>> # raise AssertError('thing was None', 200)
:param expressions:
:param message:
:param status_code:
:return:
"""
if not all(expressions):
raise AssertError(message, status_code)
from anubis.
Related Issues (20)
- ADD resume to live autograde assignments HOT 1
- ADD new user injest HOT 1
- CLN optimize number of images HOT 1
- ADD image aware scheduling with node affinity
- ADD volume backup interface for students
- Question - "congratulations" but still displayed incomplete HOT 2
- BUG Project Task Boards Not Public HOT 3
- BUG color map for get_usage_plot exausted HOT 1
- BUG ordering of commits in a single should be preserved
- Forum Database
- Forum seed debug data
- Forum public post endpoints
- Forum admin endpoints
- Forum web components HOT 4
- Forum wire web
- Forum email notifications
- FIX 404 page not found with make debug HOT 4
- Overflow on post page
- Question - Link Github Account Error HOT 2
- BUG - Github OAuth Connection Failure HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anubis.