# 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
                stamps.append("%sT%.2i:00" % (day, hour))
    return stamps


def lucky(probability):
    """Return a boolean status with given probability.

    :param probability: int <= 100,
                        0 will always cause False result
    :rtype: bool
    """
    if probability:
        return random.randint(1, 100) <= probability
    return False


def generate_values(period_or_timestamps,
                    ratio=1, null_probability=20, integer=False):
    if type(period_or_timestamps) == list:
        timestamps = period_or_timestamps
    else:
        timestamps = generate_timestamps(period_or_timestamps)
    if timestamps:
        data = []
        data_avg = []
        for ts in timestamps:
            if lucky(null_probability):
                data.append([ts, None])
            else:
                if not integer:

# 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

                stamps.append("%sT%.2i:00" % (day, hour))
    return stamps


def lucky(probability):
    """Return a boolean status with given probability.

    :param probability: int <= 100,
                        0 will always cause False result
    :rtype: bool
    """
    if probability:
        return random.randint(1, 100) <= probability
    return False


def generate_values(period_or_timestamps,
                    ratio=1, null_probability=20, integer=False):
    if type(period_or_timestamps) == list:
        timestamps = period_or_timestamps
    else:
        timestamps = generate_timestamps(period_or_timestamps)
    if timestamps:
        data = []
        data_avg = []
        for ts in timestamps:
            if lucky(null_probability):
                data.append([ts, None])
            else:
                if not integer:

                    value = base.randnum(.7, 1) * ratio