def get_region(context):
    """
    Retrieves the AWS region the lambda is executing in.

    :param context: AWS Lambda context
    :type context: object
    :return: AWS region
    :rtype: str
    """
    # http://docs.aws.amazon.com/lambda/latest/dg/python-context-object.html
    arn = context.invoked_function_arn
    return arn.split(':')[3]