server package

Submodules

server.exceptions module

Definitions of global error types for the server.

exception server.exceptions.BadRequest(message, status_code=None, payload=None)

Bases: Exception

Exception type to be raised when the request is invalid

__init__(message, status_code=None, payload=None)
Parameters:
  • message – Message to be presented to the API use

  • status_code – Status code to be yielded by the server

  • payload – Payload of the operation, currently unused

status_code = 400
to_dict()
Returns:

A Dict containing the error message and None for the ‘results’ field

exception server.exceptions.InternalServerError(message, status_code=None, payload=None)

Bases: Exception

Exception type to be raised when there is an error in any part of the AI pipeline

__init__(message, status_code=None, payload=None)
Parameters:
  • message – Message to be presented to the API use

  • status_code – Status code to be yielded by the server

  • payload – Payload of the operation, currently unused

status_code = 500
to_dict()
Returns:

A Dict containing the error message and None for the ‘results’ field

server.fast_server module

server.flask_server module

server.parallel_support module

class server.parallel_support.Work(uuid, input_data, steps=None)

Bases: object

__init__(uuid, input_data, steps=None)

Initialize self. See help(type(self)) for accurate signature.

server.parallel_support.create_queues(conf, n_parallel)
server.parallel_support.target_wrapper(q, done_q, conf, nr)