def get_token(context):
    """
    Retrieves the token the lambda was assigned when it was invoked.

    :param context: AWS Lambda context
    :type context: object
    :return: Lambda token, usually a UUID
    :rtype: str
    """

    # If that fails, fall back to the requestID
    # http://docs.aws.amazon.com/lambda/latest/dg/python-context-object.html
    return context.aws_request_id