# Path: signalz/misc.py
# def check_type_or_raise(obj, expected_type, obj_name):
#     """
#     This fuction raises error if the object does not have expected type.
#     """
#     if not isinstance(obj, expected_type):
#         raise TypeError(
#             "'{}' must be {}, not {}".format(
#                 obj_name,
#                 expected_type.__name__,
#                 obj.__class__.__name__)
#             )


import numpy as np
from signalz.misc import check_type_or_raise
    **Args:**
    
    * `step_width` - desired width of every step (int)
    
    * `values` - values for steps (1d array) 
    
    **Kwargs:**
         
    * `repeat` - number of step sequence repetions (int), this variable is used,
      if the `size` is not defined
    
    * `size` - size of output data in samples (int), if the `size` is used,
      the `repeat` is ignored.
    
    **Returns:**
    
    * array of values representing desired steps (1d array)
    """
    check_type_or_raise(step_width, int, "step width")
    check_type_or_raise(repeat, int, "repeat")
    try:
        values = np.array(values)
    except:
        raise ValueError('Values must be a numpy array or similar.') 
    # generate steps
    x = np.repeat(values, step_width)          
    if size is None:
        # repeat according to the desired repetions
        x_full = np.tile(x, repeat)      
    else:

# Path: signalz/misc.py
# def check_type_or_raise(obj, expected_type, obj_name):
#     """
#     This fuction raises error if the object does not have expected type.
#     """
#     if not isinstance(obj, expected_type):
#         raise TypeError(
#             "'{}' must be {}, not {}".format(
#                 obj_name,
#                 expected_type.__name__,
#                 obj.__class__.__name__)
#             )


# Path: signalz/generators/steps.py
import numpy as np
from signalz.misc import check_type_or_raise

    **Args:**
    
    * `step_width` - desired width of every step (int)
    
    * `values` - values for steps (1d array) 
    
    **Kwargs:**
         
    * `repeat` - number of step sequence repetions (int), this variable is used,
      if the `size` is not defined
    
    * `size` - size of output data in samples (int), if the `size` is used,
      the `repeat` is ignored.
    
    **Returns:**
    
    * array of values representing desired steps (1d array)
    """
    check_type_or_raise(step_width, int, "step width")
    check_type_or_raise(repeat, int, "repeat")
    try:
        values = np.array(values)
    except:
        raise ValueError('Values must be a numpy array or similar.') 
    # generate steps
    x = np.repeat(values, step_width)          
    if size is None:
        # repeat according to the desired repetions
        x_full = np.tile(x, repeat)      
    else:

        check_type_or_raise(size, int, "size")