# Path: ceagle/api_fake_data/base.py
# CONF = config.CONF
# def route(reg):
#     def decorator(method):
#     def __init__(self, name, endpoint):
#     def _setup_routing(self):
#     def _find_route(self, path):
#     def default(self, path, *args, **kwargs):
#     def get(self, path, **kwargs):
# def api_handler(fake):
#     def real_function_handler(real):
#         def choice_maker(*args, **kwargs):
# def randnum(from_num, to_num, round_by=2):
# class FakeClient(object):
# 
# Path: ceagle/api_fake_data/fake_regions.py
# REGIONS_NUM = 4
# def regions(detailed=False):
# def get_regions(detailed):


import datetime
import random
import flask
from ceagle.api_fake_data import base
from ceagle.api_fake_data import fake_regions

    elif service == "performance":
        null_probability = null_allowed and PERFORMANCE_NULL_PROBABILITY or 0
        data, avg = generate_values(period, 1, null_probability)
        return {"data": data, "duration": avg}

    elif service == "availability":
        null_probability = null_allowed and AVAILABILITY_NULL_PROBABILITY or 0
        data, avg = generate_values(period, 1, null_probability)
        return {"availability_data": data, "availability": avg}


def generate_region_data(region, period, service, null_allowed):
    data = fake_regions.regions(detailed=True).get(region)

    if not data:
        return ({"error": "Region '%s' not found" % region}, 404)

    if service not in data["services"]:
        error = ("Service '%s' is not available for region '%s'"
                 % (service, region))
        return ({"error": error}, 404)

    result = generate_service_data(period, service, null_allowed)
    return ({service: {region: result}, "period": period}, 200)


def generate_status_data(period, service):
    null_allowed = lucky(RESPONSE_TOTAL_NULL_PROBABILITY)
    data = {}

# Path: ceagle/api_fake_data/base.py
# CONF = config.CONF
# def route(reg):
#     def decorator(method):
#     def __init__(self, name, endpoint):
#     def _setup_routing(self):
#     def _find_route(self, path):
#     def default(self, path, *args, **kwargs):
#     def get(self, path, **kwargs):
# def api_handler(fake):
#     def real_function_handler(real):
#         def choice_maker(*args, **kwargs):
# def randnum(from_num, to_num, round_by=2):
# class FakeClient(object):
# 
# Path: ceagle/api_fake_data/fake_regions.py
# REGIONS_NUM = 4
# def regions(detailed=False):
# def get_regions(detailed):


# Path: ceagle/api_fake_data/fake_status.py
import datetime
import random
import flask
from ceagle.api_fake_data import base
from ceagle.api_fake_data import fake_regions


    elif service == "performance":
        null_probability = null_allowed and PERFORMANCE_NULL_PROBABILITY or 0
        data, avg = generate_values(period, 1, null_probability)
        return {"data": data, "duration": avg}

    elif service == "availability":
        null_probability = null_allowed and AVAILABILITY_NULL_PROBABILITY or 0
        data, avg = generate_values(period, 1, null_probability)
        return {"availability_data": data, "availability": avg}


def generate_region_data(region, period, service, null_allowed):
    data = fake_regions.regions(detailed=True).get(region)

    if not data:
        return ({"error": "Region '%s' not found" % region}, 404)

    if service not in data["services"]:
        error = ("Service '%s' is not available for region '%s'"
                 % (service, region))
        return ({"error": error}, 404)

    result = generate_service_data(period, service, null_allowed)
    return ({service: {region: result}, "period": period}, 200)


def generate_status_data(period, service):
    null_allowed = lucky(RESPONSE_TOTAL_NULL_PROBABILITY)
    data = {}

    for region in fake_regions.regions():